Question

C++ Euler's method is a numerical method for generating a table of values (xi , yi)...

C++

Euler's method is a numerical method for generating a table of values (xi , yi) that approximate the solution of the differential equation y' = f(x,y) with boundary condition y(xo) = yo. The first entry in the table is the starting point (xo , yo.). Given the entry (xi , yi ), then entry (xi+1 , yi+1) is obtained using the formula xi+1 = xi + x and yi+1 = yi + xf(xi , yi ). Where h is the small value called step size. Use Euler's method to estimate the value of y when x = 2.5 for the solution of the differential equation y' = x + 3y/x with the boundary condition y(1) = 1. Take x = 0.1, the exact solution of this differential equation is y = 2x3- x2. Compare your approximation values with the exact value.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

int main0 nt a 3, b 8, c 5, d 3; int p &a func(a, b) func(c, d); cout<<c<<< d <endl; return 0; (a) If function func0 is as de

answered by: ANURANJAN SARSAM
Add a comment
Know the answer?
Add Answer to:
C++ Euler's method is a numerical method for generating a table of values (xi , yi)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • dont ans this question Euler's method is based on the fact that the tangent line gives...

    dont ans this question Euler's method is based on the fact that the tangent line gives a good local approximation for the function. But why restrict ourselves to linear approximants when higher degree polynomial approximants are available? For example, we can use the Taylor polynomial of degree about = No, which is defined by P.(x) = y(x) + y (xo)(x – Xa) + 21 (x- This polynomial is the nth partial sum of the Taylor series representation (te) (x –...

  • (1 point) Suppose that we use Euler's method to approximate the solution to the differential equation...

    (1 point) Suppose that we use Euler's method to approximate the solution to the differential equation dyr. dzvi y(0.4) = 9. Let f(x, y) = 25/y. We let Xo = 0.4 and yo = 9 and pick a step size h=0.2. Euler's method is the the following algorithm. From In and Yn, our approximations to the solution of the differential equation at the nth stage, we find the next stage by computing In+1 = xin + h Y n+1 =...

  • 、 | | xo = 0 Xi = 2 x2 = 4 f(x) = 2 f(x1)...

    、 | | xo = 0 Xi = 2 x2 = 4 f(x) = 2 f(x1) = 6 f(x2) – 10 Consider the differential equation dy – Ax+ 4 where A is a constant. dx Let y = f(x) be the particular solution to the differential equation with the initial condition f(0) = 2. Euler's method, starting at x = 0) with a step size of 2, is used to approximate f(4). Steps from this approximation are shown in the...

  • Runge-Kutta method R-K method is given by the following algorithm. o y(xo)- given k2-f(xi5.yi tk,...

    Runge-Kutta method R-K method is given by the following algorithm. Yo = y(xo) = given. k1-f(xy) k4-f(xi +h,yi + k3) 6 For i = 0, 1, 2, , n, where h = (b-a)/n. Consider the same IVP given in problem 2 and answer the following a) Write a MATLAB script file to find y(2) using h = 0.1 and call the file odeRK 19.m b) Generate the following table now using both ode Euler and odeRK19 only for h -0.01....

  • Write a function-function in MATLAB that use's Euler's Method to determine a numerical solution for a...

    Write a function-function in MATLAB that use's Euler's Method to determine a numerical solution for a 1st-order ordinary differential equation with one dependent variable using the following line where dt = time step t0 = initial time tf = final time y0 = dependent variable for initial value function [t, y) = EulerIdydt, dt, to, tf, yo] dydt = dydt(t, y)

  • 3. Euler's Method (a) Use Euler's Method with step size At = 1 to approximate values...

    3. Euler's Method (a) Use Euler's Method with step size At = 1 to approximate values of y(2),3(3), 3(1) for the function y(t) that is a solution to the initial value problem y = 12 - y(1) = 3 (b) Use Euler's Method with step size At = 1/2 to approximate y(6) for the function y(t) that is a solution to the initial value problem y = 4y (3) (c) Use Euler's Method with step size At = 1 to...

  • -1.2y 7e-03* from x tox 2.0 with the 2) Use Euler's method to solve the ODE...

    -1.2y 7e-03* from x tox 2.0 with the 2) Use Euler's method to solve the ODE initial condition y3 at x0 dx a) Solve by hand using h b) Write a MATLAB program in a script file that solves the equation using h-0.1 and find y(1.5). c) Use the program from part (b) to solve the equation using h= 0.01 and h = 0.001 and findy(1,5). 0.5 and find y(2). d) The exact solution to the IVP is given by...

  • Discretization, ODE solving, condition number. Consider the differential equation 5y"(x) - 2y'(x) +10y(x)0 on the interval x E [0,10] with boundary conditions y(0)2 and y (10) 3 we set up a f...

    Discretization, ODE solving, condition number. Consider the differential equation 5y"(x) - 2y'(x) +10y(x)0 on the interval x E [0,10] with boundary conditions y(0)2 and y (10) 3 we set up a finite difference scheme as follows. Divide [0,10] into N-10 sub-intervals, i.e. {xo, X1, [0,1,. 10. Denote xi Xo + ih (here, h- 1) and yi E y(x). Approximate the derivatives as follows X10- 2h we have the following equations representing the ODE at each point Xi ,i = 1,...

  • Use Euler's Method to make a table of values for the approximate solution of y2x +2y with initial...

    Use Euler's Method to make a table of values for the approximate solution of y2x +2y with initial condition y(0) 4. Determine the general and partie solution. Use five steps of size 0.10. Give the error in step four. Sketch both. Use Euler's Method to make a table of values for the approximate solution of y2x +2y with initial condition y(0) 4. Determine the general and partie solution. Use five steps of size 0.10. Give the error in step four....

  • Consider the following initial value problem у(0) — 0. у%3D х+ у, (i) Solve the differential equation above in tabul...

    Consider the following initial value problem у(0) — 0. у%3D х+ у, (i) Solve the differential equation above in tabular form with h= 0.2 to approximate the solution at x=1 by using Euler's method. Give your answer accurate to 4 decimal places. Given the exact solution of the differential equation above is y= e-x-1. Calculate (ii) all the error and percentage of relative error between the exact and the approximate y values for each of values in (i) 0.2 0.4...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT