## Bounded solution of ODE...

Dear all

I have the following equaion

Eq := diff(phi(x, k), x, x)+(k^2+2*sech(x))*phi(x, k) = 0;

The solution is given by

phi := (I*k-tanh(x))*exp(I*k*x)/(I*k-1);

My question : At what value of k is there a bound state and in this case can we give a simple form of the solution phi(x,k)

With best regards

## Problem in dsolve ...

Dear Maple researchers

I have a problem in solving a system of odes that resulted from discretizing, in space variable, method of lines (MOL).

The basic idea of this code is constructed from the following paper:

http://www.sciencedirect.com/science/article/pii/S0096300313008060

If kindly is possible, please tell me whas the solution of this problem.

With kin dregards,

Emran Tohidi.

My codes is here:

> restart;
> with(orthopoly);
print(`output redirected...`); # input placeholder
> N := 4; Digits := 20;
print(`output redirected...`); # input placeholder

> A := -1; B := 1; rho := 3/4;
> g1 := proc (t) options operator, arrow; 1/2+(1/2)*tanh((1/2)*(A-(2*rho-1)*t/sqrt(2))/sqrt(2)) end proc; g2 := proc (t) options operator, arrow; 1/2+(1/2)*tanh((1/2)*(B-(2*rho-1)*t/sqrt(2))/sqrt(2)) end proc;
print(`output redirected...`); # input placeholder
> f := proc (x) options operator, arrow; 1/2+(1/2)*tanh((1/2)*x/sqrt(2)) end proc;
print(`output redirected...`); # input placeholder
> uexact := proc (x, t) options operator, arrow; 1/2+(1/2)*tanh((1/2)*(x-(2*rho-1)*t/sqrt(2))/sqrt(2)) end proc;
print(`output redirected...`); # input placeholder
> basiceq := simplify(diff(uexact(x, t), `\$`(t, 1))-(diff(uexact(x, t), `\$`(x, 2)))+uexact(x, t)*(1-uexact(x, t))*(rho-uexact(x, t)));
print(`output redirected...`); # input placeholder
0
> alpha := 0; beta := 0; pol := P(N-1, alpha+1, beta+1, x); pol := unapply(pol, x); dpol := simplify(diff(pol(x), x)); dpol := unapply(dpol, x);
print(`output redirected...`); # input placeholder
> nodes := fsolve(P(N-1, alpha+1, beta+1, x));
%;
> xx[0] := -1;
> for i to N-1 do xx[i] := nodes[i] end do;
print(`output redirected...`); # input placeholder
> xx[N] := 1;
> for k from 0 to N do h[k] := 2^(alpha+beta+1)*GAMMA(k+alpha+1)*GAMMA(k+beta+1)/((2*k+alpha+beta+1)*GAMMA(k+1)*GAMMA(k+alpha+beta+1)) end do;
print(`output redirected...`); # input placeholder
> w[0] := 2^(alpha+beta+1)*(beta+1)*GAMMA(beta+1)^2*GAMMA(N)*GAMMA(N+alpha+1)/(GAMMA(N+beta+1)*GAMMA(N+alpha+beta+2));
print(`output redirected...`); # input placeholder
> for jj to N-1 do w[jj] := 2^(alpha+beta+3)*GAMMA(N+alpha+1)*GAMMA(N+beta+1)/((1-xx[jj]^2)^2*dpol(xx[jj])^2*factorial(N-1)*GAMMA(N+alpha+beta+2)) end do;
print(`output redirected...`); # input placeholder
> w[N] := 2^(alpha+beta+1)*(alpha+1)*GAMMA(alpha+1)^2*GAMMA(N)*GAMMA(N+beta+1)/(GAMMA(N+alpha+1)*GAMMA(N+alpha+beta+2));
print(`output redirected...`); # input placeholder
> for j from 0 to N do dpoly1[j] := simplify(diff(P(j, alpha, beta, x), `\$`(x, 1))); dpoly1[j] := unapply(dpoly1[j], x); dpoly2[j] := simplify(diff(P(j, alpha, beta, x), `\$`(x, 2))); dpoly2[j] := unapply(dpoly2[j], x) end do;
print(`output redirected...`); # input placeholder
print(??); # input placeholder
> for n to N-1 do for i from 0 to N do BB[n, i] := sum(P(jjj, alpha, beta, xx[jjj])*dpoly2[jjj](xx[n])*w[i]/h[jjj], jjj = 0 .. N) end do end do;
> for n to N-1 do d[n] := BB[n, 0]*g1(t)+BB[n, N]*g2(t); d[n] := unapply(d[n], t) end do;
print(`output redirected...`); # input placeholder
> for nn to N-1 do F[nn] := simplify(sum(BB[nn, ii]*u[ii](t), ii = 1 .. N-1)+u[nn](t)*(1-u[nn](t))*(rho-u[nn](t))+d[nn](t)); F[nn] := unapply(F[nn], t) end do;
print(`output redirected...`); # input placeholder
> sys1 := [seq(d*u[q](t)/dt = F[q](t), q = 1 .. N-1)];
print(`output redirected...`); # input placeholder
[d u[1](t)
[--------- = 40.708333333333333334 u[1](t) + 52.190476190476190476 u[2](t)
[   dt

2          3
+ 39.958333333333333334 u[3](t) - 1.7500000000000000000 u[1](t)  + u[1](t)

+ 7.3392857142857142858

- 3.6696428571428571429 tanh(0.35355339059327376220

+ 0.12500000000000000000 t) - 3.6696428571428571429 tanh(
d u[2](t)
-0.35355339059327376220 + 0.12500000000000000000 t), --------- =
dt
-20.416666666666666667 u[1](t) - 25.916666666666666667 u[2](t)

2          3
- 20.416666666666666667 u[3](t) - 1.7500000000000000000 u[2](t)  + u[2](t)

- 3.7500000000000000000

+ 1.8750000000000000000 tanh(0.35355339059327376220

+ 0.12500000000000000000 t) + 1.8750000000000000000 tanh(
d u[3](t)
-0.35355339059327376220 + 0.12500000000000000000 t), --------- = 29.458333333\
dt

333333333 u[1](t) + 38.476190476190476190 u[2](t)

2          3
+ 30.208333333333333333 u[3](t) - 1.7500000000000000000 u[3](t)  + u[3](t)

+ 5.4107142857142857144

- 2.7053571428571428572 tanh(0.35355339059327376220

+ 0.12500000000000000000 t) - 2.7053571428571428572 tanh(
]
-0.35355339059327376220 + 0.12500000000000000000 t)]
]
> ics := seq(u[qq](0) = evalf(f(xx[qq])), qq = 1 .. N-1);
print(`output redirected...`); # input placeholder
u[1](0) = 0.38629570659055483825, u[2](0) = 0.50000000000000000000,

