## Plotting the movement of 4 planets...

Greetings,

currently im working on a project in which i basically have to calcuate and plot a little solar system, using newton mechanic. The work is done, but as it appears, the solution simply cannot be true. In the given example you can see that the planets move in more or less straight lines. I presume that the error is somewhere in the solution of the system of differential equations, but i can't see where it is.

I am grateful for every advice.

PlanetenSpacecurve.mw

## command to retrieve a solution...

Hi

I have a set of differential equations which I have solved for a specific value, and would like to use the second answer (F__A(V)) in my next calculations

What command can I use to retrieve that value?

sol(0.1e-4);
[V = 0.00001, F__A(V) = HFloat(3.498873118476744e-6),

F__B(V) = HFloat(1.9101126881523255e-5),

F__C(V) = HFloat(9.550563440761627e-6)]

Regards

## Use of numerical solution...

Hi, similar problem as before :) I want to use numeric solution DE while solving another DE. Example:

sol:=dsolve(Dsys,numeric)

dsolve({diff(y(x),x)=y(x)-sol,y(0)=1},numeric)

The second part doesn´t work. Can you help me to fix it? Thank you :)

## Finding the eigenvalues...

Hello guys,

I have some system of differential equations,

How can i find  eigenvalues of this system?

`If i have solution`

res := evalf(dsolve(sys union ics, convert(x, list), type = numeric, method = rkf45))

and

sol := evalf(dsolve(sys union ics, convert(x, list), method = laplace))

AnSolution.mw

Thanks!

## Numeric problem...

Hi,

I want to subtract two functions. One of them is numeric-type and the second is exact. Something like this:

solNum := dsolve(Dsys, numeric);

sol := dsolve(Dsys);

plot(solNum-sol)

In the last step there is an error (of course). How can I fix it?

Thank you very much

## Boundary value problem...

(1)How can i draw a graph by considering eta on x-axis and f'(eta),theta(eta)on y-axis in a single graph with respect to variatiation  in the parameter beta=0.01,0.1,1.0..

(2). how can i get different values of f'(eta) by varying values of eta .

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 (7)
 >
 (8)
 >
 >
 >
 >
 >
 >

## My system of equation was ODE, but Maple insists i...

I was trying to solve a system of ODE using Maple, but to my surprise, Maple recognizes diff((phi(t), t)) as a variable which is different than t.

My code is as following:

dsys := {2*m1*(a+l*sin(phi(t)))^2*(diff(diff(theta(t), t), t))+4*m1*(a+l*sin(phi(t)))*l*cos(phi(t))*(diff(theta(t), t))*(diff(phi(t), t)) = M, 2*m1*l^2*(diff(diff(phi(t), t), t))+4*m2*l^2*sin(2*phi(t))*(diff(phi(t), t))*(diff(phi(t), t))+4*m2*l^2*sin(phi(t))^2*(diff(diff(phi(t), t), t))-2*m1*(a+l*sin(phi(t)))*l*cos(phi(t))*(diff(theta(t), t))*(diff(theta(t), t))-2*m2*l^2*(sin(2*phi(t)))(diff(phi(t), t))*(diff(phi(t), t)) = -(2*(m1+m2))*g*l*sin(phi(t))-2*k*l^2*sin(2*phi(t)), phi(0) = 0, theta(0) = 0, (D(phi))(0) = 0, (D(theta))(0) = 0}

subs({M = 10, a = .5, g = 9.81, k = .1, l = .5, m1 = 10, m2 = 1}, dsys);

dsn1 := dsolve(dsys, numeric)

The error I got was Error, (in dsolve/numeric/process_input) input system must be an ODE system, got independent variables {t, diff(phi(t), t)}

I don't get why this is happening. Could you show me what's going on?

## How to create a data table from dsolve?...

I have a system of ode's

restart:with(plots):
eq1:=((diff(f(x),x\$3)))+f(x)*diff(f(x),x\$2)-a*diff(f(x),x\$1)^2=0;
eq2:=(diff(g(x),x\$2))+b*f(x)*diff(g(x),x\$1)=0;
bc1:=f(0)=0,D(f)(0)=1,D(f)(5)=0,g(0)=0.5,g(5)=0;

dsolve can solve it easily.

sol:=dsolve(subs(a=0.5,b=0.5,{bc1,eq1,eq2}), numeric):

Now I was to use the numerical data from the sol in the following expression

Expr:=a*f(x)+b*g'(x)+c*f'(x)*g(x) # at x=1:

