ode 45 third order and boundary conditions
Show older comments
%this is my main file and im sure of it
function ydot = kubieodeee(t, y )
M = 0.5;
Nt = 0.3;
Nb = 0.1;
Pr = 0.2;
Le = 1.0;
ydot = zeros(7, 1); % Pre-allocate
ydot(1) = y(2); % f '
ydot(2) = y(3); % f ''
ydot(3) = -y(1) * y(3) + M * y(2); % f''' = -y(1)*y(3) + 0.5*y(2 )
ydot(4) = y(5); % theta '
ydot(5) = -Pr * (Nb * y(7) * y(5) + Nt * y(5) * y(5)); % theta ''
ydot(6) = y(7); % psi '
ydot(7) = - (Nt/Nb) * ydot(5) - (Le/Nb) * y(1); % psi ''
%BUT I HAVE ISSUES WITH THIS PART WHICH MAKES MY CODE RUN AND PLOT MY GRAPH PLEASE I NEED HELP FILLING THE BLANK SPACE IM VERY CLOSE TO MAKING THIS A SUCCESS AND THIS PALTFORM HAS BEEN REALLY HELPFUL.HELP ME OUT PLEASE
clc
clear all
y0=zeros(7,1);
y0(1) = 0; % f
y0(2) = 1 + 0.3; % f'
y0(3) = 0; % f''
y0(4) = 1; % theta
y0(5) = 0; % theta'
y0(6) = 0; % psi
y0(7) = 0; % psi'
init = [0 0 x];
eta = [0,20];
[t y] = ode45('kubieodeee',eta,init);
end
plot(t,y(:,1));
axis equal
axis([0 3 0 2])
legend()
grid on
Answers (1)
Daniel Kubiat
on 28 Mar 2019
0 votes
4 Comments
Daniel Kubiat
on 28 Mar 2019
Torsten
on 28 Mar 2019
ODE45 is an ODE integrator suited for initial value problems.
Since your problem is a boundary value problem, ODE45 is not the suitable tool.
Use BVP4C instead.
Daniel Kubiat
on 28 Mar 2019
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!