# Items tagged with odeode Tagged Items Feed

### How to plot the Taylor Polynomial approximation...

December 08 2014
0 2

Hi everyone, I have been trying to plot the Taylor Polynomial approximation with the following code. However, my maple crushes everytime I run it. I indexed some of the variables to get the plot. The code works fine without the index. What did I do wrong?

y := array(1 .. 2);

Digits := 10;

n := 30;

h := .1;

T := 0;

X := 1;

f := (x, t) -> 1/(3*x(t)-t-2);

one := 1/(3*x(t)-t-2);

two := diff(f(x, t), t);

first := diff(x(t), t)

for k to n do

y[1] := subs(t = T(k), x(T(k)) = X(k), one);

y[2] := subs(first = y[1], t = T, x(T(k)) = X(k), two);

X[k+1] := X+sum(y[i]*h^i/factorial(i), i = 1 .. 2);

T[k+1] := T+h

end do;

X[n];

data := [seq([T[n], X[n]], n = 0 .. 30)];

p[2] := plot(data, style = point, color = blue);

p[3] := plot(data, style = line, color = blue);
display(p[2],  p[3])

The code without Index (which works fine)

y := array(1 .. 2);

Digits := 10;

n := 30;

h := .1;

T := 1;

X := .1547196278;

f := (x, t) -> 1/(3*x(t)-t-2);

one := x(t)^4*e^t-(1/3)*x(t);

two := diff(f(x, t), t);

first := diff(x(t), t);

for k to n do

y[1] := subs(t = T, x(T) = X, one);

y[2] := subs(first = y[1], t = T, x(T) = X, two);

X := X+sum(y[i]*h^i/factorial(i), i = 1 .. 2);

T := T+h

end do

### Error, plot phase portrait...

November 27 2014
0 1

Dear All,

I need your help to plot the phase portrait using DEtools[DEplot]  these are the lines of the code. But when I make RUN, there is an error. I need your help to fix the error. Many thinks.

r1:=1; r2:=1; q2:=2; q1=0.5;  a1:=1;

Sys1 := {diff(N(t),t) = r1*N*(1-N/q1)-P*N/(1+N), diff(P(t),t) = r2*P*(exp(-a1*P)-q2)+P*N/(1+N)};

DEtools[DEplot](Sys1,[N(t),P(t)],t=-10..10,N=0..2,P=0..2);

Many thinks

### extracting the coefficients of an ode...

November 23 2014
1 0

I have an ode in the form:

diff(u(x),x)-f(x)=u(x)^3+B(X)*u(x)+g(x)

how to extaract and name the different coefficients of the equation?

Thanks

### dsolve is giving the error function expected...

November 22 2014
2 1

So I am brand new to using Maple and am trying to solve a system of ODE's. When I try and use dsolve however I reciever the error "function expected" and I am not sure why. The code I have is as follows

sys_ode := diff(A(t), t) = a*(A(t)+B(t))-b1*A(t)*(C(t)+D(t))-g1*A(t)*B(t), diff(B(t), t) = -b2*B(t)*(C(t)+D(t))+g1*A(t)*B(t), diff(C(t), t) = e*(b1*A(t)+b2*B(t))*C(t)-g2*b2*C(t)*B(t)-g3*C(t)*D(t), diff(D(t), t) = g2*b2*C(t)*D(t)-m*D(t)

dsolve([sys_ode])

I'm sure it is something simple, but I just can't seem to figure out where the issue is. Any help is much appreciated.

### Substituting an expression into an expression...

November 22 2014
1 1

I'm trying to substitute one Differential equation into another differential equation.

eq1:=d*n(t)/dt = (rho(t)-beta)*n(t)/Lambda+lambda*C(t)+q

eq2:=diff(eq1, t)

resulting in -> eq2 := d*(diff(n(t), t))/dt = (diff(rho(t), t))*n(t)/Lambda+(rho(t)-beta)*(diff(n(t), t))/Lambda+lambda*(diff(C(t), t))

