How can I insert this boundary condition?

Hi everyone, I have an ODE system with several variables, like this:
y1' = f (y1,y2)
y2' = g (y1,y2)
I'm solving it with bvp4c.
Is it possible to enter, in addition to the BCs related to y1 and y2, also a condition on the derivatives, for example y1'(0) = 0? Should I add one equation? How?
Thank you!

6 Comments

if you already know how to use bvp4c to put BCs on y1 and y2 themselves, you should already know how to put BCs on their derivatives...
if your question is whether you can have 3 BCs for your problem, not just 2, then you need to tell us if you have unknown parameters in your problem. if so, the bvp4c docs show you how to do that. if not, then with high probability the answer is no...
Elia Paini
Elia Paini on 11 May 2021
Edited: Elia Paini on 11 May 2021
Thank you for your answer.
How can I insert a boundary condition on the derivatives?
For example, I can insert:
ya(1)
yb(2) - 2
But how can I put y1'(a) = 0?
No, I don't have unknown parameters, the system contains only variables or constants...
My fault, I didn't think about the question carefully enough...assuming you mean to replace one of your BCs with a condition on y1', and not add (because that still doesn't make sense no matter what)...
Setting y1'(a) = 0 is the same as asserting f(y1(a),y2(a)) = 0, maybe you could set an unknown parameter as one of the standard boundary conditions, and add another boundary condition to specify the slope condition
function res = bcfun(ya,yb,p)
res = [ya(1)
yb(1) - p
f(ya)
];
end
I also didn't look close at the documentation or other answers, but this does seem like a pretty common need - did you start there?
The problem is I can't replace any of my existent boundary conditions...the only way is to add one more equation in order to have one more available boundary condition.
My idea is this:
y1'= f(y1,y2)
y2'= g(y1,y2)
y3'= f(y1,y2)
with BCs:
% 2 BCs on y1 and y2, then BC on the derivative
...
...
ya(3)
If y3 value is equal to zero, f (y1,y2) is null, hence y1' = 0,
i'm not following anymore...you seem to agree that you can't have 3 BCs on 2 first order equations because that's over-specified...if you add another first order equation that is coupled in, aren't you completely changing the problem?
I'm agree with you... The problem is I can't have 3 bcs without adding another equation. I've just read the documentation, but it seems not clear about this

Sign in to comment.

Answers (0)

Asked:

on 10 May 2021

Commented:

on 13 May 2021

Community Treasure Hunt

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

Start Hunting!