I am able to manipulate the functions, but I am unable to plot them.
Here is the code:
a,l,x,y,u,v,xdot,ydot,udot,vdot = var('a,l,x,y,u,v,xdot,ydot,udot,vdot',
domain = RR)
i = var('i', domain = QQ)
xdot = x;
ydot = y;
udot = u^2+v;
vdot = v^2+u;
N =
I tried using the solution_dict option and I was still not able to index
each solution from the solve function.
On Tuesday, March 6, 2012 10:55:08 AM UTC-8, Vincent Knight wrote:
I'm not an expert (newish sage user) but I think you want to use the solve
function with solution_dict=True. This
You're probably getting a list of dictionaries:
sage: var(x y)
(x, y)
sage: sols = solve([x^2-4==0, y^2-9==0], x, y, solution_dict=True)
sage: sols
[{y: -3, x: -2}, {y: -3, x: 2}, {y: 3, x: -2}, {y: 3, x: 2}]
This is just like any other list -- the fact the elements happen to be
dictionaries
Ok I am solving the eigenvalues and vectors for a coupled DE. All I need to
know is how to extract the solutions to the solve function. It turns out
that there are four solutions. I would like to find a way to extract each
of them instead of the cut and paste method. I tried the usual python
I'm not an expert (newish sage user) but I think you want to use the solve
function with solution_dict=True. This will give your solutions as a
dictionary which can then be indexed in the normal way.
More about that on this page:
http://www.sagemath.org/doc/reference/sage/numerical/optimize.html