Items tagged with ode ode Tagged Items Feed

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!


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?

Solving an ODE ...

November 23 2015 Inacio 65


 I am trying to solve an differential equation in Maple, but I have no response from Maple.Can someone give a look for me? The coefficients a and b cannot be zero.

 Thanks a lot.


Download edo_soluçã

Hello everybody

I have a system of ODEs that are too large. I am trying to solve this system using Maple. The corrsponding file has been uploaded. I have 2 question. 1- Does anyone know what is the source of error? 2- Is this a high expectation for Maple to solve such a too big system of ODEs. Note: It makes a few minutes to run all the programm.

Thanks in advance


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:

This is the code. I am sure that the mistakes must be something about t0,I1(t) and I2(t) because everything else works well.

for t0 = NextZero(proc (t) options operator, arrow; Phi(t) end proc, 0) I want to get the root of Phi(t)=0 and I denote the root as t0.

for I1(t) and I2(t) I want to get the integral considering the t is parameter and x is the variable so after the integral I can get two funcions of t. And the limits of I2(t) should also be a funcion of t.


I have an ODE plot like this and I want its horizontal axes to be in degree instead of radian, but I don't know how


In this procedure I get the error, 

Error, `:=` unexpected

I know what it means I just can't seem to resolve it. Any help would be greatly appreciated! Thank you in advance for looking at this code!

Kind regards,

Gambia Man

HamilMat := proc (K::integer) local ni, mi, nj, mj, N, Hamil, Eigenvec, i, j, res; option remember; global Vij, U, L; N := K^2; ni := Vector(N); mi := Vector(N); nj := Vector[row](N); mj := Vector[row](N); for i to N do for j to K do res := (i+K-j)/K; if type(res, integer) = true then ni[i] := j; nj[i] := j; mi[i] := res; mj[i] := res end if end do end do; Hamil := Matrix(N, shape = symmetric); for i to N do for j from i to N do if i <> j then Hamil(i, j) := Vij(ni[i], mi[i], nj[j], mj[j]) elif i = j then Hamil(i, j) := Vij(ni[i], mi[i], nj[j], mj[j])+(1/2)*(ni[i]^2+mi[i]^2)*Pi^2/L^2 end if end do end do; return Eigenvec := Eigenvectors(Hamil, output = ['values', 'vectors']), Hamil end proc

Error, `:=` unexpected




 with small step rather than two points?

I had writen my questions into this code And I think there's maybe something wrong with A=[0..130]

I think you can understand what I want by reading this code but if you are confused please let me know.

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?


My goal is to plot the integral J with respect to t and as you can see J is a piecewise function.

This is my code.


Actually it's a problem about adiabatic invariants.

If you want to know the backgroud please see this link.

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