Question

MATLAB CODE REQUIRED Consider the problem of estimating y(0.5) for the boundary-value problem y''+ y' =...

MATLAB CODE REQUIRED

Consider the problem of estimating y(0.5) for the boundary-value problem
y''+ y' = y + 2, y(0) = 0, y'(1) = 2. Find the solution using 2 approaches:

(b) Use finite difference with n = 10.Please provide Matlab code. What is y(0.5) value with Matlab?

(c) Using bvp4c. Please provide Matlab code. What is y(0.5) value with Matlab?

Homework Answers

Answer #1

b) Using Finite Diference Method :

function output = ode45function(t,y)
   clc;
   clear all;
   close all;
   time_period = [0 10];
   intial = [0,2];
   [t,y] = ode45(@ode45function,time_period,initial);
   plot (t,y(:,1));
   figure
   plot (t,y(:,2));
output = [y(0.5); -1*y(2)+y(1)+2];

c)Using bvp4c :

function output = output_bvp(x,y)
   clc;
   clear all;
   close all;
   init = bvpinit(linespace(1,3,10),[0,2])
   sol = bvp4c(@bvp_output,init);
   x = linespace (1,3,100);
   BS=deval(sol,x);
   plot(x,BS);
output=[y(0.5); -1*y(2)+y(1)+2];

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Consider the boundary value problem y''(t) + y(t) = f(t) , y(0) = 0 and  y(π/2) =...
Consider the boundary value problem y''(t) + y(t) = f(t) , y(0) = 0 and  y(π/2) = 0. Find the solution to the boundary value problem
Consider the boundary value problem below (assume λ > 0): y ′′ + λy = 0...
Consider the boundary value problem below (assume λ > 0): y ′′ + λy = 0 y(0) = 0 y ′ (π) = 0 Find the eigenvalues and the associated eigenfunctions for this problem. Show all work.
Given: The following boundary value problem:    y"+ lamda*y = 0;                0 < x...
Given: The following boundary value problem:    y"+ lamda*y = 0;                0 < x < 2;         y(0) = 0;          y’(2) = 0 Find corresponding eigenvalues, (lamda)n and normalized eigenfunctions yn Expand the function f(x) = x, in terms of the eigen functions obtained in (i)
A nontrivial solution of the boundary value problem y′′ + 9y = 0; y′(0) = 0,...
A nontrivial solution of the boundary value problem y′′ + 9y = 0; y′(0) = 0, y′(π) = 0 is:
find the eigenvalues and eigenfunctions for the given boundary-value problem. y'' + (lambda)y = 0, y(-pi)=0,...
find the eigenvalues and eigenfunctions for the given boundary-value problem. y'' + (lambda)y = 0, y(-pi)=0, y(pi)=0 Please explain where alpha = (2n+1)/2 comes from in the lambda>0 case. Thank you!!
6. Consider the initial value problem y' = ty^2 + y, y(0) = 0.25, with (exact)...
6. Consider the initial value problem y' = ty^2 + y, y(0) = 0.25, with (exact) solution y(t). (a) Verify that the solution of the initial value problem is y(t) = 1/(3e^(-t) − t + 1) and evaluate y(1) to at least four decimal places. (b) Use Euler’s method to approximate y(1), using a step size of h = 0.5, and evaluate the difference between y(1) and the Euler’s method approximation. (c) Use MATLAB to implement Euler’s method with each...
Find the solution to the boundary value problem: d2y/dt2−4dy/dt+3y=0,   y(0)=7,y(1)=8 y=
Find the solution to the boundary value problem: d2y/dt2−4dy/dt+3y=0,   y(0)=7,y(1)=8 y=
find the boundary- value problem y’’ + 2y = 4x, y(0) = 0, y(1) + y’(1)...
find the boundary- value problem y’’ + 2y = 4x, y(0) = 0, y(1) + y’(1) = 0
Using Matlab to solve the problem below Given X=[-2 -1 0 1 2] Y=[1.5 3.2 4.5...
Using Matlab to solve the problem below Given X=[-2 -1 0 1 2] Y=[1.5 3.2 4.5 3.4 2] a). Plot a scatter plot of the data b). Determine the coefficients of the polynomial ?0 + ?1? + ?2?2 which best fits the data c). Plot this function on the same plot as in part ‘a’. USE MATLAB CODE ONLY! USE MATLAB CODE ONLY! THANK YOU
Solve the given boundary-value problem. y'' − 2y' + 2y = 2x − 2,   y(0) =...
Solve the given boundary-value problem. y'' − 2y' + 2y = 2x − 2,   y(0) = 0, y(π) = π
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT