Items tagged with dsolve dsolve Tagged Items Feed


I have an issue with this code. The issue lies in the warning which is outputed. However, I don't know how to resolve it. Any help would be greatly appreciated! Thank you in advance!

Kind regards,

Gambia Man


a := 1.501*10^9:

Eqns := diff(xH(t), t) = vxH(t), diff(vxH(t), t) = -G*(Mh+Msat)*xH(t)/(xH(t)^2+yH(t)^2)^(3/2), diff(yH(t), t) = vyH(t), diff(vyH, t) = -G*(Mh+Msat)*yH(t)/(xH(t)^2+yH(t)^2)^(3/2):

ICs := xH(0) = a*(1+e), yH(0) = 0, vxH(0) = 0, vyH(0) = sqrt(G*(Mh+Msat)*(1-e)/(a*(1+e))):

T := sqrt(4*Pi^2*a^3/(G*(Mh+Msat))):

soln := dsolve({Eqns, ICs}, numeric):

plots:-odeplot(soln, [xH(t)/a, yH(t)/a], 0 .. 10*T, scaling = constrained, labels = ["x/a", "y/a"], numpoints = 2000);

Warning, cannot evaluate the solution further right of 453574.15, probably a singularity







Suppose we have a differential equation that it's order is 2. For example

diff(x(t), t, t)+(1000*(x(t)^2-1))*(diff(x(t), t))+x(t) = 0,

and we want to solve it numerically. When we use some initial values and dsolve it, the maple solves it very quickly. We can plot each new equations of x(t) without any problem respect of "t" or else.

But when we want to show the variation of "diff(x(t), t, t)" respect of "t" (when our derivation order is equal or upper than our differential equation order) our answer is 0 however dx(t)/dt is not 0 or constant!

What's happen here?

I tested it with all kind of methods as "rkf45","rosenbrock","lsode" etc.  but non of them showed me a correct answer.

How can I solve it correctly?
Please help me!


Dear all;

Thanks in advance for helping me to plot the solution of this second order ode.


ode := diff(y(x), x, x) = x*y(x)+x^(17/12);
ics := y(1000) = 0, y(1001) = 1;

How can I plot the solution obtained in the range (1000, 1001).


This is the code

This is the warning 

Warning, The use of global variables in numerical ODE problems is deprecated, and will be removed in a future release. Use the 'parameters' argument instead (see ?dsolve,numeric,parameters )"


How to solve it?


i have an ODE like this:

I sove this ODE with plot order:

odeplot(sol, [x, (3*D1*a+4*D2)*P(x)/((1-q*S(x))*D2)], .5 .. (1/2)*Pi, tickmarks = [[seq((1/10)*i*Pi = (180*i*(1/10))*`°`, i = 1 .. 8)], default]);
my plot work very well. but i need to plot this ODE with five different parameter (q for for instance, q=0.1 & q=0.2 ....) all in one axis. something like this:

hi.please see attached file and help me

"initial Newton iteration is not converging" in dsolve cople equations

Hi everyone, I'm a new one to Maple. I've just learnt some basic tools :)


This is my task. I tried to record in Maple but I had errors. I don't know why I had problems but I hope you will help me and I will do it.


This is the code which derives from works but doesn't work and the differences between two codes are two new function I added to the dsolve which are η(t) and I2(t). The I2(t) is the second part of I1(t) at the interval t>t* which subject to Phi(t*)=0.

So how to make the sentence 'if |(H(t))/(omega)|>1 then eta(t)=0 else eta(t)=arccos(-(H(t))/(omega))' and 'I2(t) = (int(p(t), x = -eta(t) .. eta(t)))/Pi' work?


This is the code


Let me explain it.

I am sure that the mistakes must be about the expresstion of the I1(t) and I2(t). Actually if you delete I1(t) and I2(t) , the whole code works and get the picture at the bottom. 

What I want is to put the expresstion of the I1(t) and I2(t) into 'sol:=dsolve...' and 'plots...' to get the picture of I1(t) and I2(t) with respect to t. Before the t* which subject to Phi(t*)=0 (The blue line in the picture at the bottom is Phi) I want I1(t) and after t* I want I2(t).

I1(t) = (int(sqrt(2*(H(t)+omega*cos(q(t)))), q(t) = q(t)-2*Pi .. q(t), numeric))/Pi.    what I want of this experesstion is to get  'int(sqrt(2*(H(t)+omega*cos(q(t)))' from  'q(t)-2*Pi' to 'q(t)' by numeric method.This q(t) is the solution of the ODE sys.

For example(the number I used is not true,just for example) , at the point t=20, q(t)=30-2*Pi.

so I1(t)= (int(sqrt(2*(H(t)+omega*cos(x))), x = 30-2*Pi .. 30, numeric))/Pi.The I2(t) I want is similar to I1(t).


How can I solve it?

I'm trying to solve the differential equation.

Eq := diff(y(x), x, x) = -(x^2+1)*y(x)+K;

dsolve({Eq, y(-1) = 0, y(1) = 0}, y(x));

But this not work very well.

Best Regards,

I want to solve an ODE from Game Theory, the Cournot competition.

It says


 where, I think,

' means diff(,q1),

c2(q2)=c*q2 for a fixed c in [0,1]



So c2,p and r2 are functions.r2 goes from [0,inf) to [0,inf).

