Question

in python, encode eulers method for the ivp y’ = y where y(0)=1. set step to...

in python, encode eulers method for the ivp y’ = y where y(0)=1. set step to be .1

Homework Answers

Answer #1

The above code can be used to solve the Initial Value Problem using Euler's method. The code takes a value of x as input and computes the value of y(x) for that value.

The code is:

x=float(raw_input("Enter value of x:"))
x0=0
y=1
while x0<x:
y=1.1*y #since the step is 0.1 we get y+h*f to be 1.1*y
x0=x0+0.1
print "The solution is", y

The following are some test outputs.

Know the answer?
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
Similar Questions
Solve the IVP using the Eigenvalue method. x'=2x-3y+1 y'=x-2y+1 x(0)=0 y(0)=1 x'=2x-3y+1 y'=x-2y+1 x(0)=0 y(0)=1 Solve...
Solve the IVP using the Eigenvalue method. x'=2x-3y+1 y'=x-2y+1 x(0)=0 y(0)=1 x'=2x-3y+1 y'=x-2y+1 x(0)=0 y(0)=1 Solve the IVP using the Eigenvalue method. x'=2x-3y+1 y'=x-2y+1 x(0)=0 y(0)=1
Use the method of Laplace Transforms to solve the following IVP. x'+y'=x-y; x(0)=1 x'-y'=x-y; y(0)=0
Use the method of Laplace Transforms to solve the following IVP. x'+y'=x-y; x(0)=1 x'-y'=x-y; y(0)=0
(1) Consider the IVP y' 0 = y, y(0) = −1. (a) Estimate the solution using...
(1) Consider the IVP y' 0 = y, y(0) = −1. (a) Estimate the solution using Euler’s method with n = 2 divisions over the interval [0, 1]. (b) Carefully compare your approximation graphically to the actual solution values.
dy/dx = x^4/y^2 initial condition y(1)= 1 a) use eulers method to approximate the solution at...
dy/dx = x^4/y^2 initial condition y(1)= 1 a) use eulers method to approximate the solution at x=1.6 and a step size od delta x = 0.2 b) solve the differential equation exactly using seperation variabled and the intial condtion y(1)=1. c) what is the exact value of y(1.6) for your solution from part b.
The IVP y′ = 2t(y − 1), y(0) = 0 has values as follows: y(0.1) =...
The IVP y′ = 2t(y − 1), y(0) = 0 has values as follows: y(0.1) = −0.01005017, y(0.2) = −0.04081077, y(0.4) = −0.09417427. Using the Adams-Moulton method of order 4, compute y(0.4).
solve y''+4y'+4y=0 y(0)=1, y'(0)=4 IVP
solve y''+4y'+4y=0 y(0)=1, y'(0)=4 IVP
Solve IVP and graph y''−y'−12y=0, y(0)=−4, y'(0)=1
Solve IVP and graph y''−y'−12y=0, y(0)=−4, y'(0)=1
Use the Laplace transform to solve the following IVP y′′ +2y′ +2y=δ(t−5) ,y(0)=1,y′(0)=2, where δ(t) is...
Use the Laplace transform to solve the following IVP y′′ +2y′ +2y=δ(t−5) ,y(0)=1,y′(0)=2, where δ(t) is the Dirac delta function.
y''+2y(y')^3=0 ; y(0)=1, y'(0)=1 use u=y' to solve IVP
y''+2y(y')^3=0 ; y(0)=1, y'(0)=1 use u=y' to solve IVP
Consider the following Initial Value Problem (IVP) y' = 2xy, y(0) = 1. Does the IVP...
Consider the following Initial Value Problem (IVP) y' = 2xy, y(0) = 1. Does the IVP exists unique solution? Why? If it does, find the solution by Picard iteration with y0(x) = 1.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT