## What is wrong with my code...

Hello,

the attached code return error for  this values [0, 0.2, 0.4, 0.6] but work perfectly for this [0.2, 0.4, 0.6, 0.8]. I want it to start from 0 value. How do i correct the error? See the worksheet here com.mw

Thanks.

## Second derivative of an ODE solution...

Hi,
I'm new at maple and have a problem/question with the rkf45 numerical ODE Solver.

At first, my computer need a lot of time to calculate an analytic solution.
Therefor, I use the numerical way.

I have the following second order ODE:
ODE:=m*((D@@2)(x))(t)+d*(D(x))(t)+k*x(t) = d*(eval(diff(y(x), x), x = t))+k*y(t)
where y(t) is a realy big piecewise function, defined by me.

My initial conditions are:
x(0) = 0, (D(x))(0) = 0

With dsolve, I get the solution x(t) and the first derivative x'(t). I'm able to plot them with odeplot.

But...

Problem 1:
I need also the second derivative x''(t).
On this page: http://www.maplesoft.com/support/help/maple/view.aspx?path=dsolve%2Frkf45there is an example (eq 13 and 14) where the second derivative is useable, but this doesn't work with my differential equation.
(D(D(x)))(0) = 0
to my initial conditions but then, I got the error that only 2 initial conditions are required.
What could I do, so that rkf45 returns also the second derivative?

Problem 2:
And in addition to this, I want to calculate with x(t), x'(t), x''(t) but I found no way to use them.
Only plots are possible.
If I reduce y(t) to a minimum, I can do everything with the analytic solution: plot, d/dt, d2/dt2, +, -, ...
I tried also to convert the procedure to a function but in this case, there is no way to derivate it.

Many thanks...

## How can i visualize conmplex functions in Maple?...

Hello everybody,

my question concerns the visualizing possibilities of maple:

can maple visualize complex functions? (f(z): C->C)

If so, which possibilities do i have und what is the command for it? Maybe as a coulour diagram, as a vector field (f(x): R^2->R^2) , or as mapping of sets (e.g. curves, grids into new curves and curved lines)?

regards

Nikita

PS: I am using maple 18.

## 3rd ordre singular equation...

hi, I am tyying to solve this equation but there is arising an error, plz help me,
VIM.3rd_order.mw

## variational iteration method...

Hi, I'm tying to solve the ODE by variational iteration method, programme is running, but maple answer does'nt  match to origional answer, plz tell me the mistake?

ICs y(0)=y'(0)=y''(0)=1

VIM_2.mw

## ODE of Lane-Emden type...

=0

 >
 >
 >

plz help me, I m trying to solve homotopy analysis method for lane emden, what additional steps I have to taken in above programming?

## Function defined as integral in ODE...

I have a function defined as an integral that can be computed numerically at every point, and MAPLE does it. When I use this function inside an ODE for another function, maple complains that unknown parameters must be initialized. It sees the integration variable in my definition of the function defined as an integral as a parameter. Is there a work around?

Attached you will find an worksheet with my example. The function defined as an integral is called YFD(x) and the independent function I am trying to evaluate numerically using dsolve is Y(x).

 (1)

## The function  that is defined as an integral and will enter the ODE

 (2)

 (3)

 (4)

 (5)

Attempt to solve ODE:

 (6)

 (7)

## Analytic solution of coupled ODE?...

Hello everybody,

I'm trying to solve two ODEs analytically but it returns this 'Warning, it is required that the numerator of the given ODE depends on the highest derivative. Returning NULL'. See the worksheet Parallel_flow.mw

Thanks.

## IVP Dsolve Error...

Hello,

I am a student doing some self study over the summer trying to work through some of the John Taylor computer problems from his classcial mechanics book. Currently I hit a snag that most likely comes from the fact I am not well acquinted with Maple for solving IVP and DE's (we used Matlab in my DE class). I just need to know how I remove the following error:

Error, (in dsolve/numeric/SC/IVPsetup) initial conditions must be numeric

Here is a copy of my code:

R := 5;
5
g := 9.8;
9.8
deq1 := {diff(x(t), [`\$`(t, 2)]) = -g*sin(x(t))/R, x(0) = 20};
/ d / d \ \
{ --- |--- x(t)| = -1.960000000 sin(x(t)), x(0) = 20 }
\ dt \ dt / /
dsol1 := dsolve(deq1, numeric);
Error, (in dsolve/numeric/SC/IVPsetup) initial conditions must be numeric

My hunch is that I need to set x'(0)=0 or something like I do not have enough intial values to solve the problem, but I could be wrong. Anyway anyone who can point out my mistake feel free to do so! Thank you!

## conditional ODE. simplest Stick-slip problem...

Hi,

sorry for that question, i'm a beginner in maple but i think my question is not as simple.

So, i want to solve numerically this first equation :

but the second term is present only if k*(U*t-x)>μc*m*g  (stick-slip problem)

initial conditions : U=1m/s; x=0m; k=10 for example

My problem is simple, i don't know how to use conditional statement for such an ode in maple.

I've tried > Xr := U*t-x;
> k := 10; m := 1; g := 10; mu := .2;
> if k*Xr > mu*m*g then ode1 := m*(diff(x(t), t, t)) = k.Xr-mu*m*g else ode1 := m*(diff(x(t), t, t)) = k.Xr end if;

But, of course, too optimistic.

Thank to anyone who will solve that (isuppose) simple problem

Philippe

## ODE:NUMERICAL SOLUTION...

Please, i need help USING ODE1 and ODE2 with given BCS and Pr=0.714

it is needed to to generates

[-0.2], [0.51553], [0.4000]
[-0.1], [0.57000], [0.4371]
[0.], [0.62756], [0.4764]
[0.1], [0.68811], [0.5176]
[0.2], [0.75153], [0.5609]

but it is generarting

[-0.2], [0.51553], [0.42342]
[-0.1], [0.57000], [0.46114]
[0.], [0.62756], [0.50088]
[0.1], [0.68811], [0.54261]
[0.2], [0.75153], [0.58628]

the values of D(theata)(0) is wrong. Please i need HELP. this the code below that i use:
>restart;
>with (plots):ode1:=diff(f(eta),eta,eta,eta)+f(eta)*diff(f(eta),eta,eta)-M*diff(f(eta),eta)=0:

>ode2:=diff(theta(eta),eta,eta)+Pr*f(eta)*diff(theta(eta),eta)=0:

>bcs1:= f(0)=w,D(f)(0)=1,D(f)(10)=0:
>bcs2theta(10)=0,theta(0)=1:
>fixedparameter1:=[M=0.0]:
>ode3:=eval(ode1,fixedparameter1):
>fixedparameter2:=[Pr=0.714]:
>ode4:=eval(ode2,fixedparameter2):

>G:=[-0.2,-0.1,0.0,0.1,0.2]:
>for ode3 and ode4:
for k from 1 to 5 do
sol_All:=dsolve(eval({ode3,ode4,bcs1},w=G[k]),    [f(eta),theta(eta)],numeric,output=listprocedure);
Y_sol||k:= -rhs(sol_All[4]);
YP_sol||k:=-rhs(sol_All[6]);
end do:
>Digits:=5:

>for k from 1 to 5 do
evalf([G[k]]),evalf([(Y_sol||k(0))]),evalf([YP_sol||k(0)]);
od;
[-0.2], [0.51553], [0.42342]
[-0.1], [0.57000], [0.46114]
[0.], [0.62756], [0.50088]
[0.1], [0.68811], [0.54261]
[0.2], [0.75153], [0.58628]

## ODE- convergence problem...

Dear Colleges

I have a problem with the following code. As you can see, procedure Q1 converges but I couldn't get the resutls from Q2.

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

Sincerely yours

Amir

restart;

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));
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(theta(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));
EQT1a:=eval(EQT,EQ):
EQT2:=eval(EQT1a,{f(x)=G0(x),diff(f(x),x)=G1(x),diff(f(x),x,x)=G2(x)}):
bd:=c;
a:=0.13:
b:=0.41:
pr:=1;
prt:=0.86;
reynolds:=12734151.135786774055543653356602;     #10^6;   #1.125*10^8:

c:=88.419896050808975395120916434619:
;
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(bd)-1;
end proc;
fsolve(Q(pp2)=0,pp2=(0..1002));
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=1..1)],0..c);

Q2:=proc(rr2) local solT,T0,T1;
print(rr2);
if not type(rr2,numeric) then return 'procname(_passed)' end if:
solT:=dsolve({EQT2,theta(0)=1,D(theta)(0)=-rr2},numeric,known=[G0,G1,G2],output=listprocedure):
T0,T1:=op(subs(subs(res),[theta(x),diff(theta(x),x)])):
T0(bd);
end proc;
fsolve(Q2(rr2)=0,rr2=(0..100));

shib:=%;
sol:=dsolve({EQT2,theta(0)=1,D(theta)(0)=-shib},numeric,known=[G0,G1,G2],output=listprocedure):
plots:-odeplot(sol,[x,theta(x)],0..c);
#fsolve(Q2(pp3)=0,pp3=-2..2):

Amir

## What is wrong with this code?...

Hello,

please help check what's wrong with this code. I need the analytic solution and convert to Bessel but return error. Here is the worksheet ID_1.mw

Best regards.

## how to extract specific values from dsolve...

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

## Error, (in dsolve/numeric/bvp) unevaluated names i...

Dear Friends,

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

 >
 > 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;
 (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;
 (2)
 > Eq3:=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;
 (4)
 > Eq5:=G(eta)*diff(G(eta),eta)+B*(f(eta)+G(eta))=0;
 (5)
 > Eq6:=G(eta)*diff(theta1(eta),eta)+l*B*(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;
 (7)
 > L:=[0.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:
 >
 >