1. Implement the Explicit Euler Scheme for Initial Value Problems of the form: ...

50.1K

Verified Solution

Question

Advance Math

1. Implement the Explicit Euler Scheme for Initial Value Problems of the form:    y'(t) = F(t, y(t)) , t0 ? t ? tend    y(t0) = y0  The function F(t,y) should be coded in a function subprogram FCN(...).  Input data: t0, y0, tend, Nsteps. Thus the time-step will be h=(tend-t0)/Nsteps.  Your code should print out the input data and then the pairs:        tn     Yn  At the end, it should print out the final n, tn, Yn  (appropriately labelled, of cource).2. Solve, on paper, the simple (integration) problem:        y' = 2t ,  0 ? t ? 1        y(0) = ?13. To debug your code, run it on the problem above.  Compare the numerical solution Yn with the exact solution yEXACT(tn),  i.e. modify your output to print out:    tn   Yn   yEXACTn     ERRn  where ERRn = |Yn - yEXACT(tn)|, and keep track of the maximum error.  At the end of the run, print out the above values (at time tend)  and the maximum overall error ERRmax. Test with N=10 and N=100.  Turn off printing of tn Yn ... and test with N = 1000, 10000 and larger.  Once the code is debugged, only FCN(...) and input data need to be changed  to solve other IVPs.4. Now solve the IVP:    y' = ?t/y ,  0 ? t ? 1    y(0) = 1  Find the exact solution at t = 1 (by hand),  and compare the numerical and exact values at t = 1.   Try small (N=10) and larger (N=100, 1000, 10000, ... ) number of time-steps.  At which time does the worst error occur in this problem ?  Plot the exact solution. Do you see why it occurs there?

Answer & Explanation Solved by verified expert
4.0 Ratings (540 Votes)
We have developed a MATLAB code for explicit Euler scheme forinitial value problemsMATLABcodefunction    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students