Answered step by step
Verified Expert Solution
Question
1 Approved Answer
this is a matlab code. when i did run i had a problem with .can you help me with it. % The boundary value problem
this is a matlab code. when i did run i had a problem with .can you help me with it.
% The boundary value problem code
% y'' + 2*y' + 3*y = sin(x)
% y'(1) = -4, y(0) = 7
% system of ODEs
bvpode = @(x,y) [ y(-4); sin(x) - 2*y(-4) - 3*y(0)];
% boundary conditions
bvpbc = @(ya,yb) [ ya(0)+4; yb(1)-7 ];
% initial guess vector function
bvpinitguess = @(x) [x;x];
solinit = bvpint(1:0.01:2, bvpinitguess)
%Solving
sol =bvp4c(bvode,bvpbc,solinit);
%plutting
xint = linspace(1,2)
yint = deval(sol,aint)
plot(xint,yint(1,:))% plot y1(x) =y(x)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started