Objectives: Set up and solve a boundary value problem using the finite difference method by hand or using Matlab. Solve the following differential equation using the finite difference method. Assume the boundary conditions are y(x=0)-5 and y(x=20)=8. 783-24- dx=y+x=0 Set up a tri-diagonal matrix to solve this problem, but make sure you have coded this so Ax may be adjusted easily. You will want to use a loop or something equivalent to set up the matrix for large x ranges. Part a) Use the following parameters and name your final solution vector "y". % x range deltax = 4; xin 0:deltax:20; Part b) Change your calculations so now Ax= 1. Name this solution vector "y2". Plot both your solutions and compare to the known boundary conditions and the solution you found to the shooting method. To check your results, my plot for part a is shown below. 14 13 12 11 10 9 8 7 6 56 4 0 2 4 I 6 Solution to BVP L 8 I 10 X 12 14 16 18 20

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

8

Provide MATLAB code to solve, please.

Objectives: Set up and solve a boundary value problem using the finite difference method by hand or using Matlab.
Solve the following differential equation using the finite difference method. Assume the boundary conditions are y(x=0)-5 and y(x=20)=8.
783-24-
dx=y+x=0
Set up a tri-diagonal matrix to solve this problem, but make sure you have coded this so Ax may be adjusted easily. You will want to use a loop or something equivalent to set up the matrix for large x ranges.
Part a) Use the following parameters and name your final solution vector "y".
% x range
deltax = 4;
xin 0:deltax:20;
Part b) Change your calculations so now Ax= 1. Name this solution vector "y2".
Plot both your solutions and compare to the known boundary conditions and the solution you found to the shooting method. To check your results, my plot for part a is shown below.
14
13
12
11
10
9
8
7
6
56
4
0
2
4
I
6
Solution to BVP
L
8
I
10
X
12
14
16
18
20
Transcribed Image Text:Objectives: Set up and solve a boundary value problem using the finite difference method by hand or using Matlab. Solve the following differential equation using the finite difference method. Assume the boundary conditions are y(x=0)-5 and y(x=20)=8. 783-24- dx=y+x=0 Set up a tri-diagonal matrix to solve this problem, but make sure you have coded this so Ax may be adjusted easily. You will want to use a loop or something equivalent to set up the matrix for large x ranges. Part a) Use the following parameters and name your final solution vector "y". % x range deltax = 4; xin 0:deltax:20; Part b) Change your calculations so now Ax= 1. Name this solution vector "y2". Plot both your solutions and compare to the known boundary conditions and the solution you found to the shooting method. To check your results, my plot for part a is shown below. 14 13 12 11 10 9 8 7 6 56 4 0 2 4 I 6 Solution to BVP L 8 I 10 X 12 14 16 18 20
Expert Solution
steps

Step by step

Solved in 1 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education