Message Boards Message Boards

How to solve PDE numerically?

Posted 3 years ago

$$\frac{\partial T^2}{\partial r^2}+\frac{1}{r}\frac{\partial T}{\partial r}+\frac{1}{r^2}\frac{\partial T^2}{\partial \theta^2}+\lambda T=-\lambda r \sin{\theta}$$ The boundary condition are: $T=0$ at $r=1$ and $T=finite$ at $r=0$ and $\theta$ varying from 0 to 2 Pi.

  eqn = D[T[r, \[Theta]], {r, 2}] + 1/r D[T[r, \[Theta]], {r, 1}] + 
       1/r^2 D[T[r, \[Theta]], {\[Theta], 2}] + \[Lambda]^2 T[
         r, \[Theta]] == -\[Lambda] r Sin[\[Theta]]

Although this problem i had solved first manually using separation of variable then applying the shooting method. But i want to solve this using Mathematica alone. In separation of variable i assumed $T=F(r) \sin{\theta}$ and then i solved ode using the shooting method. The boundary condition was: $F=0$ at $r=1$ and $F'=0$ at $r=0$.

POSTED BY: KRISHAN SHARMA
2 Replies

I tried

eqn = D[T[r, \[Theta]], {r, 2}] + 1/r D[T[r, \[Theta]], {r, 1}] + 1/r^2 D[T[r, \[Theta]], {\[Theta], 2}] + \[Lambda]^2 T[ r, \[Theta]] == -\[Lambda] r Sin[\[Theta]]    
eqn1 = FullSimplify[# r^2] & /@ eqn    
eqn2 = eqn1 /. \[Lambda] -> 1.2    
lsg = NDSolve[
  {eqn /. \[Lambda] -> 0, T[0, \[Theta]] == 5, 
   D[T[r, \[Theta]], r] == 0 /. r -> 0},
  T,
  {r, 0, 1}, {\[Theta], 0, 2 Pi},
  Method -> {"MethodOfLines", 
    "DifferentiateBoundaryConditions" -> False}]

But that doesn't do the job. Unfortunately the error messages do not give any hint how to avoid the division by zero. A question for Support?

POSTED BY: Hans Dolhaine
Posted 3 years ago

Yes! the same problem i encountered while i was trying before going for manual way. Yes it need support team help.

POSTED BY: Updating Name
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract