0
$\begingroup$

I am looking for power series solution methods used to solve Linear partial Differential equations , mathematica doing verywell for a single ODE using asymtoticDSolve , maple it is capable to find a power series solution as $$\sum _{k=0}^{\infty } \sum _{j=0}^{\infty } y^j x^k c(k,j)$$ I try to put an example heat equation with initial conditions as enter image description here it is possible to do the same in Mathematica?? my first question is possible to find a command pde/solve as maple in Mathematica for two variables as above?? and I try to get part of a matrix as

enter image description here the result it is must be one element c[0,0] how I could solve thanks anyway

$\endgroup$
5
  • 1
    $\begingroup$ "is possible to find a command pde/solve as maple in Mathematica for two variables as above?? " You forgot to show the PDE you are trying to solve and what commands you used. is it a PDE or ODE you wan to solve using power series? $\endgroup$
    – Nasser
    Feb 26 at 1:05
  • 1
    $\begingroup$ In case someone wants to try this in Maple, here is the code pde:=diff(u(x,t),t$2)=diff(u(x,t),x);ic:=u(x,0)=cos(x),D[2](u)(x,0)=sin(x);pdsolve([pde,ic],u(x,t),'series',order=4); I could not get Mathematica's AsymptoticDSolveValue to do this for the heat pde. I do not think it supports pde's, only ode's. screen shot: !Mathematica graphics btw, there is nothing non-linear about this pde. So not sure why OP calls it nonlinear. $\endgroup$
    – Nasser
    Feb 26 at 10:44
  • $\begingroup$ Another way: SOL = DSolve[{D[u[x, t], {t, 2}] - D[u[x, t], x] == 0, u[x, 0] == Cos[x], Derivative[0, 1][u][x, 0] == Sin[x]}, u[x, t], {x, t}]; SOL[[1, 1, 1]] -> Series[SOL[[1, 1, 2]] // Re // ComplexExpand, {x, 0, 3}, {t, 0, 3}] // Normal // Expand ? $\endgroup$ Feb 26 at 12:21
  • $\begingroup$ Thanks @Mariusz Iwaniuk works great but the above method have a inconvenient you must calculate first the close form solution $\endgroup$ Feb 26 at 13:36
  • $\begingroup$ Thanks @Nasser for your time $\endgroup$ Feb 26 at 13:38

1 Answer 1

0
$\begingroup$

It's difficult, at least for me, to help with the first part of the OP without a specific example.

For the second part, though, the problem you have is due to the MatrixForm; see below:

Firstly, I am using

"12.0.0 for Linux x86 (64-bit) (April 7, 2019)"

We have

Sum[c[k, j] x^k y^j, {k, 0, 3}, {j, 0, 3}]

which gives the output

c[0, 0] + y c[0, 1] + y^2 c[0, 2] + y^3 c[0, 3] + x c[1, 0] + 
 x y c[1, 1] + x y^2 c[1, 2] + x y^3 c[1, 3] + x^2 c[2, 0] + 
 x^2 y c[2, 1] + x^2 y^2 c[2, 2] + x^2 y^3 c[2, 3] + x^3 c[3, 0] + 
 x^3 y c[3, 1] + x^3 y^2 c[3, 2] + x^3 y^3 c[3, 3]

Then we ask for the list of coefficients

g = CoefficientList[
  Sum[c[k, j] x^k y^j, {k, 0, 3}, {j, 0, 3}], {x, y}]

which returns

{{c[0, 0], c[0, 1], c[0, 2], c[0, 3]}, {c[1, 0], c[1, 1], c[1, 2], 
  c[1, 3]}, {c[2, 0], c[2, 1], c[2, 2], c[2, 3]}, {c[3, 0], c[3, 1], 
  c[3, 2], c[3, 3]}}

Then we can use Part in the following way

g[[1]]

to get

{c[0, 0], c[0, 1], c[0, 2], c[0, 3]}

or we can use

g[[1, 1]]

which returns precisely one element as it should

c[0, 0]

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.