hillyzz

10 Reputation

One Badge

11 years, 263 days

MaplePrimes Activity


These are replies submitted by hillyzz

@hillyzz nevermind I changed it to

Export(cos_phi2, "MyFiles.xls"); and it worked

Thanks for everything :)

@Carl Love I tried this code but it outputed to a excel file with only cos_phi in one cell;

test := [seq([k[i], cos_phi2[i]], i = 0 .. number_of_points)];
Export(test, "Myfiles.xls");

@Carl Love 

yes thats what I mean a data file with the two coloumns of values, thank you very much yet again. I'll go try this and let you know if it works.

@Carl Love 

yes that procedure is just to multiply the matrices it is based on The Transfer Matrix Method, I apologize for leaving out the variables, I didnt think they were important as they were just integer values.

n0:=1.46; n1:=1.46; n2:=4.6; d1:=0.1; d2:=0.1;theta0:=Pi/4; k_min:=0.0; k_max:=25;

Thank you very much for your continued help.

@Carl Love 

Thanks for your respone. I'm not sure how to give a more detailed example without copying the code.

number_of_points:=1000

step:=(k_max-k_min)/number_of_points;

for i from 0 by 1 to number_of_points do
k[i]:=k_min+i*step;

theta1:=evalf(arcsin(n0*sin(theta0)/n1)); theta2:=evalf(arcsin(n0*sin(theta0)/n2));
q1:=k[i]*n1*cos(theta1); q2:=k[i]*n2*cos(theta2);

F1p:=Matrix([[(q1/n1^2+q2/n2^2)/(2*q1/n1^2),(q1/n1^2-q2/n2^2)/(2*q1/n1^2)],[(q1/n1^2-q2/n2^2)/(2*q1/n1^2),(q1/n1^2+q2/n2^2)/(2*q1/n1^2)]]);
F2p:=Matrix([[(q2/n2^2+q1/n1^2)/(2*q2/n2^2),(q2/n2^2-q1/n1^2)/(2*q2/n2^2)],[(q2/n2^2-q1/n1^2)/(2*q2/n2^2),(q2/n2^2+q1/n1^2)/(2*q2/n2^2)]]);
P1p:=Matrix([[exp(-I*q1*d1),0],[0,exp(I*q1*d1)]]);
P2p:=Matrix([[exp(-I*q2*d2),0],[0,exp(I*q2*d2)]]);
Mp_period:=multiply(P1p, F1p, P2p, F2p);


cos_phi2[i]:=Re(1/2*(Mp_period[1,1]+Mp_period[2,2]));
end:


cos_bloch_phase2:=pointplot([seq([k[i],cos_phi2[i]],i=0..number_of_points)],connect=true):

display(cos_bloch_phase2,plot([1,-1],x=0..k_max,color=[red,red]));

What I want is the range of k for which cos_phi is below -1 or above 1.

@Carl Love That's perfect thanks so much. Would it be too much trouble for you to explain what the code means/does in words?

@Kitonum Hi sorry Im not entirely sure thats what I need(it may be but I dont understand it). If I tell you more explicitly what I want to do maybe you could help.

I have a list of second order differential equations such as;

x(x-1)y'' - xy' + y = 0

some of which have the first solution given, in this case

y_1 = x

y_1' = 1

y_1'' = 0  >> x(x-1)(0) - x(1) + x does = 0 and is a solution.

So now if I find a second linear independent solution I will know all solutions by the laws of superposition etc

y = C1y_1 + C_2y_2 = the solution to above ODE for all values of x.

So I want to program maple to have me input a ODE and one solution and for it to calculae the 2nd solution and the general solution.

Page 1 of 1