Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C program code for the following problem. 1. For the decay problem discussed in chapter 1, investigate the effect that variation of the
Write a C program code for the following problem.
1. For the decay problem discussed in chapter 1, investigate the effect that variation of the time step size has on the accuracy of the solution. To do this, you can use the fact that you already know that the solution to the differential equation dt is given by NU(t) (1) (2) Use the Euler method to solve the eq. (1) using time steps of At 0.005, 0.01, 0.02, 0.05, 0.10, 0.20 s. In each case, consider a time constant of T 1 s, and carry out the integration over a range of 5 s. Plot your six sets of results on a conventional graph (NU vs. t) and on a semi-log graph (In(Nu) vs. t). In addition, overlay the true solution, i.e. eq. (2) onto each of the two graphs. Use the results of your calculations to plot the difference between the approximate solution and the true solution at t 2 s as a function of time step size. What general effect does increasing the step size have on the solution?
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