I look for r2, which should be r2(q1)=(1-q1-c)/2 when correctly solved.

However, the command dsolve says Error in dsolve (divison by 0).

 What is wrong? How do I obtain the solution for r2 in Maple?


H := subs(p=diff(f(q,P,t), q), 1/(2*m)*p^2 + 1/2*m*w^2*q^2) = -diff(f(q,P,t), t);
H:=subs( f(q,P,t) = f1(q) + f2(t), H);
subs(m=1, diff(S,q));
p := (E, w) -> -(1/2)*sqrt(-q^2*w^2+2*E)+(1/2)*q^2*w^2/sqrt(-q^2*w^2+2*E)-E*(sqrt(w^2)/sqrt(-q^2*w^2+2*E)+sqrt(w^2)*q^2*w^2/(-q^2*w^2+2*E)^(3/2))/(sqrt(w^2)*(1+w^2*q^2/(-q^2*w^2+2*E)));
lst := [seq(p((1/2)*E, w), E=0..5),seq(-p((1/2)*E, w), E=0 .. 5)]:
plot(lst, w= -3*Pi..3*Pi, color = black, numpoints=1000);

Q is the new coordinate which is diff(S,E)

t0 is the time when argument of solve(subs(m=1, diff(S,E))=0, t) vanish
initialq := solve(solve(subs(m=1, diff(S,E))=0, t)=0, q);

after find the initial value, how to plot with new coordinate?

dsolve({H, q=0}, f(q,P,t));


i try another way to do


H := subs(p=diff(f(q,P,t), q), 1/(2*m)*p^2 + 1/2*m*w^2*q^2) = -diff(f(q,P,t), t);
H:=subs( f(q,P,t) = f1(q) + f2(t), H);
p2 := subs(m=1, diff(S,q));

initialq := solve(solve(subs(m=1, diff(S,E))=0, t)=0, q);

H := subs(p=p2, 1/(2*m)*p^2 + 1/2*m*w^2*q^2) = -diff(f(t), t);
H := subs(w=theta(t), H);
sol := dsolve({H, q=0}, numeric, range = 0 .. 30);
odeplot(sol, [t, theta(t)], refine = 2);

Error, (in dsolve/numeric/process_input) invalid specification of initial conditions, got q = 0


H := subs(p=diff(f(q,P,t), q), 1/(2*m)*p^2 + 1/2*m*w^2*q^2) = -diff(f(q,P,t), t);
H:=subs( f(q,P,t) = f1(q) + f2(t), H);
subs(m=1, diff(S,q));
p := (E, theta) -> -(1/2)*sqrt(-q^2*w^2+2*E)+(1/2)*q^2*w^2/sqrt(-q^2*w^2+2*E)-E*(sqrt(w^2)/sqrt(-q^2*w^2+2*E)+sqrt(w^2)*q^2*w^2/(-q^2*w^2+2*E)^(3/2))/(sqrt(w^2)*(1+w^2*q^2/(-q^2*w^2+2*E)));
lst := [seq(p((1/2)*E, theta), E=0..5),seq(-p((1/2)*E, theta), E=0 .. 5)]:
plot(lst, theta = -3*Pi..3*Pi, color = black, numpoints=1000);


i plot it circle in circle, should i substitute a value to q before plot?

i guess q is velocity, is it?

why substitute E with 1/2*E?

subs(q=1, subs(m=1, diff(S,q)));
p := (E, w) -> -(1/2)*sqrt(-w^2+2*E)+(1/2)*w^2/sqrt(-w^2+2*E)-E*(sqrt(w^2)/sqrt(-w^2+2*E)+sqrt(w^2)*w^2/(-w^2+2*E)^(3/2))/(sqrt(w^2)*(1+w^2/(-w^2+2*E)));
lst := [seq(p((1/2)*E, w), E=1..5),seq(-p((1/2)*E, w), E=1 .. 5)]:
plot(lst, w = -3*Pi..3*Pi, color = black, numpoints=1000);

Hi all,

I deal with the following ODE system which present a singularity when v(x)=0. I want to inject the condition "if v(x)=0 then u(x)=0" as may be a solution to avoid this singularity. If someone could help me to do that. Thanks.


ICS := { u(-2) = 4,   v(-2) = 4, (D(v))(-2) = 0 };
p:= dsolve( SYS union ICS,method=rkf45_dae,numeric,output=listprocedure);
solp := plots[odeplot](p, [[x, u(x)],[x, v(x)]], x = -5 .. 0);

 of solution to plot a function?


sys := {diff(x(t), t) = y(t), diff(y(t), t) = -(1+(1/100)*t)^2*x(t), x(0) = -1, y(0) = 2};

sys := {diff(x(t), t) = y(t), diff(y(t), t) = -(1+(1/100)*t)^2*x(t), x(0) = -1, y(0) = 2}

dsn := dsolve(sys, numeric);

dsn:=proc(x_rkf45) ... end proc


My question is how to use dsn to plot functions E(t) and I(t) with respect to t in a given interval [t1,t2].

E(t)=0.5*(diff(x(t),t)^2+w^2*x(t)^2), w=1+t/100.  I(t)=E(t)/w.


Many thanks to everyone helping me : )

1 2 3 4 5 6 7 Last Page 1 of 25