then I'm given that (diff(C(t), t)) is given by another equation:

eq3:=d*C(t)/dt = beta*n(t)/Lambda-lambda*C(t)

At this point I'm trying to substitute equation 3 into equation 2 for diff(C(t),t)

eq4 := subs(diff(C(t), t) = rhs(eq2), eq5)

however no matter what way's I try this I get an error:

Error, (in simpl/reloprod) invalid terms in product: (d*(diff(n(t), t))/dt = (diff(rho(t), t))*n(t)/Lambda+(rho(t)-beta)*(diff(n(t), t))/Lambda+lambda*(diff(C(t), t)))^-1

I then tried to map it but again i got an error specifically about the first parameter:

Error, invalid operator parameter name

eq5:=map((d/dt C(t))->beta/Lambda*n(t)-lambda*C(t),eq2)

I'm just wondering if what I am trying to do is even possible in Maple?

If anyone can help I would greatly appreciate it!

### Error, (in dsolve/numeric/bvp) initial Newton iter...

November 10 2014
0 8

i am solving 3 ODE with boundary condition.. with boundary condition

b.mw

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/b.mw .

then i got this error

Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging

i dont know where i need to change.. could you help me..

### Solve the Coefficient of ODES ...

November 10 2014
0 1

Dear Friends,

My present problem is to calculate the coefficients

of ODES based on the experiment data. In order to simulate the actual experiment, a set of  is given with . Then the experiment data (yexp) can be calculated. Finally, the least-squares method (lsq) is used to calculate the coefficient values. Now the NLPSolve function can be used. However, the globalsolve cant run.

If it is convenient for you, wish you can solve it.

Code:

restart;
cdm_ode := diff(y1(t), t) = c0*(y6(t)*(1-y3(t))/(s0*(1-y4(t)*(1-y5(t)))))^n/(1-y2(t)), diff(y2(t), t) = ks*y2(t)^(1/3)*(1-y2(t)), diff(y3(t), t) = h1*(1-y3(t)/h2)*c0*(y6(t)*(1-y3(t))/(s0*(1-y4(t)*(1-y5(t)))))^n/(sigma*(1-y2(t))), diff(y4(t), t) = (1/3)*kp*(1-y4(t))^4, diff(y5(t), t) = A*B*y1(t)^(B-1)*c0*(y6(t)*(1-y3(t))/(s0*(1-y4(t)*(1-y5(t)))))^n/(1-y2(t)), diff(y6(t), t) = y6(t)*c0*(y6(t)*(1-y3(t))/(s0*(1-y4(t)*(1-y5(t)))))^n/(1-y2(t));

tol_t := 3600;
sol := dsolve([cdm_ode, y1(0) = 0, y2(0) = 0, y3(0) = 0, y4(0) = 0, y5(0) = 0, y6(0) = 175], numeric, range = 0 .. tol_t, output = listprocedure, parameters = [c0, n, sigma, s0, ks, h1, h2, kp, A, B]);

sol(parameters = [5.7*10^(-6), 10.186, 175, 200, 5*10^(-8), 10000, .269, 1.5*10^(-7), 1.5, 2]);

t := [seq(i^2, i = 0 .. 50, 1)];

y1data := subs(sol, y1(t));

y1exp := [seq(y1data(t[i]), i = 1 .. 51)];

err := proc (c0, n, s0, ks, h1, h2, kp, A, B) local y1cal, y1val, lsq; sol(parameters = [c0, n, 175, s0, ks, h1, h2, kp, A, B]); y1cal := subs(sol, y1(t)); y1val := [seq(y1cal(t[i]), i = 1 .. 51)]; lsq := add((y1val[i]-y1exp[i])^2, i = 1 .. 51); lsq end proc;

with(Optimization);
val := NLPSolve(err, 10^(-8) .. 10^(-4), 2 .. 20, 150 .. 250, 10^(-2) .. 1, 100 .. 20000, 10^(-5) .. .4, 10^(-5) .. 1, .5 .. 2, 1 .. 10);
GlobalSolve(err, 10^(-10) .. 10^(-4), 2 .. 20, 150 .. 250, 0 .. 1, 100 .. 15000, 0 .. .5, 0 .. 1, .5 .. 2, 1 .. 5);

