Solve the initial value problem related to H(x,y)=x^2+y^2−1=0 and (x_0,y_0)=(1,0), using the Euler method. The problems I've seen on the internet always give the y′ in terms of y and x so what I did first was tro try to find this y′ since I don't know it yet. By implicit differentiation I have that y′=−x/y

Silvina2b

Silvina2b

Open question

2022-08-16

Solve the initial value problem related to H ( x , y ) = x 2 + y 2 1 = 0 and ( x 0 , y 0 ) = ( 1 , 0 ), using the Euler method.
The problems I've seen on the internet always give the y in terms of y and x so what I did first was tro try to find this y since I don't know it yet.
By implicit differentiation I have that y = x / y
Now, If I set my h = 0.1 for example, you can see on the first iteration I'll have an undefined value:
x 0 = 1 , y 0 = 0
x 1 = x 0 + h = 1.01 , y 1 = y 0 + y ( x 0 , y 0 ) = 0 + 1 / 0 U N D E F I N E D
But I don't think this makes any sense, perhaps I differentiated incorrectly or this is just not the right way to go. I'd like someone to help me understand the very first step which is obtaining an ODE for a given function.

Answer & Explanation

Ezequiel Davidson

Ezequiel Davidson

Beginner2022-08-17Added 11 answers

I suggest another option, namely treat x and y as functions of the time t. From
x ( t ) 2 + y ( t ) 2 = 1
we obtain by differentiation with respect to t the equation
2 x ( t ) x ( t ) + 2 y ( t ) y ( t ) = 0.
This suggests to take
d d t [ x ( t ) y ( t ) ] = [ y ( t ) x ( t ) ] .
This is a system of ordinary differential equations
z ( t ) = f ( t , z ( t ) ) ,
where
z ( t ) = [ x ( t ) y ( t ) ] , f ( t , [ x y ] ) = [ y x ] .
The initial condition is
z 0 = z ( 0 ) = [ x ( 0 ) y ( 0 ) ] = [ x 0 y 0 ] = [ 1 0 ] .
Euler's method takes the form
z n + 1 = z n + h f ( t , z n )
or equivalently
[ x n + 1 y n + 1 ] = [ x n y n ] + h [ y n x n ] = [ x n h y n y n + h x n ] .

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?