Message Boards Message Boards

0
|
7772 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

How to solve a second order PDE with DSolve?

Posted 9 years ago
POSTED BY: Edvin Beqari
3 Replies
Posted 9 years ago

After trying some stuff out I got some interesting results. I would like to share with you.

(1) - Here is the main equation again:

DFQ := D[f[t, x], 
   t] == -((\[Alpha] (t/\[Beta])^\[Alpha])/t)*f[t, x] - \[Mu]*D[f[t, x], x] - \[Sigma]^2/2*D[f[t, x], x, x]

(2) - Take the Fourier Transform of each term:

In[63]:= FourierTransform[-((\[Alpha] (t/\[Beta])^(-1+\[Alpha]))/\[Beta])*f[x,t],x,\[Xi],FourierParameters->{0,-2 Pi}]
Out[63]= FourierTransform[-((\[Alpha] (t/\[Beta])^(-1+\[Alpha]) f[x,t])/\[Beta]),x,\[Xi],FourierParameters->{0,-2 \[Pi]}]

In[64]:= FourierTransform[-\[Mu]*D[f[t,x],x],x,\[Xi],FourierParameters->{0,-2 Pi}]
Out[64]= -2 I \[Pi] \[Mu] \[Xi] FourierTransform[f[t,x],x,\[Xi]]

In[65]:= FourierTransform[-(\[Sigma]^2/2)*D[f[t,x],x,x],x,\[Xi],FourierParameters->{0,-2 Pi}]
Out[65]= 2 \[Pi]^2 \[Xi]^2 \[Sigma]^2 FourierTransform[f[t,x],x,\[Xi]]

(3) - Solve as a regular ODE:

In[66]:= DSolve[y'[t]+(-((\[Alpha] ((t/\[Beta])^(-1+\[Alpha])) )/\[Beta])-2 I \[Pi] \[Mu] \[Xi]+2 \[Pi]^2 \[Xi]^2 \[Sigma]^2)*y[t]==0,y[t],t]
Out[66]= {{y[t]->E^((t/\[Beta])^\[Alpha]-2 \[Pi] t \[Xi] (-I \[Mu]+\[Pi] \[Xi] \[Sigma]^2)) C[1]}}

(4) - I do not know how to apply the IC correctly so assume C=1, and take the Inverse Fourier Transform:

In[67]:= InverseFourierTransform[E^((t/\[Beta])^\[Alpha]-2 \[Pi] t \[Xi] (-I \[Mu]+\[Pi] \[Xi] \[Sigma]^2)),\[Xi],x,FourierParameters->{0,-2 Pi}]
Out[67]= E^((t/\[Beta])^\[Alpha]-(x+t \[Mu])^2/(2 t \[Sigma]^2))/(Sqrt[2 \[Pi]] Sqrt[t \[Sigma]^2])
  • Which looks like it has the correct form.

(5) - I plug in values to check the LHS is equal to the RHS, in case this is a solution:

sl[x_,t_]:=E^((t/\[Beta])^\[Alpha]-(x+t \[Mu])^2/(2 t \[Sigma]^2))/(Sqrt[2 \[Pi]] Sqrt[t \[Sigma]^2])

In[55]:= (D[sl[x,t],t])/.{\[Alpha]->1,\[Beta]->5,\[Mu]->0.2,\[Sigma]->0.4,x->2,t->4}
Out[55]= 0.00177528

In[56]:= (-((\[Alpha] (t/\[Beta])^\[Alpha])/t)*sl[x,t]-\[Mu]*D[sl[x,t],x]-\[Sigma]^2/2*D[sl[x,t],x,x])/.{\[Alpha]->1,\[Beta]->5,\[Mu]->0.2,\[Sigma]->0.4,x->2,t->4}
Out[56]= -0.00177528
  • So somehow I am off by a negative sign (maybe). My suspicion is that it has to do with the initial condition but if C is a constant then it would flip the sign on both sides again.

  • When I plot the function sl[x,t] it has a very different shape than the one when I use NDSolve.

I have some issues with NDSolve but I will address that later but I would like to know how to extract some values from NDSolve so I can compare with the Analytical solution for a fixed set of values.

PS: Is there anything I can do to improve my post above? Is it possible to plot Manipulate graphs in here?

POSTED BY: Edvin Beqari
Posted 9 years ago

I understand - thank you for the explanation.

POSTED BY: Edvin Beqari

PDE's are solved numerically with the Method of Lines in Mathematica. Analytical solutions of PDE's are very difficult to solve algorithmically, which is why I suspect Wolfram hasn't ever released any module for it. So you can use NDSolve, but not Solve for PDE's

POSTED BY: Eric Smith
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