Question: Test 3 will have > 1 0 0 points but will be graded out of some fraction of those points ( i . e .
Test will have points but will be graded out of some fraction of those points ie built in extra credit is possible For problem you are requested to use ode or scipy.integrate.solveivp for part of the problem, but for the remainder you will write your own ODE integrators. For problems and you may use any functions of your choosing MATLABPython builtin functions or your own
Question pts: ODEs ExplicitImplicit Rules, Stability, and the importance of Stepsize.
Stiff systems those in which small step sizes are required due to large system changes in short timespans are particularly difficult to integrate and benefit the most from variable stepsize integration schemes. You will not write one of these variable stepsize codes thats MATLAB's job but you will see how effective they are. You are to integrate the following stiff system:
Equation System
In which x x and x are the positions of three masses, with the initial conditions
ICs
and system parameters
System Parameters
Your process is as follows:
On a piece of paper or using electrons if you must rewrite the equations as a collection of firstorder ODEs.
Write a "odefun" function that takes the independent variable
and the dependent variables as a vector
and returns the derivatives
as a vector. For MATLAB, at least, you will need your odefun to return
as a column, or ode will complain; however, ode returns all its values in rows, which means you'll probably need to transpose things in your own codes if you want to return values the same way ode does.
Solve this system using ode or scipy.integrate.solveivp and your odefun from
to so you likely have an idea of what this system looks like. It's stiff you can tell by how much it deviates from a sinusoid
Write three solvers using the methods below that also use this odefun function to integrate this initial value problem. Note that one of these solvers is the most complex, and if you write that one first you can essentially simplify it twice to obtain the other two solvers. Note also that each solver must be a function, with arguments odefun tspan, ics, timestep
PredictorCorrector Heuns explicit,
accurate.
Trapezoidal, implicit,
accurate; this function canshould take the additional argument of the size of error required to consider its intermediate iteration converged.
RK explicit,
accurate.
Integrate the equations using the PredictorCorrector method from
to You may choose any step sizes you want its gonna be fairly SMALL but you must show:
The integrated solution is converged; and
The integrated solution is stable.
Based on the PredictorCorrector step size, choose a somewhat larger step size for the other two methods and integrate them over the same timespan. Briefly justify your reasoning for the larger step size chosen using an argument based on the method's truncation error ie the order of the method For these as well, show stability and convergence.
Create a plot for each displacement one figure for each of the
over the timespan showing all three solution methods. Comment on what you see and the amount of effort required in terms of step size
After this is all over, step outside your house and shout: "ODEFUN!!" three times. This step is optional.
Question pts: Single and Piecewise Polynomial Interpolation, Reverse Interpolation.
Use both singlepolynomial and piecewise polynomial techniques of your choice to interpolate f f and f from the data below. Plot a smooth curve from each method from to ; also on this plot, include the given points as x and three specific points from each method as os If your expectation is that this is a fairly smooth function, qualitatively comment on the reliability of the interpolated values from each technique. Plot the singlepolynomial and its points in green, and the piecewise polynomial in blue.
index
x
fx
Next, find all x values for both the singlepolynomial and the piecewise polynomial between x and x for which the function value fx Do this algorithmically that is don't just look at the plot, guess where they are, and provide your root finder a close guess: have your code do it automatically. Once you find these values, plot them all on their respective polynomial lines as red symbols. How many roots were found for each polynomial?
Hints:
Recall the technique provided during the interpolation lectures ie how to do this, in general
Given you are trying to find all the roots in a specific interval, it may be helpful to "sweep" through this interval using a loop with a small stepsize calling your root finding function at each step with the unique interval position ie the loop variable as your initial guess.
Because your root finding function will return multi
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
