Hi, I tried solving a non-linear system to be able to get a plot of g against L as defined in the code below, I have used the solve command but failed and now I tried the find_root command, the below is the code and the first five result for E=0, but the other results are functions of L and g. > What am I doing wrong?
The code: from scipy import * var('L,g,E') w=2*pi.n() u=1/12 c_0 = 0.1 j = 20 AR=range (2,20,1) AR.reverse() print AR z=(g+u)^2 + j^2*w^2 -c_0*exp(-g*L)*(cos(j*w*L)*(g+u)-j*w*sin(j*w*L))/c_0*exp(-g*L)*(cos(j*w*L)* (g+u)-j*w*sin(j*w*L)) for k in AR: P=c_0*exp(-g*L)*(cos(k*w*L)*(g+u)-k*w*sin(k*w*L))/((g+u)^2+ k^2*w^2) Z = 1/P - 1 - (e^2/4)/z z = Z;z for E in arange (0.0,2.0,0.25): for L in range (0,5,1): b=((g+u)-c_0*exp^(-g*L))/c_0*exp^(-g*L) find_root(b-E^2/2*z==0,g) First set of result: [19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2] [g == 1/60] [g == (6 - 5*exp^g)/(60*exp^g)] [g == (6 - 5*exp^(2*g))/(60*exp^(2*g))] [g == (6 - 5*exp^(3*g))/(60*exp^(3*g))] [g == (6 - 5*exp^(4*g))/(60*exp^(4*g))] Thank you. Josephine. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---