How to numerically solve a system of coupled partial differential and algebraic equations?
Show older comments
I have a system of coupled partial differential and algebraic equations.
Two 1-D parabolic pdes coupled (function of x and time) with two algebraic equations. What would be the way to solve this sytem?
14 Comments
Torsten
on 25 Jan 2023
Without knowing your equations together with initial and boundary conditions, nothing useful can be said.
Arpita
on 26 Jan 2023
This will be hard to solve, and there is no MATLAB code that could help you.
The usual procedure is to discretize the spatial derivatives in equations (1) and (2) and solve the resulting system of differential-algebraic equations using ODE15S.
But you'll have a lot of trouble with it, that's for sure.
Arpita
on 26 Jan 2023
Yes, the method-of-lines means to use difference quotients as approximations for the spatial derivatives (d/dx, d^2/dx^2) and transform the partial differential-algebraic system into an ordinary differential-algebraic system.
This can then be solved using a MATLAB solver like ODE15S.
Arpita
on 26 Jan 2023
Torsten
on 26 Jan 2023
Yes, but you must tell the solver that these are algebraic and not differential equations.
This is done by zero rows within the mass matrix M which is part of the differential-algebraic system in the form of
M*y' = f(t,y)
Arpita
on 26 Jan 2023
Arpita
on 2 Feb 2023
Torsten
on 2 Feb 2023
This means that ODE15S doesn't like your DAE system.
The reasons can be manifold: programming errors, difficulty of the system to be integrated, ...
So no advice can be given here.
Torsten
on 2 Feb 2023
% Boundary conditions
Cma(1,1)=p.C0;
dCmadx(end)=0;
dphimadx(end)=0;
The boundary conditions you set at the end of your function "porada1D" are nowhere used in the calculation of your output vector
out = [dCeffdt;dCchdt;phit;Cefft];
This cannot be correct.
Arpita
on 3 Feb 2023
Torsten
on 3 Feb 2023
You should start with a simpler problem from which you know that potentially arising problems with the integrator stem from your programming, not from the difficulty or even unsolvability of the problem itself.
Answers (1)
Sarthak
on 9 Mar 2023
0 votes
Hi,
One way to solve a system of coupled partial differential equations (PDEs) and algebraic equations is to use a numerical method such as finite difference or finite element method. Here is an outline of the steps involved:
- Discretize the system of PDEs using a numerical method such as finite difference or finite element method. This will transform the PDEs into a system of algebraic equations.
- Combine the discretized PDEs with the algebraic equations to form a system of nonlinear algebraic equations.
- Use a numerical solver such as the Newton-Raphson method or a quasi-Newton method to solve the system of nonlinear algebraic equations.
- Repeat the process for each time step to obtain a time-dependent solution.
Categories
Find more on PDE Solvers in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
