Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!