For the following first order ODE, dy dt = y + t for t= 0 to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
For the following first order ODE, dy dt = y + t for t= 0 to t = 1.5 with the initial value of y(0) = 1. This ODE has the analytical solution, y = 7et t-3t-6t-6 Write a MATLAB script to do the following, (a) (4m) Use the function odeEuler to solve using the first order Euler explicit method using h = 0.5. (b) (4m) Write a MATLAB function called odeMidPoint to solve the ODE using the second order mid-point method using h = 0.5. Call this function from your script to solve the ODE. (c) (1m) Use the function odeRK4 to solve using the classical fourth-order Runge-Kutta method using h = 0.5. (d) (3m) Plot the four solutions on a single annotated graph using different markers/colours for the different solutions. (e) (3m) For each method, calculate the mean relative error and the approximate number of accurate digits. For the following first order ODE, dy dt = y + t for t= 0 to t = 1.5 with the initial value of y(0) = 1. This ODE has the analytical solution, y = 7et t-3t-6t-6 Write a MATLAB script to do the following, (a) (4m) Use the function odeEuler to solve using the first order Euler explicit method using h = 0.5. (b) (4m) Write a MATLAB function called odeMidPoint to solve the ODE using the second order mid-point method using h = 0.5. Call this function from your script to solve the ODE. (c) (1m) Use the function odeRK4 to solve using the classical fourth-order Runge-Kutta method using h = 0.5. (d) (3m) Plot the four solutions on a single annotated graph using different markers/colours for the different solutions. (e) (3m) For each method, calculate the mean relative error and the approximate number of accurate digits.
Expert Answer:
Answer rating: 100% (QA)
Given below are the codes and screenshots of the for the functions odeEuler odeMidPoint odeRK4 function ty odeEulerfIy0h ODEEULER Computes the solutio... View the full answer
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these computer network questions
-
Assuming Ant has fully met the regulator's needs, how would this affect the IPO value? Also re-evaluate the new value.
-
A business starts this year with P1,000,000 assets with no debt. The expected ROE equals 10%. Suppose the firm decides to have a payout of 40% for this year. How much is the expected total dividends...
-
(a) Which is a better measure of risk, standard deviation or semi-standard deviation? (b) Under what conditions would standard deviation and semi-standard deviation be equally good measures of risk?...
-
Discuss what you see as the role of ethics as it pertains to management and managers. Does management, in your view, help shape the values and ethics of an organization? What about an organization's...
-
1. Write each statement in logarithmic form. (a) 2x = y (b) 3y = 2x 2 Write each statement in exponential form. (a) log7 (1/49) = - 2 (b) log4 x = -1
-
Daniel Company uses a periodic inventory system. Data for 2015: beginning merchandise inventory (December 31, 2014), 2,000 units at $38; purchases, 8,000 units at $40; expenses (excluding income...
-
Victor Pimentel, purchasing manager of Office Supply Center of Mexico, is searching for a new supplier for its paper. The most important supplier criteria for Victor include paper quality, delivery...
-
1. Why did the round-trip transactions engaged in by Krispy Kreme and its franchisees violate revenue recognition rules? How should they have been recorded under GAAP? 2. Evaluate the corporate...
-
What are the roots of the equation x^(2)-2x+2=0 in simplest a+bi form?
-
Quinn Inc. is preparing its annual budgets for the year ending December 31, 2012. Accounting assistants provide the following data: An accounting assistant has prepared the detailed manufacturing...
-
Given an advanced sinusoidal wave to the left of the string, with an amplitude of 1.4 cm, a wavelength of 40 cm and a frequency of 20 Hz. It is known that at time t = 0 at point 0 = x the copy is...
-
The net present value method assumes that future cash inflows are immediately reinvested at the required rate of return, while the internal rate of return method assumes that future cash inflows are...
-
What sensors are typically used to commutate six-step motors? Why are these sensors not used for sine-wave commutation?
-
An individual demand curve for pizza can be derived with the following: a. prices of pizza, one other good, and income b. price of pizza and two other goods c. income d. price of pizza
-
Which of the following requires that expenses should be matched and recognized in the same period as the related revenue? a. Cost principle b. Going concern assumption c. Matching principle d....
-
Suppose you are a manager and you have three potential capital investment projects from which to choose. Funds are limited, so you can only choose one of the three projects. Describe at least three...
-
A plumber charges a flat fee for each job, plus an hourly rate for the number of hours the job takes to complete. The total cost of the job, in dollars, car be modeled by the equation y= 50+ 65x....
-
Consider the activities undertaken by a medical clinic in your area. Required 1. Do you consider a job order cost accounting system appropriate for the clinic? 2. Identify as many factors as possible...
-
What is the value of k at the end of this function? function k = probleml_34 1 2 stop_loop = 2; 3 k = 0; 4 while stop_loop > 1 5 k k+1; 6 stop_loop = 7 end stop_loop 0.25;
-
Use Cramers rule to compute the solution to the system of equations 2x+y=z=1 -x+ 2z = 4 4x - 2y + 3z0
-
Consider some matrix A. After using Gauss elimination with three partial pivoting steps, you obtain the upper triangular matrix What is the determinant of the original matrix A? U= 16 3 5 4 2 0 1 3 5...
-
Document the CRC card for the temptation EBT.
-
What are the classes and patterns involved in defining the stable pattern for temptation?
-
Is the temptation pattern incomplete without the use of other patterns? Explain briefly.
Study smarter with the SolutionInn App