logo Hurry, Grab up to 30% discount on the entire course
Order Now logo
834 Times Downloaded

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Gabriel WalkerHistory
(5/5)

568 Answers

Hire Me
expert
Narmin BagiyevaFinance
(/5)

544 Answers

Hire Me
expert
Julian RichardsonComputer science
(5/5)

586 Answers

Hire Me
expert
Lakshay AggarwalEngineering
(5/5)

872 Answers

Hire Me
MATLAB
(5/5)

Implement the shooting method for this problem in Matlab. Use Matlab solver ode45, with

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

1. Linear Shooting Method for a Two-point Boundary Value Problem

(A) Consider the differential equation

yJJ = yJ + 2y + cos(x), for 0 ≤ x ≤ π ,

with boundary conditions 

y(0) = −0.3, y  π   = −0.1.

Show that the exact solution is

y(x) = −(sin(x) + 3 cos(x))/10.

Implement the shooting method for this problem in Matlab. Use Matlab solver ode45, with your choice of error tolerance. You can check your answer by comparing it with the exact solution. Plot your solution, and also the error.

(B) Consider the two-point boundary value problem for the unknown u(x)

−uJJ + 3u = x(1 − x), u(0) = 0, u(1) + uJ(1) = 1.

Explain in detail how to solve this problem with the shooting method.

2. Non-linear Shooting Method for a Two-point Boundary Value Prob- lem

Consider the differential equation

yJJ = −(yJ)2 − y + ln(x), 1 ≤ x ≤ 2 with the boundary conditions  y(1) = 0, y(2) = ln 2.

Show that the exact solutions is y(x) = ln x.

Implement the shooting method for this problem in Matlab. Use Matlab solver ode45. Note that this is a non-linear problem, so you need to use a secant iteration. Since the secant iteration converges quickly if the initial guess is good, it is crucial to get a good initial guess. Try the values z1 = 1, z2 = 0.5.

You may choose the tolerance to be 10−9, and maximum number of iterations for the secant method to be 5. Plot the approximate solutions together with the exact solution. Plot also the error.

3. Finite Difference Method in 1D

Consider the same equation as in Problem 1A. We will now compute approximate solu- tions with the finite difference method.

(a). Consider a uniform grid with h = (b − a)/N . Set up the finite difference method for the problem. Write out this tri-diagonal system of linear equations for yi.

(b). Write a Matlab program that computes the approximate solution yi. You may either use the Matlab solver to solve the linear system, or use the code for tri-diagonal systems (you should find it in a previous homework). Test your program for N = 10 and N = 20. Plot the approximate solutions together with the exact solution. Plot also the errors.

(5/5)
Attachments:

Expert's Answer

834 Times Downloaded

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme