Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE USE MATLAB!!!!! PLEASE DO NOT USE SOMEONE ELSES ANSWER!!! Here is some hints that we were given... % % % Use finite differences to
PLEASE USE MATLAB!!!!! PLEASE DO NOT USE SOMEONE ELSES ANSWER!!! Here is some hints that we were given... Use finite differences to solve the BVP Be careful about the shape of the vectors, you may have to transpose to get the correct shape. It's a good idea to print the solutions out to make sure the shape is correct. Part : Shooting Method via Bisection Use the shooting method to solve the BVP It's a good idea to test out a few in the command window first to make sure that your initial conditions gets you to different sides of the right boundary condition. Use the plot to help you figure out what your choices of initial conditions should be Consider the boundary value problem with and The true solution to this boundary value problem is where and The solution looks like this: Following the finite difference process we used in lecture, use a second order difference scheme to approximate and rewrite this initial value problem as a linear system of equations Use Note that there will be total values, but we are only trying to approximate at the interior times. The matrix A should be where is the number of interior times, and the vector b should be Save a copy of in a variable named A Save a copy of b in a variable named A Solve this linear system using Gaussian elimination the backslash operator in MATLAB or the solve function in python Make a column vector containing the values at all times including the two boundary values and save a copy of this vector in a variable named AHint: if A is passing but A and A aren't, to be consistent with the autograder don't distribute the Find the maximum in absolute value error between this approximation and the true solution. Save this error in a variable named A Now solve the problem using the shooting method. Remember, you need to convert this second order ODE into a system of two first order ODEs. Apply a bisection scheme to the usual IVP solvers ode MATLAB or solveivp Python using For the second initial conditions, you can use the plot to help you test out values that will get you on different sides of the right boundary condition. Break out of the loop for bisection when the difference between your approximation at the right boundary point and the exact value at the right boundary point is less than e; ie Save the numerical solution as a column vector A and the maximum in absolute value error max as A Further save the maximum difference in absolute value between the solution from part and this solution as A A A
PLEASE USE MATLAB!!!!! PLEASE DO NOT USE SOMEONE ELSES ANSWER!!!
Here is some hints that we were given...
Use finite differences to solve the BVP
Be careful about the shape of the vectors, you may have to transpose to
get the correct shape. It's a good idea to print the solutions out to
make sure the shape is correct.
Part : Shooting Method via Bisection
Use the shooting method to solve the BVP
It's a good idea to test out a few in the command window first to make
sure that your initial conditions gets you to different sides of the right
boundary condition.
Use the plot to help you figure out what your choices of initial
conditions should be
Consider the boundary value problem
with and
The true solution to this boundary value problem is
where
and
The solution looks like this:
Following the finite difference process we used in lecture, use a second order difference scheme to
approximate and rewrite this initial value problem as a linear system of equations Use
Note that there will be total values, but we are only trying to approximate at the
interior times. The matrix A should be where is the number of interior times, and
the vector b should be Save a copy of in a variable named A Save a copy of b in a
variable named A
Solve this linear system using Gaussian elimination the backslash operator in MATLAB or the
solve function in python Make a column vector containing the values at all times including
the two boundary values and save a copy of this vector in a variable named AHint: if A is
passing but A and A aren't, to be consistent with the autograder don't distribute the
Find the maximum in absolute value error between this approximation and the true solution. Save
this error in a variable named A
Now solve the problem using the shooting method. Remember, you need to convert this second order
ODE into a system of two first order ODEs. Apply a bisection scheme to the usual IVP solvers ode
MATLAB or solveivp Python using For the second initial conditions, you can use the
plot to help you test out values that will get you on different sides of the right boundary condition.
Break out of the loop for bisection when the difference between your approximation at the right
boundary point and the exact value at the right boundary point is less than e; ie
Save the numerical solution as a column vector A and the
maximum in absolute value error max as A Further save the maximum difference in
absolute value between the solution from part and this solution as A A A
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