Items tagged with ode ode Tagged Items Feed

Hello,

After solving ode I am looking only for the values >=1.5. For example at t=1, y(t)=3.8940.

How can I extract the values >= 1.5 from the solution to use it as data (t,y(t)) and save it ?

restart;
with(DEtools); with(plots);
eqn := diff(y(t), t) = -.25*y(t);

 init := y(0) = 5;

sol := dsolve({eqn, init}, {y(t)}, numeric, output = array([seq(i, i = 0 .. 50)]));
p[1] := plot(1.5, t = 0 .. 50, colour = black);

p[2] := odeplot(sol, [t, y(t)], t = 0 .. .50, colour = red);

display(p[1], p[2]);

 

Thanks

Dear Friends,

I am solving 6 ODEs using maple15. then i got this error. anyone know abou this? thank you.

problem2.mw

 

 

restart:with (plots): B:=1:M:=1:Gr:=0.5:Pr:=3:w:=0.02:blt:=5:Bi:=10:

Eq1:=diff(f(eta),eta,eta,eta)-(diff(f(eta),eta))^(2)+f(eta)*diff(f(eta),eta,eta)+B*H(eta)*(F(eta)-diff(f(eta),eta))-M*diff(f(eta),eta)+Gr*theta(eta)=0;

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

(1)

Eq2:=(1+Nr)*diff(theta(eta),eta,eta)+Pr*f(eta)*diff(theta(eta),eta)+(2/3)*H(eta)*B*(theta1(eta)-theta(eta))=0;

(1+Nr)*(diff(diff(theta(eta), eta), eta))+3*f(eta)*(diff(theta(eta), eta))+(2/3)*H(eta)*(theta1(eta)-theta(eta)) = 0

(2)

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

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

(3)

Eq4:=F(eta)^2+G(eta)*diff(F(eta),eta)+B*(F(eta)-diff(f(eta),eta))=0;

F(eta)^2+G(eta)*(diff(F(eta), eta))+F(eta)-(diff(f(eta), eta)) = 0

(4)

Eq5:=G(eta)*diff(G(eta),eta)+B*(f(eta)+G(eta))=0;

G(eta)*(diff(G(eta), eta))+f(eta)+G(eta) = 0

(5)

Eq6:=G(eta)*diff(theta1(eta),eta)+l*B*(theta1(eta)-theta(eta))=0;

G(eta)*(diff(theta1(eta), eta))+l*(theta1(eta)-theta(eta)) = 0

(6)

bcs:=f(0)=0,(D(f))(0)=1,(D(theta))(0)=-Bi*(1-theta(0)),(D(f))(blt)=0,F(blt)=0,G(blt)=-f(blt),H(eta)=w,theta(blt)=0,theta1(blt)=0;

f(0) = 0, (D(f))(0) = 1, (D(theta))(0) = -10+10*theta(0), (D(f))(5) = 0, F(5) = 0, G(5) = -f(5), H(eta) = 0.2e-1, theta(5) = 0, theta1(5) = 0

(7)

L:=[0.5,1,1.5,2];

[.5, 1, 1.5, 2]

(8)

for k from 1 to 4 do p:=dsolve(eval({Eq1,Eq2,Eq3,Eq4,Eq5,Eq6,bcs},Nr=L[k]),[f(eta),F(eta),G(eta),H(eta),theta(eta),theta1(eta)],numeric,output=listprocedure);end do:

Error, (in dsolve/numeric/bvp) unevaluated names in system not allowed: {Y[9], Y[10]}

 

``

``

``

 

Download problem2.mw

Hello,

I am solving a large system of ODEs, using the following command,


> Sol := dsolve({seq(ode[j], j = 0 .. 21), seq(v[j](0) = 0, j = 1 .. 21), v[0](0) = 1}, [seq(v[j](t), j = 0 .. 21)]);

>

 

and then plot the quantities I want by something like

> plots:-odeplot(Sol, [t, v[3](t)+v[5](t)], t = 0 .. 1.5);

My problem is that, I do not know a priori which quantity I want to plot, and plotting using above method requires solving the ODEs each time separately, which takes a long time.

 

So I was curious if there is a scheme that I can solve my system for once and for all, and then plot any quantities that I would like to see.

Hello,

The idea: parameter "a" will have a new random value each 10 days.

The way I did it is working but it can get very long especially if I do it for a system of equations and for long time more than a year (365 days).

The code:

with(DEtools); with(plots);
n := 5;

for i to n do Ra[i] := RandomTools:-Generate(distribution(Uniform(0.1e-1, .5))); a[[i]] := Ra[i] end do;

b := 0.1e-2;

T := 10;

 eq := diff(L(t), t) = a*L(t)-b;

init[1] := L(0) = 100;
 sol[1] := dsolve({init[1], subs(a = a[[1]], eq)}, L(t), range = 0 .. T, numeric);


init[2] := L(T) = rhs(sol[1](T)[2]);

sol[2] := dsolve({init[2], subs(a = a[[2]], eq)}, L(t), range = T .. 2*T, numeric);

 

init[3] := L(2*T) = rhs(sol[2](2*T)[2]);
sol[3] := dsolve({init[3], subs(a = a[[3]], eq)}, L(t), range = 2*T .. 3*T, numeric);

p[1] := odeplot(sol[1], [t, L(t)], t = 0 .. T);

p[2] := odeplot(sol[2], [t, L(t)], t = T .. 2*T);

p[3] := odeplot(sol[3], [t, L(t)], t = 2*T .. 3*T);

p := display([p[1], p[2], p[3]]);
display(p);

 

Thank you

Hi Guys,

