Hello!
A Problem from a book on computer simulation methods that I am working through:
It's been almost 7 years (yikes!) since I took calc I and II, and now I've returned to finish my CS Degree...
How do I go about setting this up? I am thinking:
Let \(\displaystyle y' = 2x\)
Let \(\displaystyle h = \Delta x\) step sizes from above, and then...
\(\displaystyle y_{n} = y_{n-1} + h*F(x_{n-1})\)
\(\displaystyle y_1 = 0 + 0.1(2(0+0.1))\)
\(\displaystyle y_2 = y_1 + 0.05(2(0+0.1+0.025)) = 0.1(2(0+0.1)) + 0.05(2(0+0.1+0.025)) \)
...
And so forth. How far off am I?
Thank you!
A Problem from a book on computer simulation methods that I am working through:
Use the Euler Algorithm to compute the numerical solution of \(\displaystyle \frac{dy}{dx} = 2x\) with \(\displaystyle y = 0\) at \(\displaystyle x = 0\) and \(\displaystyle \Delta x = 0.1, 0.05, 0.025, 0.01, 0.005\)
It's been almost 7 years (yikes!) since I took calc I and II, and now I've returned to finish my CS Degree...
How do I go about setting this up? I am thinking:
Let \(\displaystyle y' = 2x\)
Let \(\displaystyle h = \Delta x\) step sizes from above, and then...
\(\displaystyle y_{n} = y_{n-1} + h*F(x_{n-1})\)
\(\displaystyle y_1 = 0 + 0.1(2(0+0.1))\)
\(\displaystyle y_2 = y_1 + 0.05(2(0+0.1+0.025)) = 0.1(2(0+0.1)) + 0.05(2(0+0.1+0.025)) \)
...
And so forth. How far off am I?
Thank you!
Last edited: