I looked at your problem. A few observations. On 27 mei, 18:13, rpoirier <rpoir...@champlaincollege.qc.ca> wrote: > I want to solve a relativity problem using SOLVE. > I used to be able to, but now I run into a problem. > > lp=60e9*1000 > dtp=1.25*24*3600 > beta=var('beta') > gamma=1/(sqrt(1-beta^2)) > solve(dtp*gamma==lp/(beta*c),beta)
1) The variable c is not defined. In general, when you ask a question, please ensure it is complete. > the result I expect is a numerical value, but I get the following: > [beta == 733841/396000*sqrt(-beta^2 + 1)] >From the answer, I found as value: c=396000*60e9*1000/ (1.25*24*3600*733841) 2) 'beta' is a variable, and mathematically it could be many things. For instance a matrix.... So the solution is correct, and to get a numeric value you could use a more specific function. Via plot(dtp*gamma-lp/(beta*c),0,1) we see that 0.7 is near the numerical solution. Now apply a routine specifically for finding numerical solutions: find_root(dtp*gamma-lp/(beta*c),0.5,0.9) 0.88004280932699031 3) But your problem has an interesting aspect, and it raises a question for me. Both lp and c are both reals: <type 'sage.rings.real_mpfr.RealNumber'>. But the solution yields 733841/396000, a rational number (<type 'sage.rings.rational.Rational'>). Why? -- 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 URL: http://www.sagemath.org