- #1
Larsson
- 28
- 0
Consider the differential equation y' = lambda(y-sin(x)) + cos(x) and it's general solution y(x) = (y(x_0)- sin(x_0)) * exp(lambda(x-x_0)) + sin(x)
Determine the stability condition (derive the amplification factor) for Heuns method (improved euler). What would be a suitable step size for heuns method such that the method is stable sith lambda = -1000
Heuns method is the following if I haven't missunderstood it:
k_1 = f(x_n , y_n)
k_2 = f(x_(n+1) , y_n + h*k_1)
f(x_n,y_n) = y'
y_(n+1) = y_n + h/2(k_1 + k_2)
the correct answear should be
y_(n+1) = y_n + h/2(lambda*y_n + lambda(y_n + h*lambda*y_n))
but when I calculate k_2 I get
k_2 = k_2 = lambda(y_n + h(L(y-sin(x))+cos(x)) - sin(x+h)) + cos(x+h)
and there clearly something is wrong because the real answear doesn't contain any x+h. So... Where do I go wrong?
I mean when I calculate k_2, isn't the only thing I should do to calculate y'(x = x+h, y = y_n + h*k_1) ?
Determine the stability condition (derive the amplification factor) for Heuns method (improved euler). What would be a suitable step size for heuns method such that the method is stable sith lambda = -1000
Heuns method is the following if I haven't missunderstood it:
k_1 = f(x_n , y_n)
k_2 = f(x_(n+1) , y_n + h*k_1)
f(x_n,y_n) = y'
y_(n+1) = y_n + h/2(k_1 + k_2)
the correct answear should be
y_(n+1) = y_n + h/2(lambda*y_n + lambda(y_n + h*lambda*y_n))
but when I calculate k_2 I get
k_2 = k_2 = lambda(y_n + h(L(y-sin(x))+cos(x)) - sin(x+h)) + cos(x+h)
and there clearly something is wrong because the real answear doesn't contain any x+h. So... Where do I go wrong?
I mean when I calculate k_2, isn't the only thing I should do to calculate y'(x = x+h, y = y_n + h*k_1) ?