Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!