How do you define boundary conditions for ode45 or bvp4c?

1 view (last 30 days)
I am trying to set boundary conditions such as: y1(x=0) = 0 and y2(x=1) = 1 for coupled differential equations. I have seen examples and read up on how I should use bvp4c for this, however the examples given for how to define the BCs do not make sense. Could anyone clarify or show me how this is done? Thank you!

Answers (1)

darova
darova on 14 Aug 2019
12Untitled.png
In function res:
% ya(1) - y at a
% ya(2) - dy/dt at a
% yb(1) - y at b
% yb(2) - dy/dt at b
a and b you define in main script of course
  2 Comments
Jeffrey
Jeffrey on 15 Aug 2019
Thanks for some clarification. However, how would I do it when I have two, coupled differential equations, not just a single y function?

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!