Ask Your Question

eric.c.kangas's profile - activity

2016-04-26 05:12:37 +0200 received badge  Famous Question (source)
2015-01-01 19:52:28 +0200 received badge  Notable Question (source)
2013-09-01 16:10:07 +0200 received badge  Popular Question (source)
2013-02-09 11:30:04 +0200 commented answer graph formatting issue in graphics array

Sounds like this ticket should have been fixed ages ago. I guess I could then save each graph as an image and use libre office to setup the array.

2013-02-08 13:09:28 +0200 commented answer graph formatting issue in graphics array

okay I was able to get everything to show up correctly on the graphics_array. However for font size on the plots I was not able to change at all. code for one of the plots: pltx = list_plot(tx, color = 'red', plotjoined=True, thickness=0.5) I used list_plot instead of line like last time. I tried adding fontsize = 5 to the list_plot function it works only if I plot it separately. I even tried adding it to the show function for the graphics_array however the first plot in the array was the only one that was affected by the fontsize function.

2013-02-07 09:23:34 +0200 asked a question graph formatting issue in graphics array

Hi,

I would like to layout my set of phase plots in an array. However I am having issues with getting font size correct, and axes labels to show up on all the graphs. Also my distance/velocity/acceleration phase plots are showing up as not being an graphic so I am unable to add them to the array.

code:

xy = zip(result[:,0],result[:,2])
uv = zip(result[:,1],result[:,3])
dudv = zip(udott,vdott)
tx = zip(ts,result[:,0])
ty = zip(ts,result[:,2])
tu = zip(ts,result[:,1])
tv = zip(ts,result[:,3])
tudot = zip(ts,udott)
tvdot = zip(ts,vdott)
xu = zip(result[:,0],result[:,1])
yv = zip(result[:,2],result[:,3])
udu = zip(result[:,1],udott)
vdv = zip(result[:,3],vdott)
xdu = zip(result[:,0],udott)
ydv = zip(result[:,2],vdott)
xudu = zip(result[:,0],result[:,1],udott)
yvdv = zip(result[:,2],result[:,3],vdott)

pltx = line(tx, color = 'red', thickness = 0.05)
plty = line(ty, color = 'orange', thickness = 0.05)
pltxy = line(xy, color = 'yellow', thickness = 0.05)
pltu = line(tu, color = 'green', thickness = 0.05)
pltv = line(tv, color = 'blue', thickness = 0.05)
pltuv = line(uv, color = 'indigo', thickness = 0.05)
pltudot = line(tudot, color = 'violet', thickness = 0.05)
pltvdot = line(tvdot, color = 'red', thickness = 0.05)
pltdudv = line(dudv, color = 'orange', thickness = 0.05)
pltxudu = line(xudu, color = 'yellow', thickness = 0.5)
pltyvdv = line(yvdv, color = 'green', thickness = 0.5)

show(graphics_array([pltx,plty,pltxy,pltu,pltv,pltuv,pltudot,pltvdot,pltdudv],3,3), frame = True, axes = False, dpi = 200)
2013-02-07 07:48:43 +0200 commented answer coupled second order differential equation

In Mathematica I was able to also solve for distance, velocity, and acceleration using their ode solve function for the restricted three body problem. I was just surprised that Sage wasn't able to do that.

2013-02-06 19:40:39 +0200 commented answer coupled second order differential equation

interesting so the odeint function isn't setup yet to calculate acceleration at this time.

2013-02-06 18:39:56 +0200 commented answer coupled second order differential equation

Also I need to figure out how to solve numerically the acceleration. I tried also solving for udot, and vdot, but I get an error. error: ValueError Traceback (most recent call last) /home/eric/programs/sage-5.5/local/lib/python2.7/site-packages/sage/calculus/desolvers.pyc in func(y, t) 1538 v = list(y[:]) 1539 v.append(t) -> 1540 return [dec(*v) for dec in desc] 1541 1542 if not compute_jac: /home/eric/programs/sage-5.5/local/lib/python2.7/site-packages/sage/ext/interpreters/wrapper_rdf.so in sage.ext.interpreters.wrapper_rdf.Wrapper_rdf.__call__ (sage/ext/interpreters/wrapper_rdf.c:1482)() 73 74 ---> 75 76 77 ValueError: --------------------------------------------------------------------------- error Traceback (most recent call last)

2013-02-06 16:26:56 +0200 commented answer coupled second order differential equation

thank you that will work as well.

2013-02-06 16:25:19 +0200 commented answer coupled second order differential equation

okay even I am having issues with scipy. I try importing odeint but it won't let me. code: import scipy; from scipy import odeint; error: --------------------------------------------------------------------------- ImportError Traceback (most recent call last) /home/eric/<ipython console=""> in <module>() ImportError: cannot import name odeint

2013-02-06 13:31:21 +0200 commented answer coupled second order differential equation

I will try out scipy

2013-02-06 10:23:59 +0200 commented question Can I run SAGE in an editor

You can also use a program called cantor.

2013-02-06 10:19:16 +0200 asked a question coupled second order differential equation

Hi,

I am working on the restricted three body problem, and it turns out it is a coupled second ODE.

code:

a,t = var('a,t')
x = function('x', t)
y = function('y', t)
dx2 = diff(x,t,2) == -(1-a)*((x-a)/(sqrt((x-a)^2 + y^2))^3)-a*((x+1-a)/(sqrt((x+1-a)^2 + y^2))^3)+x+2*diff(y,t,1)
dy2 = diff(y,t,2) == -(1-a)*(y/(sqrt((x-a)^2 + y^2))^3)-a*(y/(sqrt((x+1-a)^2 + y^2))^3)+y-2*diff(x,t,1)
desolve(dx2, x, ics=[0,1])

error:


ValueError Traceback (most recent call last)

/home/eric/<ipython console> in <module>()

/home/eric/programs/sage-5.5/local/lib/python2.7/site-packages/sage/calculus/desolvers.pyc in desolve(de, dvar, ics, ivar, show_method, contrib_ode)
418 ivars = [t for t in ivars if t is not dvar]
419 if len(ivars) != 1:
--> 420 raise ValueError, "Unable to determine independent variable, please specify."
421 ivar = ivars[0]
422 def sanitize_var(exprs):

ValueError: Unable to determine independent variable, please specify.

I am not sure whats going on here. From what I have looked up on how to solve ODE in sage my code should be correct. I am using cantor for a graphical interface. I have also tried the code in the command line, and still get the same error.