Question: dsolve not working for N=1 or N=2.

Dear maple users.

Greetings for the day.

I hope you are all fine and safe.

In the below mention code, I need to plot "ax" at 0..1 when N=1 and N=2.

But the code only working for the N=0 case.

How to tackle this situation and plot the function for various values of "ax" at ax=0..1.

waiting for your reply.

JBV.mw

Code:

restart;
PDEtools[declare](f(x), t(x), g(x), prime = (x));

N := 2; m := .2; pa := 3.14*(1/3); ax := ax; h2 := 1+.2*ax+.3*sin((2*3.14)*(ax-.2)); h1 := -1-.2*ax-.1*sin((2*3.14)*(ax-.2)+pa); a2 := 1.4+.1*sin((2*3.14)*(ax-.2))+.3*sin((2*3.14)*(ax-.2)+pa);

f(x):=sum(p^j*f[j](x),j=0..N);  t(x):=sum(p^j*t[j](x),j=0..N);

g(x):=sum(p^j*g[j](x),j=0..N);

Eq1 := (1-p)*(diff(f(x), `$`(x, 4)))+p*((1+.2)*(diff(f(x), `$`(x, 4)))-(.2*(1/3))*(diff((diff(f(x), `$`(x, 2)))^3, `$`(x, 2)))-2*(diff(f(x), `$`(x, 2)))+diff(t(x), `$`(x, 1))+diff(g(x), `$`(x, 1)));

Eq2 := (1-p)*(1+1.2)*(diff(t(x), `$`(x, 2)))+p*((1+1.2)*(diff(t(x), `$`(x, 2)))+.1*(diff(t(x), `$`(x, 1)))*(diff(g(x), `$`(x, 1)))+.2*(diff(t(x), `$`(x, 1)))^2+.5*(diff(f(x), `$`(x, 1)))^2);

Eq3 := (1-p)*(diff(g(x), `$`(x, 2)))+p*(diff(g(x), `$`(x, 2))+diff(t(x), `$`(x, 2)));

for j from 0 to N do
equ1[j] := coeff(Eq1, p, j) = 0; 
equ2[j] := coeff(Eq2, p, j) = 0;
equ3[j] := coeff(Eq3, p, j) = 0;
end do;

con[1][0] := f[0](h2) = (1/2)*a2, (D(f[0]))(h2) = 0, f[0](h1) = -(1/2)*a2, (D(f[0]))(h1) = 0; con[2][0] := t[0](h2) = 1, t[0](h1) = 0; con[3][0] := g[0](h2) = 1, g[0](h1) = 0;

for i to N do

con[1][i] := f[i](h2) = 0, (D(f[i]))(h2) = 0, f[i](h1) = 0, (D(f[i]))(h1) = 0; con[2][i] := t[i](h2) = 0, t[i](h1) = 0; con[3][i] := g[i](h2) = 0, g[i](h1) = 0 end do;

for i from 0 to N do
P:=dsolve({equ1[i],equ2[i],equ3[i],con[1][i],con[2][i],con[3][i]},{f[i](x),t[i](x),g[i](x)}):
f[i](x):=rhs(P[1]);
t[i](x):=rhs(P[2]);
g[i](x):=rhs(P[3]);
end do:

f(x):=evalf(simplify(sum(f[n](x),n=0..N)));
Am := (1+.2)*(diff(f(x), `$`(x, 3)));
with(plots);

display(plot(eval(Am, x = .6), ax = 0 .. 1, numpoints = 200, color = blue));
 

Please Wait...