u[3](0) = 0.61370429340944516175
> dsolve([sys1, ics], numeic);
%;
Error, (in dsolve) invalid input: `PDEtools/sdsolve` expects its 1st argument, SYS, to be of type {set({`<>`, `=`, algebraic}), list({`<>`, `=`, algebraic})}, but received [[d*u[1](t)/dt = (20354166666666666667/500000000000000000)*u[1](t)+(13047619047619047619/250000000000000000)*u[2](t)+(19979166666666666667/500000000000000000)*u[3](t)-(7/4)*u[1](t)^2+u[1](t)^3+36696428571428571429/5000000000000000000-(36696428571428571429/10000000000000000000)*tanh(1767766952966368811/5000000000000000000+(1/8)*t)-(36696428571428571429/10000000000000000000)*tanh(-1767766952966368811/5000000000000000000+(1/8)*t), d*u[2](t)/dt = -(20416666666666666667/1000000...

## How to fix this error? ...

I want to solve system of non linear odes numerically.

I encounter following error

Error, (in dsolve/numeric/bvp) cannot determine a suitable initial profile, please specify an approximate initial solution

how to correct it

regards

## Problem with complicated ODE...

Hi All,

I'm trying to numerically solve a differential equation which has a numeric function in it.

For example, consider the function f.

f:=(r)-> evalf(Int( <some messy function>, <some range>)) ;  <- This can be solved numerically and returns an answer quickly. i.e

f(23) gives 102;

Now, I want to numericaly solve something like.

Eq:= diff(p(r),r,r) + diff(p(r),r) - f(p(r));

ICS:=D(p)(0.001)=0, p(0.001) = 3

dsolve({Eq,ICS},numeric).

dsolve will not attempt to solve it due to the numeric integration in f. Is there a way I can just use numeric techniques to solve this kind of problem?

## Plotting Solution Curves...

I'm having trouble plotting a couple things. I have

eq := diff(y(x), x\$3)+3*diff(y(x),x\$2)+12*y(x);
soln := dsolve(eq, y(x));
soln := evalf(soln);
PartSoln1 := dsolve({eq, y(0) = a,y'(0) = 0,y''(0) = 0}, y(x));
curves := {seq(PartSoln1, a = -3 .. 3)};
Then when I try plot(curves, x = -1..5, y = -5..5); I get Warning, expecting only range variable x in expression PartSoln1 to be plotted but found name PartSoln1.

Also,
charEq := r^3+r+1 = 0;
soln := solve(charEq, r);
soln := [evalf(soln, 5)];
soln := map(Re, soln);

I tried a few things, but can't figure out how to plot charEq, including the real roots.

Thanks for any help,

Heather

## How do I solve this system of ODEs in Maple?...

I'm trying to solve a system of 4 ODE's.

however I have 4 equations and six unknowns. I dont know how else to describe the functions a,b,c,d

cause these just represent vector valued functions at points (x1,y1) and (x2,y2) where i have chosing (x1,y1)=(-1,0) and (x2,y2) = (1,0)

I have that

dx1/dt = (u,v)

dx2/dt=(f,g)

I know that if i graph these functions I should get vertical lines, but I keep getting circles if I instead consider a(t) to be x(t) and b(t) to be y(t)...

I need to solve this system and plot it but i am misinterpreting something somewhere..

## Problem with Runge - Kutta method...

I am trying to solve the folowing ODE with initial conditions t0=0,v0=0 and tf =80 with step 0.01 but the matrix that appears is not having the values!please help

 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >

## Convert ODE system to matrix form...

Sorry for disturbing you. I am wondering if there is an easier approach in Maple that could convert a system of second order differential equations into matrix form. Of course, we could do it by hand easily if the degrees of freedom is small. I would like to know if we could use Maple to do so.

Here is an example with 6 degrees of freedom: the variables are u, v, w, alpha, beta and gamma. And, this is a uncoupled system.

Vector(6, {(1) = 2*R^2*(diff(w(t), t))*Pi*Omega*h*rho+R^2*(diff(u(t), t, t))*Pi*h*rho-R^2*u(t)*Pi*Omega^2*h*rho = 0, (2) = R^2*(diff(v(t), t, t))*Pi*h*rho = 0, (3) = -2*R^2*(diff(u(t), t))*Pi*Omega*h*rho+R^2*(diff(w(t), t, t))*Pi*h*rho-R^2*w(t)*Pi*Omega^2*h*rho = 0, (4) = (1/4)*R^4*Pi*(diff(alpha(t), t, t))*h*rho+(1/12)*R^2*Pi*(diff(alpha(t), t, t))*h^3*rho+(1/6)*R^2*Pi*(diff(gamma(t), t))*Omega*h^3*rho-(1/12)*R^2*Pi*alpha(t)*Omega^2*h^3*rho = 0, (5) = (1/2)*R^4*Pi*(diff(beta(t), t, t))*h*rho-(1/2)*R^4*Pi*beta(t)*Omega^2*h*rho = 0, (6) = (1/4)*R^4*Pi*(diff(gamma(t), t, t))*h*rho+(1/12)*R^2*Pi*(diff(gamma(t), t, t))*h^3*rho-(1/6)*R^2*Pi*(diff(alpha(t), t))*Omega*h^3*rho-(1/12)*R^2*Pi*gamma(t)*Omega^2*h^3*rho = 0});

The objective is to reform it into matrix form : M*diff(X(t), t, t)+C*diff(X(t), t)+K*X(t)=F.

Thank you in advance for taking a look.

## Seasonal fluctuation of model...

Howdy,

I am trying to create a mathmatical model that shows a predator-prey relationship along with seasonal variations (hibernation). I made two piecewise functions where one is "on" during the winter and the other is "off" during the winter and the model worked well for one unit of time.

My problem is that I would like the piecewise functions to apply over an arbitrary amount of time units periods without having to set the range within the function itself for 100 units of time. I was thinking that a for loop would work but i'm not sure how I would impliment that.

Edit:

I have three O.D.E's in an array..

ode := {r'(t),h'(t),c'(t)}

which are dependent on a list of parameters..

constants := {a,b,...,s,w,c0,h0,r0};

where s and w are my piecewise functions.

I am able to solve the three odes using dsolve for one period of s and w.

Again, I'm really not sure where to start to make my model periodic.

## Falkner-Skan equation...

Hi,

I want to solve the Falkner-Skan equation numbercally using maple. The Falkner-Skan equation is

f′′′ + ff′′ + (1 − (f′)^2)=0 ,

with subject to the boundary conditions,

f(0) =0 ; f′(0) = 0,

f′(∞) = 1.

And then save the data in DATfile in order to plot using Gnuplot?

Regards

## How to show odeplot better?...

I have a set of differential equations on 3 variables, B[1],B[2] and C. Its not physically meaningful for B[1]+B[2]>0.5 so i would ideally like to replace the cube that the solutions are displayed on (the axis take the limits B[1]=0...0.5,B[2]=0...0.5,C=0...100 ) with a triangular prism (the axis take the limits B[1]=0...0.5,B[2]=0...0.5,B[1]+B[2]<0.5,C=0...100 ).

Failing that i'd like the plot to display a plane showing where the meaningful values for the variables end.

here is the code I use to put the ODEplot together

Model := [diff(B[1](t), t) = k[a1]*C(t)*(R-B[1](t)-B[2](t))-k[d1]*B[1](t), diff(B[2](t), t) = k[a2]*C(t)*(R-B[1](t)-B[2](t))-k[d2]*B[2](t), diff(C(t), t) = (-(k[a1]+k[a2])*C(t)*(R-B[1](t)-B[2](t))+k[d1]*B[1](t)+k[d2]*B[2](t)+k[m]*((I)(t)-C(t)))/h];
DissMod := subs((I)(t) = 0, Model);
AssMod := subs((I)(t) = C[T], Model);

Pars1a := [k[a1] = 6*10^(-4), k[d1] = 7*10^(-3), k[a2] = 6*10^(-4), k[d2] = (7/5)*10^(-3), R = .5, k[m] = 10^(-4), C[T] = 100, h = 10^(-6)];

Pars := Pars1a; thing11 := subs(Pars, AssMod[1]), subs(Pars, AssMod[2]); thing12 := diff(C(t), t) = piecewise(t <= 100, subs(Pars, rhs(AssMod[3])), subs(Pars, rhs(DissMod[3]))); sol := dsolve({thing11, thing12, C(0) = 0, B[1](0) = 0, B[2](0) = 0}, {C(t), B[1](t), B[2](t)}, numeric, output = listprocedure, maxstep = 2, maxfun = 1000000); ParsPlot1a := odeplot(sol, [B[1](t), B[2](t), C(t)], t = 0 .. 700, color = blue, view = [0 .. .5, 0 .. .5, 0 .. 100], tickmarks = [[0 = 0, .5 = R], [0 = 0, .5 = R], [0 = 0, 25 = (1/4)*C[T], 50 = (1/2)*C[T], 100 = C[T]]]);

But I can't see a way of either making the plane or making the ODEplot axis into something other than a cube.

## Solving ODE with Maple and by hand...

Hello,

I have just noticed that solving a nonhomogeneous linear ode using maple dsolve gives a different solution when compared to hand calculation by method of undetermined coefficient. For instance, this equation equation is

has the solution

Using dsolve for the same function give something completely different. Any assistance on how I can resolve this will be highly appreciated

## How to handle solution of ODE?...

in this code count.mw  i can get the value of solution only by typing sol(t), how to get the value of q(t) directly?

 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 (7)
 >

## Equation concerning solutions of ODE system...

Hello all,

I have an ODE system (please see bellow) where my unknowns are S(t) and K(t), all the the other symbols are known parameters. This system, by given the initial values for S and K, that is, S(0)=100 and K(0)=20, I can solve numerically.

sys:= diff(S(t), t) = -eta*K(t)*S(t)/(w*N*(S(t)+K(t))), diff(K(t), t) = eta*K(t)*S(t)/(w*N*(S(t)+K(t)))+S(t)*(-z*eta*alpha*K(t)^2+(-z*eta*alpha*S(t)-(eta*alpha^2*S(t)^2-2*N*C[max]*w*eta*alpha*K(t)+((-N*w+z)*alpha+N*C[max]^2*w*eta)*w*N)*upsilon)*K(t)+N*S(t)*w*alpha*upsilon*(N*w-z))/((K(t)^2*alpha*z+3*K(t)*S(t)*alpha*z+(2*S(t)*z*alpha+upsilon)*S(t))*w*N)

In addition, I have an algebraic equation:

eq1:= -c2 + (K(t2)*S(t2)+w*N*S(t2))*z=0,

where S(t2) and K(t2) are the solutions of my ODE sys in S and K at t=t2. The t2 is unknown time variable.

My question is: how can I find t2 such that my algebraic equation (eq1) is satisfied.

Dmitry

## How to plot this graph?...

g[1] := (diff(a(t), t))/(t^2-1) = 1;
g[2] := (diff(a(t), t))*(diff(b(t), t)) = 1;
dsolve({eq2, eq3});
with(DynamicSystems):
sys := DiffEquation([g[1]=1, g[2]=1], inputvariable = [b(t)], outputvariable = [a(t), b(t)]):
ts := 0.1:
t_sim := 10.0:
#in_t := Sine(1, 1, 0, 0):
#in_z := Sine(1, 1, 0, 0, samplecount = round(t_sim/ts), sampletime = ts, discrete):
in_t := t:
sol := Simulate(sys, [in_t]):
p1 := plots[odeplot](sol, [[t, a(t)]], t = 0 .. t_sim, numpoints = 200, color = red):
Error, (in DEtools/convertsys) unable to convert to an explicit first-order system
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution

 5 6 7 8 9 10 11 Last Page 7 of 29
﻿