Question: Now consider the boundary value problem for an ODE that describes the temperature of an object that ranges from x = 0 to x =
Now consider the boundary value problem for an ODE that describes the temperature of an object that ranges from to in one spatial dimension:
Subject to the following boundary conditions:
Where is a constant for conductivity. Create a function called solve BVP FD that will use the central finite difference method as in and as seen in class.
The function should take the following input in the following order:
float TO: Temperature at left boundary
float T: Temperature at right boundary
float : The coefficient that shows up in the equation
int : The desired spacing for the finite difference approximation
and outputs in the following order: numpy vector : The estimated solution at each point in space dots,
Hint: This example also has an analytic solution of the form:
you can use a value with in this case, your finite difference solution should be very close to the true solution since the true solution is just a cubic function.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