Error, (in GlobalOptimization:-GlobalSolve) InertForms does not evaluate to a module

### Error, (in dsolve/numeric/bvp) initial Newton iter...

November 06 2014
0 2

i am solving 3 ODE question with boundary condition. when i running the programm i got this error.. any one could help me please.. :)

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging
 >
 (6)
 >
 Warning, unable to evaluate the functions to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct
 >

### calculs using Maple...

November 01 2014
1 6

Dear all;

Thank you very much is you can make the computation using maple.

I have this system:

x'(t)=x*y-x^2*y+y^3;

y'(t)=y^2+x^3-x*y^2;

I would like to make to change the system in another system using polar coordinate: like x=r*cos(theta) and y=r*sin(theta), and then derive a simple system: r'=F(r, theta) and theta'=G(r, theta), where here F and G are two unknowns functions.

Many thinks if someone can help me using a Maple code.

### convert second order ode to first order ode.......

October 30 2014
0 2

Hi every body:

i have a second order ode and will convert to two ode of first order with maple,how do this work???

eq := diff(y(x), x, x)+2*y(x)+y(x)^2 = 0

### Solving system of ODEs whose variables come in 2 p...

October 28 2014
0 1

Let N be an integer.

For each pair of integers (n,m) where 1<= n,m <= N, we have a variable f_{n,m}(t).

Then for these we have a system of ODEs

d/dt f_{n,m}(t) = \sum_{n', m'} f_m'n' * f_m''n'' * (m'n'' - m''n')

where m''=m-m', n''=n=n', and the sum is simply over for all pairs (n',m').

I simply do not know how to put these set of equations into Maple in a nice way.

I will really appreciate any help!

### Solving system of ODEs by Laplace transform...

October 11 2014
0 1

I'm trying to solve this system of ODEs by Laplace transform.

> de1 := d^2*y(t)/dt^2 = y(t)+3*x(t)

> de2 := d^2*x(t)/dt^2 = 4*y(t)-4*exp(t)

with initial conditions

> ICs := y(0) = 2, (D(y))(0) = 3, x(0) = 1, (D(x))(0) = 2

Using

> deqns := de1, de2

and

> var := y(t), x(t)

I need to solve it for both y(t) and x(t), I have tried this by:

> dsolve({ICs, deqns}, var, method = laplace)

And

> dsolve({ICs, deqns}, y(t), method = laplace)

> dsolve({ICs, deqns}, x(t), method = laplace)

However I get this error message:

Error, (in dsolve/process_input) invalid initial condition

Any help is appreciated

### Solving an ode : Warning, it is required that the...

October 10 2014
1 3

Hello,

could you help me solve this error ? I don't understand what it means.

> eq3:=diff(x(t),t,t)+Gamma*diff(x(t),t)+omega[0]^2*(x(t)-(diff(x(t),t,t)+Gamma*diff(x(t),t)+omega[0]^2*x(t)+omega[0]^2*X[0])/omega[0]^2) = -omega[0]^2*X[0]:
> dsolve(eq3);
Warning, it is required that the numerator of the given ODE depends on the highest derivative. Returning NULL.

Thanks.

### bifurcation diagram...

September 29 2014
1 0

Hi,

I have a non linear ode with sinosoial term, (sin(x)).

How can we Analyse the system and plot the bifurcation diagram:

x'=r*x-sin(x);

Thank you very much for your help.

### Homotopy Analysis Method...

September 26 2014
0 0

Hi

I have three system of ODE and i would like to solve it using Homotopy perturbation method. Could you please provide to me the code in Maple or the Maple pachage that used to solve it by Homotopy perturbation method ?

I hope to hear you soon

Sara

 2 3 4 5 6 7 8 Last Page 4 of 22
﻿