I am trying to solve the folling ODE in maple but am struggling to get to the correct solution. I first of all have the following equations;

Diff(V(x), [x]) = q(x)

Diff(M(x), [x]) = V(x)

theta(x) = Diff(v(x),[x])

M(x)=EI*theta(x)

Which give me the following;

q(x) = Diff(EI*(Diff(v(x), [`$`(x, 2)])), [`$`(x, 2)])

With thw boundary conditions;

M(l) = 0, M(0) = 0, v(0) = 0, v(l) = 0

The given solution is;

v(x)=(qx/24EI)*(x^3-2lx^2+l^3)

Anything that might point me in the right direction would be great!

Cheers

Steve

 

 

Attached is a photo with the code I am working for.  

On the top is practice code with a simpler ODE to help with trouble shooting, on the bottom is the ODE I am working with.

I was hoping to gain insight about the _z1 symbol in the solution, I haven't been able to find much help on other threads.  I would like to know how I can go about working with it - if it is something on my end or if it is the nature of the equation I am working with.

 

Thank you for any help,

Josh

This is the simplest method to explain numerically solving an ODE, more precisely, an IVP.

Using the method, to get a fell for numerics as well as for the nature of IVPs, solve the IVP numerically with a PC, 10steps.

Graph the computed values and the solution curve on the same coordinate axes.

 

y'=(y-x)^2, y(0)=0 , h=0.1

Sol. y=x-tanh(x)

 

I don't know well maple. 

I study Advanced Engineering Math and using maple, but i am stopped in this test.

I want to know how solve this problem.

please teach me~ 

IT IS EULER's method

Hi there. I'm Student

i want to know how solve this problem.

please teach me! 

y'=(y-x)^2, y(0)=0, h=0.1

sol.y=x-tanh(x)

how solve this problem for maple? 

please teach me~

Hi, I am an student and I am currently working on a system that sketches the relation of predator and prey of yellowstone's gray wolf and elk. I tried using the Lotka-Volterra model, but I wanted to add more parameters and add a carrying capacity for the system. Unfortunatley I cannot find a way to edit the Lotka model to my needs, and because I am new i do not know how to create my own model. This is the two equations I want to use: (D(x))(t) = alpha*x(t)-ax^2/k-b*x(t)*y(t)-gx(t), (D(y))(t) = -beta*y(t)+c*x(t)*y(t)-gy(t)

were k is carrying capacity.

Basically what I am asking is that if someone can help make the system workable on Maple and some steps of how to do it. 

Hello guys,

I am stuck with the following code. I cannot get a solution. Mapple doesn't even run. Please help, I am in urgent need on help!!!

 

 

I've got the following four differential equations :

v_x:=diff(x(t),t);
v_y:=diff(y(t),t);
d2v_x:=-((C_d)*rho*Pi*(r^2)*(v_x)*sqrt((v_x)^2 +(v_y)^2))/(2*m);
d2v_y:=-((C_d)*rho*Pi*(r^2)*(v_y)*sqrt((v_x)^2 +(v_y)^2))/(2*m)-g;


and the following initial value conditions:

x(0)=0,y(0)=0,v_x(0)=v0/sqrt(2),v_y(0)=v0/sqrt(2) given v0=65 

I need to solve these using the numeric type and then draw overlaid plots

(i) setting C_d=0

(ii) leaving C_d as a variable

before plotting y(t) vs x(t). The hint for this last part is that the path can be seeing using [x(t),y(t)] instead of [t,y(t)]

I've tried to do it but seemed to have several syntax errors.

 

 

I've got the following diff.eq

y'(x)=sin(x*y(x)) given y(0)=1 

and need to solve it numerically which is why I've used:

dy4:=diff(y(x),x);
eqn4:=dy4=sin(x*y(x));
ic1:=y(0)=1;
ans3:=dsolve({eqn4,ic1},y(x),type=numeric);

This code doesn't return a value though and in fact, ans3 is being displayed as a procedure

"ans3:=proc(x_rkf45) ... end proc"

I don't quite understand why and what I need to do to get the required numerical solution

 

In the attached Maple worksheet I attempt to plot the solution of an initial value problem for a first order ODE.  DEplot fails with a cryptic message.  Strangely enough, if I give the "arrows=none" option to DEplot, it produces the correct plot!

I see this behavior in Maple 17 and 18.

Maple 11, however, works fine with or without the "arrows=none" option.

Is there an explanation for this or is it a bug?

DEplot-bug.mw

hai everyone. i am currently trying to solve an integration of the following ∫g(η)dη . integrate from 0 to 10.

from the following odes.

f ''' +1-(f ')2 +ff ''=0,

g''-gf'+fg'=0,

with boundary conditions f(0)=0, f'(0)=λ, f'(∞)=1, g(0)=1,g(∞)=0

First, i solve the odes using the shooting method. then i used the trapezoidal rule to solve for the integration of g(eta) using the following codes

> with(student);
> trapezoid(g(eta), eta = 0 .. 10, 10);
> evalf(%);

it seems that it can not read the data from the shooting method. can anyone suggest why it is happening?

thank you verymuch for your concern :)

So I am trying to solve a given ODE using calculated christoffel symbols found by maple, and in order to get the correct christoffel symbols, I need my function to be r=x-x_s, where x is not a function of t. However, I then have to solve the ODE where x is a function of t. Maple used the r value to find the christoffel symbols which has x in it, and now I want to find the origonal function of x(t), but I can't have x and x(t) in the same ODE. If I change r=x-x_s to r=x(t)-x_s, I get the wrong christoffel symbols. How can I solve my ODE?

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