Mariusz Iwaniuk

1476 Reputation

14 Badges

9 years, 311 days

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by Mariusz Iwaniuk

@Math Pi Euler 


 

We obtain a series expansion in terms of a small parameter, of the solution of a second

order nonlinear differential equation.

restart;

de := diff(z(x),x,x) + z(x) - cos(2*x)/(1+delta*z(x)) = 0;

diff(diff(z(x), x), x)+z(x)-cos(2*x)/(1+delta*z(x)) = 0

(1)

 bc := z(-Pi/4)=0, z(Pi/4)=0

z(-(1/4)*Pi) = 0, z((1/4)*Pi) = 0

(2)

We are going to expand the solution of this boundary value problem in powers of delta,

and pick the leading N terms like this:

N := 3;  # change as needed
S := z(x) = add(u[n](x)*delta^n, n=0..N-1);

3

 

z(x) = u[0](x)+u[1](x)*delta+u[2](x)*delta^2

(3)

Substitute the series expression S in the differential equation and simplify:

eval(de, S):
series(lhs(%), delta, N):
collect(%, delata, simplify):
tmp := convert(%, polynom);

diff(diff(u[0](x), x), x)+u[0](x)-cos(2*x)+(diff(diff(u[1](x), x), x)+u[1](x)+cos(2*x)*u[0](x))*delta+(diff(diff(u[2](x), x), x)+(-u[0](x)^2+u[1](x))*cos(2*x)+u[2](x))*delta^2

(4)

This is supposed to hold for all delta, therefore the coefficient of each power of delta is zero.
This gives us a system of N coupled differential equations in N unknowns:

DEs := coeffs(tmp, delta);

diff(diff(u[0](x), x), x)+u[0](x)-cos(2*x), diff(diff(u[2](x), x), x)+(-u[0](x)^2+u[1](x))*cos(2*x)+u[2](x), diff(diff(u[1](x), x), x)+u[1](x)+cos(2*x)*u[0](x)

(5)

Apply the given boundary conditions to generate boundary conditions for the new unknowns:

BCs := seq(subs(z=u[n], [bc])[], n=0..N-1);

u[0](-(1/4)*Pi) = 0, u[0]((1/4)*Pi) = 0, u[1](-(1/4)*Pi) = 0, u[1]((1/4)*Pi) = 0, u[2](-(1/4)*Pi) = 0, u[2]((1/4)*Pi) = 0

(6)

sol := simplify(value(dsolve({DEs},`build`)));

{u[0](x) = sin(x)*_C6+cos(x)*_C5-(2/3)*cos(x)^2+1/3, u[1](x) = -(4/45)*cos(x)^4+(1/4)*_C5*cos(x)^3+(1/720)*(180*sin(x)*_C6+64)*cos(x)^2+(1/720)*(-180*_C6*x+720*_C3-225*_C5)*cos(x)+7/45+(1/720)*(-180*_C5*x+720*_C4+45*_C6)*sin(x), u[2](x) = -(16/525)*cos(x)^6+(19/144)*_C5*cos(x)^5+(1/302400)*(-40320*_C5^2+40320*_C6^2+39900*sin(x)*_C6+13824)*cos(x)^4+(1/302400)*(-80640*_C5*_C6*sin(x)-18900*_C6*x+75600*_C3-48300*_C5)*cos(x)^3+(1/302400)*((-18900*_C5*x+75600*_C4-31500*_C6)*sin(x)-60480*_C5^2-141120*_C6^2+10496)*cos(x)^2+(1/302400)*(40320*_C5*_C6*sin(x)+(9450*x^2-16275)*_C5-75600*_C4*x+69300*_C6*x+302400*_C1-94500*_C3)*cos(x)+(1/302400)*(-50400*_C5*x+(9450*x^2-24675)*_C6-75600*_C3*x+302400*_C2+18900*_C4)*sin(x)+(2/5)*_C5^2-(1/15)*_C6^2-118/4725}

(7)

Apply the given boundary conditions.Now build the final solution:

sol2 := solve([eval(rhs(sol[1]), x = -(1/4)*Pi) = 0, eval(rhs(sol[1]), x = (1/4)*Pi) = 0, eval(rhs(sol[2]), x = -(1/4)*Pi) = 0, eval(rhs(sol[2]), x = (1/4)*Pi) = 0, eval(rhs(sol[3]), x = -(1/4)*Pi) = 0, eval(rhs(sol[3]), x = (1/4)*Pi) = 0], {_C1, _C2, _C3, _C4, _C5, _C6})

{_C1 = -(1/90)*2^(1/2)*Pi-(1/30)*2^(1/2), _C2 = 0, _C3 = -(8/45)*2^(1/2), _C4 = 0, _C5 = 0, _C6 = 0}

(8)

