Clear Filters
Clear Filters

How to solve pde and ode together?

7 views (last 30 days)
wei
wei on 3 Jan 2015
Commented: Torsten on 6 Jan 2015
Dear everyone, I have a problem dealing with gas release from a solid phase to its surroundings (gas phase). To make it easy to understand, I want to make a example. There is a bottle contains oxygen, and I put a ball into it and close the bottle immediately. The ball starts to absorb oxygen until the ball and the gas phase in the bottle get in equilibrium. The governing equation of the ball can be described with a pde funtion (fick's law), while the gas phase is simple a ode function (only time dependent) because the time needed for equilibrium is very short. I know that we can use "pdepe" to solve the pde function and "ode45" for the ode function, My question is how to solve both functions simultaneously, as they are linked (the amount of oxygen absorbed by the ball is equal to the oxygen decreased in the gas phase).

Answers (1)

Torsten
Torsten on 5 Jan 2015
Use the method of lines to transform your PDE into a system of ODEs and use an ODE integrator to solve the complete system (ODEs from PDE discretization + your additional ODE).
Best wishes
Torsten.
  2 Comments
wei
wei on 5 Jan 2015
Thanks for the answer, but I am not clear for that. pde has two independent variables and how to convert it to odes?

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!