J4James

355 Reputation

12 Badges

12 years, 160 days

MaplePrimes Activity


These are replies submitted by J4James

@acer 

The op code is giving the numerical data in a very nice shape but the problem here that its missing the data for lambda2. 

lambda1:=(S+sqrt(S^2+4*alpha))/(2):
lambda2:=(S-sqrt(S^2+4*alpha))/(2):
p1:= plot3d({lambda1,lambda2}, alpha=max(-1/4*S^2,-5)..5, S=-10..10, grid=[5,5]):
A:=op([1,1],p1):
m:= rhs(rtable_dims(A)[1]):
n:= rhs(rtable_dims(A)[2]):
for i from 1 to m do
for j from 1 to n do
X := A[i,j,1];
Y := A[i,j,2];
Z := A[i,j,3];
printf("%f %f %f\n",Y,X,Z);
end do:
end do:

When, I try the above, I only get data for lambda1 not for lambda 2.

Is it because of the op([1,1],p1) ?


@acer Thanks for helping me out with all the issues. 

The extracted data output seems to be for a contourplot.

Am I missing something? 

Coul you share the getdata command for this 3d plot?

@acer Thanks for a very helpfull explanation.

"The (formulaic) variable end-point of the range" makes things a little complicated while accessing the numerical data.

Usually, I use this command to access the numerical data from a 3d plot

p1:= plot3d({lambda1,lambda2}, alpha=max(-1/4*S^2,-5)..5, S=-10..10): 

A:= op([1,3],p1):

a,b:= op(op([1,1],p1)):
c,d:= op(op([1,2],p1)):
m:= rhs(rtable_dims(A)[1]):
n:= rhs(rtable_dims(A)[2]):
for i from 1 to m do
for j from 1 to n do
X:= ((m-i)*a + (i-1)*b)/(m-1);
Y:= ((n-j)*c + (j-1)*d)/(n-1);
fprintf("C:/tcdata/data.txt","%f %f %f\n",Y,X,A[i,j]);
end do
end do:
close("C:/tcdata/data.txt"):

This code work fine in most cases.

Note: I don't claim this code, got it from MP.

@acer Thanks but want to know how you come up with this idea (isolate)?

 

F12 := -(1/2*(S+sqrt(S^2+4*alpha)))*alpha;

F22 := (1/2*(-S+sqrt(S^2+4*alpha)))*alpha;

plot3d({F12,F22}, S=-20..20, alpha=-1..0, contours=50,grid=[160,160]);

How make isolate work in this case or need another approach?

 

@Carl Love 

d) why don't we have the same output?

@Axel Vogt 

To check the validity, I have used this data

L := [[0., 0.656094095e-1], [0.1e-1, .1400811312], [0.2e-1, .1788700747], [0.3e-1, .1893755635], [0.4e-1, .19085062], [0.5e-1, .19095758], [0.6e-1, .190961569], [0.7e-1, .1909616452], [0.8e-1, .190961646], [0.9e-1, .190961646], [.1, .190961646], [.11, .190961646], [.12, .190961646], [.13, .190961646], [.14, .190961646], [.15, .190961646], [.16, .190961646], [.17, .190961646], [.18, .190961646], [.19, .190961646], [.2, .190961646], [.21, .190961646], [.22, .190961646], [.23, .190961646], [.24, .190961646], [.25, .190961646]]

For which I know the value of d = 2.010619298*10^(-10). Except for x= 0.030000, N= 0.189380, the actual numerator gives me the exact value of d

 

 

@Carl Love 

I tried a different set of data 

L := [[0., 0.656094095e-1], [0.1e-1, .1400811312], [0.2e-1, .1788700747], [0.3e-1, .1893755635], [0.4e-1, .19085062], [0.5e-1, .19095758], [0.6e-1, .190961569], [0.7e-1, .1909616452], [0.8e-1, .190961646], [0.9e-1, .190961646], [.1, .190961646], [.11, .190961646], [.12, .190961646], [.13, .190961646], [.14, .190961646], [.15, .190961646], [.16, .190961646], [.17, .190961646], [.18, .190961646], [.19, .190961646], [.2, .190961646], [.21, .190961646], [.22, .190961646], [.23, .190961646], [.24, .190961646], [.25, .190961646]];

The fsolve code was unable to find a single solution. On the hand, RF gives me solution

for and after each value of x= 0.060000, N= 0.190962.

 

 

 

 

check here dsolve.

@saraha never heard about it

@saraha 

restart:
ODE:=m*diff(x(t),t$2)+ c*diff(x(t),t$1) + k*x(t) = F(t);

m:=1:c:=1:k:=1:F(t):=t^2: # say

ics:=x(0)=0, D(x)(0)=0; # say

dsolve({ODE,ics});

Y:= rhs(%); #use :  to assign not ;

 plot(Y,t=0..10);

 

 

 

@saraha For some reason, I cann0t download the work sheet. please paste the code here.

Cheers

@saraha 

Its a working maple work sheet for your convenience.

@saraha 

dsolve({ODE,ics});

Y:=rhs(%);

plot(Y,t=0..10);

mck.mw

@Carl Love Thx dear

@Carl Love I even couldn't find d for a single set of value of [x, N]. fsolve is not giving me output.

 

 

First 8 9 10 11 12 13 14 Last Page 10 of 21