Items tagged with ode ode Tagged Items Feed

Hi,

I have the a code with some parameters including

Nr= 0, 50, 100

Ha=0, 5, 10

EPSILONE= 0, 0.5, 1

Phiavg= 0.02, 0.06, 0.1

0.1<NBT<10

I can give the solution for higher values of 5<NBT<10 and there is no problem. However, As I reduce the values of NBT, the convergence of the problem is hard. for some values of parameters I cannot find the solution. for example:

Nr=Ha=0

EPSILONE=1

Phiavg=0.06

NBT=0.3

 

I would be most grateful if you can tel me how change the algorithm to find the solution in the range of all parameters.

Many thanks for your attentions in advance

The code has been attached

code_7-8-2014_(1).mw

 

Amir

Greetings,

       I am new to Maple and this forum. I would like to obtain a Jacobian of a system of 12 ODEs. What have I done wrongly with my code?

eq_1 := -B*a+A-V*(c+d+t+s+h)*a/(a+b+c+d+e+f+g+h+s+t+u+v)-W*(b+d)*a/(a+b+c+d+e+f+g+h+s+t+u+v);
eq_2 := W*(b+d)*a/(a+b+c+d+e+f+g+h+s+t+u+v)-V*(c+d+t+s+h)*b/(a+b+c+d+e+f+g+h+s+t+u+v)-(F*G+B+D)*b;
eq_3 := V*(c+d+t+s+h)*a/(a+b+c+d+e+f+g+h+s+t+u+v)-W*(b+d)*c/(a+b+c+d+e+f+g+h+s+t+u+v)-(B+E+C)*c;
eq_4 := V*(c+d+t+s+h)*b/(a+b+c+d+e+f+g+h+s+t+u+v)+W*(b+d)*c/(a+b+c+d+e+f+g+h+s+t+u+v)-(B+C+D+F)*d;
eq_5 := G*F*b-V*(c+d+t+s+h)*e/(a+b+c+d+e+f+g+h+s+t+u+v)-(B+H)*e;
eq_6 := H*e-V*(c+d+t+s+h)*f/(a+b+c+d+e+f+g+h+s+t+u+v)-(B+S)*f;
eq_7 := S*f-V*(c+d+t+s+h)*g/(a+b+c+d+e+f+g+h+s+t+u+v)-B*g;
eq_8 := V*(c+d+t+s+h)*g/(a+b+c+d+e+f+g+h+s+t+u+v)+S*s-(B+E+C)*h;
eq_9 := F*d+V*(c+d+t+s+h)*e/(a+b+c+d+e+f+g+h+s+t+u+v)-(B+C+H+T)*t;
eq_10 := H*t+V*(c+d+t+s+h)*f/(a+b+c+d+e+f+g+h+s+t+u+v)-(U+B+C+S+S)*s;
eq_11 := T*t+W*(b+d)*x/(a+b+c+d+e+f+g+h+s+t+u+v)-(B+H+Y)*u;
eq_12 := U*s-(B+S)*v+H*u-Y*H*v/(H+S);
with(linalg);
J := Jacobian([eq_1, eq_2, eq_3, eq_4, eq_5, eq_6, eq_7, eq_8, eq_9, eq_10, eq_11, eq_12], [a, b, c, d, e, f, g, h, s, t, u, v]);