sol3:=eval(S, eval(sol, sol2)):
sol4:=sort(sol3, delta, ascending);

z(x) = 1/3-(2/3)*cos(x)^2+(-(4/45)*cos(x)^4+7/45+(4/45)*cos(x)^2-(8/45)*2^(1/2)*cos(x))*delta+(-(16/525)*cos(x)^6-118/4725+(8/175)*cos(x)^4-(2/45)*2^(1/2)*cos(x)^3+(164/4725)*cos(x)^2+(1/302400)*(-3360*2^(1/2)*Pi+6720*2^(1/2))*cos(x)+(2/45)*2^(1/2)*x*sin(x))*delta^2

(9)

sol5 := combine(rhs(sol4))

-(1/3)*cos(2*x)-(8/45)*2^(1/2)*cos(x)*delta-(1/90)*cos(4*x)*delta+(1/6)*delta-(1/90)*cos(x)*2^(1/2)*Pi*delta^2+(2/45)*2^(1/2)*x*sin(x)*delta^2-(1/90)*2^(1/2)*cos(x)*delta^2-(1/90)*2^(1/2)*cos(3*x)*delta^2-(1/1050)*cos(6*x)*delta^2+(7/270)*cos(2*x)*delta^2

(10)

z(x) = sort(collect(sol5, delta), delta, ascending)

z(x) = -(1/3)*cos(2*x)+(-(1/90)*cos(4*x)+1/6-(8/45)*2^(1/2)*cos(x))*delta+(-(1/1050)*cos(6*x)+(7/270)*cos(2*x)-(1/90)*2^(1/2)*cos(x)-(1/90)*2^(1/2)*cos(3*x)-(1/90)*cos(x)*2^(1/2)*Pi+(2/45)*2^(1/2)*x*sin(x))*delta^2

(11)

``

Remark: There is no impediment, in principle, to calculating higher order terms by increasing N.

Trying N = 3, however, reveals a Maple bug.  The solution fails at the dsolve() step.  We may

solve the system manually without much difficulty, because the coupling of the system's equations

is in triangular form and the solution may be achieved by solving the equations in sequence, a single

equation at a time.


 

Download dsolve-perturbation_solution_ver2.mw

 

@Rouben Rostamian  

pde := diff(u(x, t), t)+u(x, t)*(diff(u(x, t), x)) = 0;
ic := u(x, 0) = piecewise(x <= 0, 0, 1);
sol := `assuming`([pdsolve([pde, ic], HINT = f(x)/f(t))], [t > 0, x > 0])

Maple give:

# sol := u(x, t) = 1

 

Execute code:

?solve

Or:

?fsolve

 

If you want a strange result execute code:

 

restart:
pde := diff(u(x, t), t)+u(x, t)*(diff(u(x, t), x)) = mu*(diff(u(x, t), x$2));
ic := u(x, 0) = piecewise(x >= 1, 0, x < 0, 1);
sol := `assuming`([pdsolve([pde, ic])], [mu > 0, t > 0, x in real])

 

@Kitonum 

Ohh Yes.I thought Maple did not have any bugs.That's why i did not checked.

 

Thanks for info.

The input should be provided in cut-and-pastable form. Please post actual code rather than an image of code.

@mmcdara 

If is a standard trick then Maple does no know  about it.

Can you provide the matrix in a copy/pasted form, or something? Nobody is going to type a  matrix in by hand!

At first you must solve y from eqn and then put to diff(y, x).

See:https://en.wikipedia.org/wiki/Arc_length

The input should be provided in cut-and-pastable form. Correct yours syntax errors.

@Joe Riel 

@Rouben Rostamian  

Thanks.

In Mathematica is simpler:

 

Maple always complicates many things.

@vv 

Yes I know identify mayby fails in certain conditions.

If OP want more information about identify function  just need to enter:

?identify

 

Please post actual  Maple code rather than web page address.

@rlopez 

with(Student[MultivariateCalculus]);
MultiInt(r*exp(-a^2/r^2), [t, r] = Region(0 .. (1/2)*Pi, 0 .. 2*a*cos(t)), output = steps);

it returns it unevaluated.

Second approach:

MultiInt(r*exp(-a^2/r^2), r = 0 .. 2*a*cos(t), t = 0 .. (1/2)*Pi, coordinates = polar[r, t], output = steps);

no either.

Probably this integral has no-close form to known special function.

 

Mathematica gives only a half answer:

n := 0.5e-1;#decrease value for more  contours.
contourplot(A2, z = 0 .. 1, r = -h(z) .. h(z), axes = boxed, contours = [seq(i, i = -1 .. 1, n)], grid = [80, 80], coloring = ["Niagara Azure", "Orange"], transparency = .4);

 

First 20 21 22 23 24 25 26 Last Page 22 of 30