How to solve below PDE based model using finite difference scheme.
1 回表示 (過去 30 日間)
古いコメントを表示
I want to solve a PDE system which is given by

with initial conditions

I want to apply finite difference method to solve the above system for f and g.
We discretize f(t,a,x) as f(i,j,k) and same goes for function "g" as well. If we apply forward finite difference scheme, then both the partial derivative becomes

I know if I start with intial condition then we can solve this. From initial condition we have f(1,j,k)=f(0,a,x) and g(1,j,k)=g(0,a,x) in our hand, putting both in main equation we can get f(2,j,k) and g(2,j,k), but I don't how to handle those integral terms given in both equations . Please Can anyone with PDE background help me.
Any idea about this will help me a lot.
回答 (1 件)
Torsten
2023 年 3 月 20 日
移動済み: Torsten
2023 年 3 月 20 日
Take a grid (ai,xj) over your rectangular region with
0 = a1 < a2 < ... < an = 60
0 = x1 < x2 < ... < xm = 40
Approximate the integrals using the trapezoidal rule by using the values in the grid points.
Then you get a system of 2*(n*m) ordinary differential equations for f and g in the grid points that can be solved using ode15s.
I couldn't classify your problem into a certain category (it's not a PDE as you claim). So I don't know if the method I suggested will work. If you have literature about numerical methods to solve such systems (this is the reason I asked for the application), you should study it first before wildly beginning to produce MATLAB code.
3 件のコメント
Torsten
2023 年 3 月 21 日
編集済み: Torsten
2023 年 3 月 21 日
I don't understand the problem.
You are given f(t,ai,xj) for 1<= i<= n and 1<=j<=m from the integrator. Now you want to evaluate the integral for a certain index pair (I,J) at (t,aI,xJ) with 1<=I<=n and 1<=J<=m
Thus it's approximately
exp(-(xJ-x(1))^2)*f(t,aI,x(1))/sqrt(pi) * dx/2 +
(exp(-(xJ-x(2))^2)*f(t,aI,x(2))/sqrt(pi) + exp(-(xJ-x(3))^2)*f(t,aI,x(3))/sqrt(pi) + ... + exp(-(xJ-x(m-1))^2)*f(t,aI,x(m-1))/sqrt(pi)) * dx +
exp(-(xJ-x(m))^2)*f(t,aI,x(m))/sqrt(pi) * dx/2
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!