to make a table of this form a  b  c  Expr, where a, b, c vary simultaneously between 0 and 1 by 0.2 producing data for Expr.

Any suggestions?

## what happen with this numerical differentiation of...

 (1)

 (2)

 (3)

 (4)

when i try to get a numerical solution(using fdiff) for a second order derivative from a numerical diff ecuation procedure i got "index out of range". however, it perfectly works with a first order derivative. what's thwe matter there?

thankyou very much..

## How to improve the numerical solution of BVP (FDM ...

I have solved a BVP using finite difference method in maple. But the comparsion with the dsolve solution shows big difference,

Why there is too much difference? Is there an elegant way to implement FDM?

FDM_Dbvp_sheet_1.mw

## Error in dsolve/numeric/bvp...

Hello every one ;

i have these flowing error :

 >
 >
 (1)
 >
 (2)
 >
 >
 (3)
 >
 >
 (4)
 >
 >
 >
 >
 >

any solution ?

thank you

Best regards !

## why is this DAE system crashing?...

could you help with this? maybe because of too long exponents or just a maple bug?

when i try to solve this DAE it just crash. it says connection with kernel has been lost, and tells me to look for online help.

thank you very much...

HI

thanls...

## why maple recognize my system but doesn´t solve it...

 (1)

i have a system with 5 dif equations and five unknows. i have told to maple to solve it numerically with interactively solve comand (right cilck button). the window open like it normally does and i put values to my parameters, with an initial condition for the system (Q(0)=0). then i press numerically solve and that's all, the program just keep evaluating with no answer. i wait for 15 min, which i think is too much time, and got any answer yet.

hope you can help with this

thanks..

## Bug in dsolve numeric or fdiff?...

To summarize,

dsolve numeric parametric form gives wrong answers when fdiff is used to calculate the Hessian. Doing dsolve twice gives the correct answer. Hope I am not making syntax or programming errors.

Also, fdiff is not compatible with vector form.

 > restart;
 > Digits:=15;
 (1)
 > sys:=diff(y1(t),t)=-(u+u^2/2)*y1(t),diff(y2(t),t)=u*y1(t);
 (2)

The system is solved with initial conditions 1,0 and value of u being equal to u1 for t<=0.5, and u2 for t>0.5. The objective is y2 at t =1. There are errors when Hessian is calculated using parametric dsolve and fdiff

 > sol1 := dsolve({sys, y1(0) = alpha, y2(0) = beta}, type = numeric, 'parameters' = [alpha, beta, u],maxfun=0,range=0..0.5):
 > obj1:=proc(u1,u2) local z1,s1,s2,z2; global sol1; sol1('parameters'=[1,0,u1]); z1 := sol1(.5); s1:=subs(z1,y1(t)); s2:=subs(z1,y2(t)); sol1('parameters'=[s1,s2,u2]): z2:=sol1(0.5); -subs(z2,y2(t)); end proc;
 (3)
 > u0:=[0.8,1.8];
 (4)
 > obj1(op(u0));
 (5)
 > Hess1:=Matrix(2,2):for i from 1 to 2 do for j from 1 to 2 do Hess1[i,j]:=fdiff(obj1,[i,j],u0,workprec=1.0);od;od;Hess1;
 (6)

Hessian is wrong. It should be noted that when dsolve is called twice inside the objective function there is no error in Hessian calculation with fdiff. The parametric dsolve is efficient, how to get correct answers with that? Another question is how to use fdiff with vector form instead u1,u2 etc to make it generic for any number of variables?

 > obj2:=proc(u1,u2) local z1,s1,s2,z2,sol2; sol2:=dsolve({op(subs(u=u1,[sys])), y1(0) = 1, y2(0) = 0}, type = numeric,maxfun=0,range=0..0.5); z1 := sol2(.5); s1:=subs(z1,y1(t)); s2:=subs(z1,y2(t)); sol2:=dsolve({op(subs(u=u2,[sys])), y1(0) = s1, y2(0) = s2}, type = numeric,maxfun=0,range=0..0.5): z2:=sol2(0.5); -subs(z2,y2(t)); end proc;
 (7)
 > obj2(op(u0));
 (8)
 > Hess2:=Matrix(2,2):for i from 1 to 2 do for j from 1 to 2 do Hess2[i,j]:=fdiff(obj2,[i,j],u0,workprec=1.0);od;od;Hess2;
 (9)

Doing dsolve twice gives correct answer compared to one parametric dsolve even though objective returns the same number (even gradient returns the expected answers).