solution of a system of PDEs with finite difference method and runge kutta second order

4 views (last 30 days)
Hi everybody, I'm trying to solve a system of two PDEs in two variables, using the the finite difference method to approximate the spatial derivatives and then the Runge Kutta at second order method to derivate with respect to time. The system is the following: du/dt = a*(d^2u/dx^2) - b*u*v + c*u dv/dt = a*(d^2u/dx^2) + b*u*v - d*u where u(x, t) and v(x, t) are the functions I have to find; a, b, c and d are positive parameters; 0 < x < 1; the spatial derivatives are null both in x = 0 and x = 1 (and those are the boundary conditions). If anyone knows how to procede, I would appreciate an explanation. Thank you!

Accepted Answer

Torsten
Torsten on 27 Aug 2023
Edited: Torsten on 27 Aug 2023
Where is the x in your equations ? I only see differentiation with respect to t. And shouldn't the 2nd order differentiation in the 2nd equation be for v and not for u ?
Anyhow: After formulating your equations correctly, I think "pdepe" will solve your problem.
  3 Comments
Torsten
Torsten on 27 Aug 2023
Edited: Torsten on 27 Aug 2023
Also, I would like to write a program to solve the system without using pdepe or other matlab toolboxes, if it's possible
1st option (recommended regarding your numerical background): "pdepe"
2nd option: finite difference approach for the spatial derivatives and method-of-lines using ode15s to solve the resulting system of ordinary differential equations
Examples:
3rd option (not recommended regarding your numerical background): finite difference approach with self-written time integrator (e.g. Runge-Kutta)
You should at least start with the "pdepe" solution to have a reliable code to validate your solution against.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!