Question: Let's write our first numerical method to solve this same problem! Create a new function called forward _ Euler _ velocity ( ) . This
Let's write our first numerical method to solve this same problem! Create a new function called forwardEulervelocity This function will take in the same exact inputs and provides the same form of output as in the exactvelocity of Problem However, instead of computing the exact solution to the model we will approximate the time derivative using the forward
Euler approximation:
delvelt~~
so that we have the following algebraic problem to solve at a given time step:
Hint: For this problem we are assuming the input will always include our initial time of The code should roughly be structured as follows:
glarr user input
ntlarr length
vlarr an array same length as
ilarr
while nt do
ilarri
end while. please code in python
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
