Solving a PDE Using Finite Difference Method

kitz2
Messages
4
Reaction score
0
Hi

The equation is:

\frac{dP}{dt}-A*\frac{{d}^2P}{dx^2}-B*\frac{dC}{dt}=0

dP/dt=A*d2P/dx^2 was solved using a finite difference method. If the function C(x,t) is known, is it possible to solve the whole equation by using the finite difference solution as a supplement to the complete solution. I mean solving dP/dt = B*dC/dt, and add them together or something. In case, how do I go about it?

Im using MATLAB and from the first finite difference solution I have an matrix for P(x,t) with all values for different x and t, and I also have a matrix for C(x,t) with all values for x and t. What I did was adding the P matrix with the C matrix multiplied with B , which have equal size. When the result was not as I wanted I tried adding the P matrix with P(matrix)+B*C(matrix), so I had 2*P(matrix) + B*C(matrix). Then I got a result which looked alright, but obviosuly it is just a shot in the dark, and not "math".

Im not very good at math as you might notice :blushing:
 
Physics news on Phys.org
This is not a partial differential equation (pde) it is a second order ordinary differential equation (ode). Are there any boundary or initail conditions that must be satisfied ?
 
Boundary and inital conditions:

C=Co , t=0, 0<=x<=inf.
C=Cdf x-> inf , t >0
P=Po , t=0 0<=x<=inf.
P=Po t>0 x-> inf.
P=Pw x=0 t>0
 
CFDFEAGURU said:
This is not a partial differential equation (pde) it is a second order ordinary differential equation (ode). Are there any boundary or initail conditions that must be satisfied ?

It is a partial differential equation, both t and x are the independent variables and P the dependent function to find. C is a given function, but I don't see how to solve it. Certainly numerical ways should be possible but I can't help you on this.

coomast
 
There is the following linear Volterra equation of the second kind $$ y(x)+\int_{0}^{x} K(x-s) y(s)\,{\rm d}s = 1 $$ with kernel $$ K(x-s) = 1 - 4 \sum_{n=1}^{\infty} \dfrac{1}{\lambda_n^2} e^{-\beta \lambda_n^2 (x-s)} $$ where $y(0)=1$, $\beta>0$ and $\lambda_n$ is the $n$-th positive root of the equation $J_0(x)=0$ (here $n$ is a natural number that numbers these positive roots in the order of increasing their values), $J_0(x)$ is the Bessel function of the first kind of zero order. I...
Are there any good visualization tutorials, written or video, that show graphically how separation of variables works? I particularly have the time-independent Schrodinger Equation in mind. There are hundreds of demonstrations out there which essentially distill to copies of one another. However I am trying to visualize in my mind how this process looks graphically - for example plotting t on one axis and x on the other for f(x,t). I have seen other good visual representations of...

Similar threads

Back
Top