Bernard Afful

10 Reputation

One Badge

0 years, 122 days

MaplePrimes Activity


These are replies submitted by Bernard Afful

Please the attached is the script I have been able to do so far, can someone help me to fix it.

Many thanks

 

HPMthesis.mw
 

restart

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

` f`(x, t)*`will now be displayed as`*f

 

`derivatives with respect to`*x*`of functions of one variable will now be displayed with '`

 

`derivatives with respect to`*t*`of functions of one variable will now be displayed with '`

(1)

de1 := (1-p)*(diff(f(x, t), t))+p*(2*f(x, t)^2*(diff(f(x, t), x))-(diff(f(x, t), x))^2+(1/2)*f(x, t)*(diff(f(x, t), `$`(x, 2))))

(1-p)*(diff(f(x, t), t))+p*(2*f(x, t)^2*(diff(f(x, t), x))-(diff(f(x, t), x))^2+(1/2)*f(x, t)*(diff(diff(f(x, t), x), x)))

(2)

ibvc := f(x, 0)+tanh(x); n := 3; F := unapply(add(b[k](x, t)*p^k, k = 0 .. n), x)

f(x, 0)+tanh(x)

 

3

 

proc (x) options operator, arrow; b[0](x, t)+b[1](x, t)*p+b[2](x, t)*p^2+b[3](x, t)*p^3 end proc

(3)

DE1 := series(eval(de1, f = F), p = 0, n+1)

series(diff(b[0](x, t), t)+(diff(b[1](x, t), t)-(diff(b[0](x, t), t))+2*b[0](x, t)^2*(diff(b[0](x, t), x))-(diff(b[0](x, t), x))^2+(1/2)*b[0](x, t)*(diff(diff(b[0](x, t), x), x)))*p+(diff(b[2](x, t), t)-(diff(b[1](x, t), t))+2*b[0](x, t)^2*(diff(b[1](x, t), x))+4*b[0](x, t)*b[1](x, t)*(diff(b[0](x, t), x))-2*(diff(b[0](x, t), x))*(diff(b[1](x, t), x))+(1/2)*b[0](x, t)*(diff(diff(b[1](x, t), x), x))+(1/2)*b[1](x, t)*(diff(diff(b[0](x, t), x), x)))*p^2+(diff(b[3](x, t), t)-(diff(b[2](x, t), t))+2*b[0](x, t)^2*(diff(b[2](x, t), x))+4*b[0](x, t)*b[1](x, t)*(diff(b[1](x, t), x))+2*(2*b[0](x, t)*b[2](x, t)+b[1](x, t)^2)*(diff(b[0](x, t), x))-2*(diff(b[0](x, t), x))*(diff(b[2](x, t), x))-(diff(b[1](x, t), x))^2+(1/2)*b[0](x, t)*(diff(diff(b[2](x, t), x), x))+(1/2)*b[1](x, t)*(diff(diff(b[1](x, t), x), x))+(1/2)*b[2](x, t)*(diff(diff(b[0](x, t), x), x)))*p^3+O(p^4),p,4)

(4)

CO := map(coeffs, eval([ibvc], f = F), p)

[b[0](x, t)+tanh(x), b[1](x, t), b[2](x, t), b[3](x, t)]

(5)

for k from 0 to n do IBVC1 := select(has, CO, b[k]); slv := dsolve({coeff(DE1, p, k), op(IBVC1)}); b[k] := unapply(rhs(slv), t) end do

Error, invalid input: rhs received {b[0](x, t) = -tanh(x)}, which is not valid for its 1st argument, expr

 

``


 

Download HPMthesis.mw
 

restart

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

` f`(x, t)*`will now be displayed as`*f

 

`derivatives with respect to`*x*`of functions of one variable will now be displayed with '`

 

`derivatives with respect to`*t*`of functions of one variable will now be displayed with '`

(1)

de1 := (1-p)*(diff(f(x, t), t))+p*(2*f(x, t)^2*(diff(f(x, t), x))-(diff(f(x, t), x))^2+(1/2)*f(x, t)*(diff(f(x, t), `$`(x, 2))))

(1-p)*(diff(f(x, t), t))+p*(2*f(x, t)^2*(diff(f(x, t), x))-(diff(f(x, t), x))^2+(1/2)*f(x, t)*(diff(diff(f(x, t), x), x)))

(2)

ibvc := f(x, 0)+tanh(x); n := 3; F := unapply(add(b[k](x, t)*p^k, k = 0 .. n), x)

f(x, 0)+tanh(x)

 

3

 

proc (x) options operator, arrow; b[0](x, t)+b[1](x, t)*p+b[2](x, t)*p^2+b[3](x, t)*p^3 end proc

(3)

DE1 := series(eval(de1, f = F), p = 0, n+1)

series(diff(b[0](x, t), t)+(diff(b[1](x, t), t)-(diff(b[0](x, t), t))+2*b[0](x, t)^2*(diff(b[0](x, t), x))-(diff(b[0](x, t), x))^2+(1/2)*b[0](x, t)*(diff(diff(b[0](x, t), x), x)))*p+(diff(b[2](x, t), t)-(diff(b[1](x, t), t))+2*b[0](x, t)^2*(diff(b[1](x, t), x))+4*b[0](x, t)*b[1](x, t)*(diff(b[0](x, t), x))-2*(diff(b[0](x, t), x))*(diff(b[1](x, t), x))+(1/2)*b[0](x, t)*(diff(diff(b[1](x, t), x), x))+(1/2)*b[1](x, t)*(diff(diff(b[0](x, t), x), x)))*p^2+(diff(b[3](x, t), t)-(diff(b[2](x, t), t))+2*b[0](x, t)^2*(diff(b[2](x, t), x))+4*b[0](x, t)*b[1](x, t)*(diff(b[1](x, t), x))+2*(2*b[0](x, t)*b[2](x, t)+b[1](x, t)^2)*(diff(b[0](x, t), x))-2*(diff(b[0](x, t), x))*(diff(b[2](x, t), x))-(diff(b[1](x, t), x))^2+(1/2)*b[0](x, t)*(diff(diff(b[2](x, t), x), x))+(1/2)*b[1](x, t)*(diff(diff(b[1](x, t), x), x))+(1/2)*b[2](x, t)*(diff(diff(b[0](x, t), x), x)))*p^3+O(p^4),p,4)

(4)

CO := map(coeffs, eval([ibvc], f = F), p)

[b[0](x, t)+tanh(x), b[1](x, t), b[2](x, t), b[3](x, t)]

(5)

for k from 0 to n do IBVC1 := select(has, CO, b[k]); slv := dsolve({coeff(DE1, p, k), op(IBVC1)}); b[k] := unapply(rhs(slv), t) end do

Error, invalid input: rhs received {b[0](x, t) = -tanh(x)}, which is not valid for its 1st argument, expr

 

``


 

Download HPMthesis.mw

 

 

@acer 

OK sir

@Mariusz Iwaniuk 

I'm currently looking for the solution for the IVP using Homotopy Perturbation method

Page 1 of 1