How to solve simultaneously a system of ODEs containing both initial and boundary value problems

4 vues (au cours des 30 derniers jours)
I have a system of first order ODEs to solve, most of the ODEs are initial value problems , and about two of these ODEs are boundary value problems. For simplicity I have given an illustration below.
I'm currently using ode15s solver to implement the solution for the process as an initial value problem, however the last ODE is best solved as a boundary value problem, where the upper limit of it's boundary is a function of the solution of ODE, dy(1) i.e. y(1).
dy(1) = f{ y(1) }, y(0) = a (constant)
dy(2) = f{ y(1), y(2), y(3)}, y(0) = b (constant)
dy(3) = f{ y(3), y(2) }, y(0) = c (constant) & y(end) = y(1) (variable)
My implementation process involves the use of a script that contains all necessary constant parameters (p), initial condition values (IC) & plots and another script which contains all the ODEs
Therefore the solution syntax to run the process is as illustrated below:
[time,Y] = ode15s(@(t,y) model03cBatchPhBubMod(t,y,p),[0,t_end],IC)

Réponses (1)

Alan Stevens
Alan Stevens le 13 Nov 2020
Your first two odes could be solved by ode15s, since they don't depend on y(3), then, having solved them, you could investigate function bvp4c to solve the third ode.
  7 commentaires
Alan Stevens
Alan Stevens le 13 Nov 2020
All the functions can be written in one script. The functions must come at the end of the script. Call the IVP at the beginning of the script first, then go on to call the BVP (but the calling section will still be written before all the functions).
% Data...
tspan = ...
y1init = ...
[t, y1] = ode15s(@y1fn ...)
% data for bvp functions
% call bvp functions
% extract /plot/display... results
function y = y1fn(...)
...
end
function y = bvpinit(...)
...
end
... etc.
.
Samuel Emebu
Samuel Emebu le 13 Nov 2020
I'm currently working on it, the equations are much. I will give feedback on my success.
Thanks

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by