How to Solve Second Order ODE with 1 boundary condition for y and 1 non-zero boundary condition for y'

11 views (last 30 days)
I'm not sure if MatLab has a built in function to handle this.
To clarify, I'm working with the simple ODE: y''+ay=0 (a is a known constant) and have the following coundary conditions:
1) y(0)=50
2) y'(L)=0 (L is a known constant)
As far as I can tell, ode45 is only applicable for initial value problems and bvp4c requires both boundary conditions to be for y, not y'. I was thiking MatLab would have a built in function to handle this, but I'm not sure at this point.

Accepted Answer

Torsten
Torsten on 4 Apr 2019
Edited: Torsten on 4 Apr 2019
If you convert your second order equation to a system of first-order equations
y1' = y2
y2' = -a*y1
you can use bvp4c to set boundary conditions for y1 (which is y) at x=0 and for y2 (which is y') at x=L.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!