I am getting the message: 

 Vector(4, {(1) = ` 12 x 12 `*Matrix, (2) = `Data Type: `*anything, (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

Thanks!!

Hi,

according to my previous question

http://www.mapleprimes.com/questions/201435-ODE-With-Constraint

I wrote the following code. at first, the code solve the equation for f and when it slves that, I want to solve Theta in such a way that use the values of f in previous calculation. I use the command 'known' but i couldnt find thesolution

I would be most grateful if you could help me in this problem

Thanks for your attentions in advance


restart; # Notice that Restart (capital R) has no effect (to catch that use semicolon, not colon)
a:=0.13:
b:=0.41:
reynolds:=1.125*10^7;  
Eq1:=diff(f(x),x$3)+diff(f(x),x$2)*f(x)+b^2*sqrt(2*reynolds)*diff(diff(f(x),x$2)^2*x^2,x$1);
Eq2:=diff(g(x),x$3)+diff(g(x),x$2)*g(x)+c*a^2*sqrt(2*reynolds)*diff(diff(g(x),x$2)^2*x,x$1);
eq1:=isolate(Eq1,diff(f(x),x,x,x));
eq2:=subs(g=f,isolate(Eq2,diff(g(x),x,x,x)));
EQ:=diff(f(x),x,x,x)=piecewise(x<c*0.1,rhs(eq1),rhs(eq2));


c:=75:
;
Q:=proc(pp2) local res,F0,F1,F2;
print(pp2);
if not type(pp2,numeric) then return 'procname(_passed)' end if:
res:=dsolve({EQ,f(0)=0,D(f)(0)=0,(D@@2)(f)(0)=pp2},numeric,output=listprocedure);
F0,F1,F2:=op(subs(subs(res),[f(x),diff(f(x),x),diff(f(x),x,x)])):
F1(c)-1;
end proc;


fsolve(Q(pp2)=0,pp2=(0..102));
se:=%;
res2:=dsolve({EQ,f(0)=0,D(f)(0)=0,(D@@2)(f)(0)=se},numeric,output=listprocedure);
G0,G1,G2:=op(subs(subs(res2),[f(x),diff(f(x),x),diff(f(x),x,x)])):

plots:-odeplot(res2,[seq([x,diff(f(x),[x$i])],i=0..2)],0..2); #This plots from and past 0.1*c
pr:=1;
prt:=0.89;

Eq11:=diff(theta(x),x$2)+pr*diff(theta(x),x$1)*f(x)+pr/prt*b^2*sqrt(2*reynolds)*diff(diff(f(x),x$2)*diff(theta(x),x$1)*x^2,x$1);
Eq22:=diff(g(x),x$2)+pr*diff(g(x),x$1)*f(x)+pr/prt*a^2*c*sqrt(2*reynolds)*diff(diff(f(x),x$2)*diff(g(x),x$1)*x^1,x$1);
eq11:=isolate(Eq11,diff(f(x),x,x));
eq22:=subs(g=theta,isolate(Eq22,diff(g(x),x,x)));
EQT:=diff(theta(x),x,x)=piecewise(x<c*0.1,rhs(eq11),rhs(eq22));


QT:=proc(pp3) local res3,theta0,theta1;
print(pp3);
if not type(pp3,numeric) then return 'procname(_passed)' end if:
res3:=dsolve({EQT,theta(0)=1,D(theta)(0)=pp3,known=f},numeric,output=listprocedure);
theta0,theta1:=op(subs(subs(res),[theta(x),diff(theta(x),x)])):
theta0(c);
end proc;

fsolve(QT(pp3)=0,pp3=(0..200));
res3(0);



Amir

Hi. I am trying to identify mode shapes (phi(x)) and natural frequencies  of non-uniform euler-bernoulli beam. There are number of numerical methods to solve ODE with certain boundary conditions (i.e. Runge Kutta method). Problem is that I am newbie here. I am interested in particularly first vibration mode and its frequency. Is there anyone acquainted with it and would be able to help me?  Non-unif.mw

I was given that solitary initial state to see how it will deform as time goes on. am struggling to get my code so that I can get video frames. please help on how I can generate my code

 

uo(x)= a0x2(1-x)2 for x (less than or equal to) x (less than or equal) 1

u0(x)    = 0 for x > 1

the video clips will be representing the function u(*,t) :x to u(x,t)

for a sequence of choices of t such as t=0; t=0,5...t=3

 

i am using maple to solve a system of ordinary differential equations , 3 unknows (x,y, x ), and 3 equations (dx/dt,dy/dt,dz/dt)

there is one known variable denpendent on x and z

# code begins here

if x(t) <= z(t) then Q(t) := 8 end if;

if x(t) > z(t) then Q(t) := 10 end if;

 

eq1 := diff(x(t), t) = 3*x(t)-1;

eq2 := diff(y(t), t) = y(t)+Q(t);

eq3 := diff(z(t), t) = z(t);

eqs := {eq1, eq2, eq3};

 

# code ends here

 

above i put the system of ODEs, the code maybe illegal in maple, but i wrote in this way to make it clear.

Q is dependent on x and z.

 

in the past, when i was trying to solve ODEs, normally, eqs contains with only x,y,z as unknowns. but in this eqs, clearly, Q is included as an unknown. 

 

i've tried to use piecewise function to express Q(t), but failed.

 

how could i solve a system like this? thanks 

 

 

Here is the ODE:

 

dsolve((y(x)^2-x)*(D(y))(x)+x^2-y(x) = 0, {y(x)})

 

And the Maple 18 returns a very complex result.

But as we know,the more elegant result should be this:

 

How can I get this simple result with Maple?

Hello,
I'm working on coupled differential equation.
The first system is : 
y1''+y1'+y1=q1
q1''+e(q12-1)q1'+q1=y1"

And the second one : 
y2''+y2'+y2=q2
q2''(t)+e(q22-1)q2'(t)+q2(t) = y2"+f(P) q1(t-tau)

This is a parametric system, f(P) and tau(P) are given function of the parameters P.
e is a constant

I have solved the first system with dsolve (using numeric option).
But when I try to solve the second one (with dsolve, numeric, setting P as a parameter), maple returns an error : 

"Error, (in dsolve/numeric/process_input) input system must be an ODE system, got independent variables {t, t-1}"

I think Maple doesn't like " q1(t-tau)".
I have tried to create a new function q where :
q(t)=q1(t-tau)
But Maple returns the same error.

How can I fix it ?

Thanks for reading

EDIT : I have read there is no function in maple that solve delay differential equation.
But this is not a true DDE because q2 has no effect on q1
So I hope there is a way to "fool" maple and still use dsolve.

EDIT 2 :
I have found how to make it works.
I was using dsolve with the option compile (which increase (a lot) the efficiency of computation).
I delete this option and that's working.
Nevertheless, without the option compile, the computation is very very slow.
MapleHelp recommands to combine the 2 systems for more efficiency. But, when I combine, maple return the previous error.
How can I make it quicker ?

Here is the code : 

test_2_cylindre_sans_compile.mw 

ode := diff(sqrt(U(t)), t) = sqrt(U__0)-sqrt(U(t))

ics := U(0) = 0

dsolve({ics, ode})

 

And the result maple returns is U(t)=0 !

 

 

im solving 6 ODE which is the equations are unsteady with boundary conditions.. the program can be run when A=0 but when A=0.2 or others value .. its cannot be run... A means for unsteadiness... before this i solve for steady equations.. this is first time i solve for unsteady using maple.. anyone know where i am wrong??? thanks for helping :)

 

restart; with(plots); n := 2; Ec := 2.0; Pr := .72; N := .2; M := .1; l := 1; Nr := 1; y := 1; blt := 2.5; B := .1; a1 := 1; rho := .5

Eq1 := diff(f(eta), eta, eta, eta)+f(eta)*(diff(f(eta), eta, eta))-(diff(f(eta), eta))^2+l*B*H(eta)*(F(eta)-(diff(f(eta), eta)))-M*(diff(f(eta), eta))-A*(diff(f(eta), eta)+.5*eta*(diff(f(eta), eta, eta))) = 0;

diff(diff(diff(f(eta), eta), eta), eta)+f(eta)*(diff(diff(f(eta), eta), eta))-(diff(f(eta), eta))^2+.1*H(eta)*(F(eta)-(diff(f(eta), eta)))-.1*(diff(f(eta), eta))-A*(diff(f(eta), eta)+.5*eta*(diff(diff(f(eta), eta), eta))) = 0

(1)

Eq2 := A*(F(eta)+.5*eta*(diff(F(eta), eta)))+G(eta)*(diff(F(eta), eta))+F(eta)^2+B*(F(eta)-(diff(f(eta), eta))) = 0;

A*(F(eta)+.5*eta*(diff(F(eta), eta)))+G(eta)*(diff(F(eta), eta))+F(eta)^2+.1*F(eta)-.1*(diff(f(eta), eta)) = 0

(2)

Eq3 := .5*A*(G(eta)+.5*eta*(diff(G(eta), eta)))+G(eta)*(diff(G(eta), eta))+B*(f(eta)+G(eta)) = 0;

.5*A*(G(eta)+.5*eta*(diff(G(eta), eta)))+G(eta)*(diff(G(eta), eta))+.1*f(eta)+.1*G(eta) = 0

(3)

Eq4 := G(eta)*(diff(H(eta), eta))+H(eta)*(diff(G(eta), eta))+F(eta)*H(eta) = 0;

G(eta)*(diff(H(eta), eta))+H(eta)*(diff(G(eta), eta))+F(eta)*H(eta) = 0

(4)

Eq5 := (1+Nr)*(diff(theta(eta), eta, eta))+Pr*((diff(theta(eta), eta))*f(eta)-2*(diff(f(eta), eta))*theta(eta))+N*Pr*a1*(theta1(eta)-theta(eta))/rho+N*Pr*Ec*B*(F(eta)-(diff(f(eta), eta)))^2/rho+Pr*Ec*(diff(f(eta), eta))^2-.5*A*Pr*(4*theta(eta)+eta*(diff(theta(eta), eta))) = 0;

2*(diff(diff(theta(eta), eta), eta))+.72*(diff(theta(eta), eta))*f(eta)-1.44*(diff(f(eta), eta))*theta(eta)+.2880000000*theta1(eta)-.2880000000*theta(eta)+0.5760000000e-1*(F(eta)-(diff(f(eta), eta)))^2+1.440*(diff(f(eta), eta))^2-.360*A*(4*theta(eta)+eta*(diff(theta(eta), eta))) = 0

(5)

Eq6 := 2*F(eta)*theta1(eta)+G(eta)*(diff(theta1(eta), eta))+a1*y*(theta1(eta)-theta(eta))+.5*A*(4*theta1(eta)+eta*(diff(theta1(eta), eta))) = 0;

2*F(eta)*theta1(eta)+G(eta)*(diff(theta1(eta), eta))+theta1(eta)-theta(eta)+.5*A*(4*theta1(eta)+eta*(diff(theta1(eta), eta))) = 0

(6)

bcs1 := f(0) = 0, (D(f))(0) = 1, (D(f))(blt) = 0, F(blt) = 0, G(blt) = -f(blt), H(blt) = n, theta(0) = 1, theta(blt) = 0, theta1(blt) = 0;

f(0) = 0, (D(f))(0) = 1, (D(f))(2.5) = 0, F(2.5) = 0, G(2.5) = -f(2.5), H(2.5) = 2, theta(0) = 1, theta(2.5) = 0, theta1(2.5) = 0

(7)

L := [0., .2, .5];

[0., .2, .5]

(8)

for k to 3 do R := dsolve(eval({Eq1, Eq2, Eq3, Eq4, Eq5, Eq6, bcs1}, A = L[k]), [f(eta), F(eta), G(eta), H(eta), theta(eta), theta1(eta)], numeric, output = listprocedure); Y || k := rhs(R[3]); YP || k := rhs(R[5]); YR || k := rhs(R[6]); YQ || k := rhs(R[7]); YA || k := rhs(R[9]); YB || k := rhs(R[8]) end do

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

 

P1 := plot([Y || (1 .. 3)], 0 .. 10, labels = [eta, (D(f))(eta)])

P2 := plot([YP || (1 .. 3)], 0 .. 10, labels = [eta, F(eta)])

plots:-display([P1, P2])

Error, (in plots:-display) expecting plot structures but received: [P1, P2]

 

``

 

Download unsteadyManjunatha.mw

Hi:

i follow the code newton raphson for solve system nonlinear ODE in maple,every body have code for it?

Hi,

When I run two times my code, the results change.

Have you any idea, why???

 

 

Hi , everyone who love Maple and dsolve command, 

my ODE is :

sys_ode := diff(d11(m), m) = -(3*sin(m)^2-1)*d31(m)/a^(3/2)+(-3*cos(m)*sin(m)/a^(3/2))*d41(m), diff(d21(m), m) = (-3*cos(m)*sin(m)/a^(3/2))*d31(m)-(3*cos(m)^2-1)*d41(m)/a^(3/2), diff(d31(m), m) = -a^(3/2)*d11(m), diff(d41(m), m) = -a^(3/2)*d21(m)

using " dsolve([sys_ode]) " command could get the solution easily, and the solution contains "I" (imaginary domain).

However, when we substitute the solution into the ODE "sys_ode", find not correct !

we use the following command to check the solution :

 simplify(  -diff(d11(m), m) -(3*sin(m)^2-1)*d31(m)/a^(3/2)+(-3*cos(m)*sin(m)/a^(3/2))*d41(m)  )

the upper expression is supposed to be zero, but not ! Is it a bug in Maple dsolve ?

Hi, I have a homework to do that I am strugling with:

write a procedure which uses euler's method to solve a given initial value problem.
the imput should be the differential equation and the initial value.
using this programme find y(1) if dy/dx= x^2*y^3 and y(0)=1, and use maple dsolve command to check the solution.

That is what I have managed to do, but somehow it is not working correctelly, can somebody help please?

eul:=proc(f,h,x0,y0,xn)
  local no_points,x_old,x_new,y_old,y_new,i:
  no_points:=round(evalf((xn-x0)/h)):
  x_old:=x0:
  y_old:=y0:
 
  for i from 1 to no_points do
      x_new:=x_old+h:
      y_new:=y_old+evalf(h*f(x_old,y_old)):
      x_old:=x_new:
      y_old:=y_new:
  od:
  y_new:
end:


Thanks

 

I have numerically solved a system of ODEs and plotted the graphs of a[j](t) for each j=0..21.

It was clear from the picture that each a[j] has a unique zero. Is there a maple command to

locate these zeroes?

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