Differential Equations Question Find approximate values of the solution of the given initial value problem at t=0.1,0.2,0.3,0.4 using the Euler method with h=0.1 Find the solution \(y=\phi(t)\) of the given problem and evaluate \(\phi(t)\) at t=0.1,0.2,0.3 and 0.4 \(y\prime = 3\cos(t)-2y\)
\[\Large y' = 3\cos(t) - y\]
Well, let's work on the hard part first, actually solving this this differential equation... or have you already done that?
-2y*
Whoopsie \[\Large y' = 3\cos(t) - 2y\] So HAVE you solved this? :D
\(\dfrac{dy}{dt}=3\cos(t)-2y\) \(dy=(3\cos(t)-2y)dt\) \(\int dy=\int (3\cos(t)-2y)dt\) Correct so far?
uhh.. no.... there's a y-term in the right-side... one does not simply integrate that with respect to t...
Well, I am drawing a blank then..... :/
this looks like another one of them differentials that need integrating factors...
\[\Large y' + 2y = 3\cos(t)\]
Integrating factor would be \[\LARGE e^{\int2dt}\]
\(\Large{\mu(t)=e^{2t}}\) \(\Large{e^{2t}y^{\prime}}+2e^{2t}y=e^{2t}3\cos(t)\) Look ok so far?
Yup :)
Left side is \[\Large d(e^{2t}y)= 3e^{2t}\cos(t)dt\]
I'll leave you to do the horrid integration.. :3
Gimme a minute......
<starts stopwatch>
\(\Large{y=\dfrac{3(\cos(t)+\sin(t))}{5}}\)
Alright, so we have solved this lovely little differential equation. What now?
You forgot the constant :3
I am looking at an example, and they aren't showing a constant..... Oh well. \(\Large{y=\dfrac{3(\cos(t)+\sin(t))}{5}+C}\)
Crud... I meant \[\Large y e^{2t}= \frac{3\color{red}{e^{2t}}[\cos(t)+ \sin(t)]}{5}+C\]
Wait a sec... rewind... could you redo that integration? Wolfie doesn't agree with you...
\[\Large d(e^{2t}y)= 3e^{2t}\cos(t)dt\]
I made a typo, but it does agree, \(\color{blue}{2\cos(t)}\)*
Okay, so we have this, aye? \[\Large y e^{2t}= \frac{3\color{}{e^{2t}}[2\cos(t)+ \sin(t)]}{5}+C\]
Now, you had an initial condition?
\(y(0)=0\) Most interesting initial condition ever.
Oh duh, plug that bad boy in and solve or C yeah?
Yup :D
Don't lament y(0) = 0 as an initial condition... it usually simplifies a lot of things XD
\(\Large{ye^{2t}=3e^{2t}\dfrac{[2cos(t)+sin(t)]}{5}-\dfrac{6}{5}}\)
Okay... so more on those later.. I'll let you worry about checking about individual points t = 0.1 and so on... do we proceed to using Euler's method?
Umm..... honestly? I have no clue. I am looking at the example and it make no sense.
What makes no sense? Euler's Method?
Yeah, this text book and how it is written makes no sense. It kinda jumps around a lot.
Okay, well, it's already well set-up for Euler's method... Let's look at the original statement of the problem \[\Large y' = 3\cos(t) - 2y\]
\[\Large y'(t) = f(t,y(t))\] right?
Namely, that the derivative of y with respect to t is a function of t and y. Catch me so far?
I follow me thinks. :)
Okay, first we select a step-size, h. The smaller, the more accurate. The choices of t being 0.1, 0.2, 0.3, 0.4 seem to imply that we're to choose a step-size of 0.1. You okay with that, or you want 0.05 for more accuracy?
Or is accuracy not an issue and/or you are specifically instructed to use a step size of h = 0.1?
Find approximate values of the solution of the given initial value problem at t=0.1,0.2,0.3,0.4 using the Euler method with \(\color{blue}{h=0.1}\) I am guessing that I am supposed to use that.
Okay, well, simpler that way, anyway :)
So, this is the heart and soul of the Euler method: \[\Large y_{n+1} =y_n + hf(t_n,y_n) \]does that look daunting? :D
Since the step size is h = 0.1, then we have \[\Large \left.\begin{matrix}t_0 &0\\t_1&0.1\\t_2&0.2\\t_3&0.3\\t_4&0.4\end{matrix}\right.\]
So, ready to begin?
@austinL don't worry, it's a lot easier than it makes itself out to be... so... do we proceed? :D
Yes, sorry. I went and made some coffee! :D Yep, good to go.
Okay, we want to know the approximation for \(\large y_1\) so, we plug in :) \[\Large y_{n+1} =y_n + hf(t_n,y_n)\] \[\Large y_{1} =y_0 + hf(t_0,y_0)\]Got it?
Yep. :)
This is pretty much the only time where you actually *need* that initial condition. But it's pretty darn important, as without it, you don't have a place to start XD So you know that y(0) = 0 that means \[\Large y_0 =0\]\[\Large t_0=0\] Now solve for \(\large y_1\)
You also might want to have a calculator handy
\(y_1=y_0+hf(t_0,y_0)=0+(0.1)(3cos(0)-2(0))=0.1\) ?
As I recall... 3cos(0) = 3...
Oh duh... silly error. 0.3
2*0=0 Austin, get it together.
Okay, great :D Now you have \(\large y_1\) which is an approximation for \(\large y(t_1)=y(0.1)\) Great:D
Can you predict the next step? Work on \(\large y_2\) \[\Large y_{2} =y_1 + hf(t_1,y_1)\]
Note that it's y1 and t1 now, since you now know the value of y1.
Would it be 0.238501?
I.... hang on :D
How did you do this?
\(t_1=0.1,~~y_1=0.3,~~h=0.1\) Plug it in?
I get 0.658 something
\(\Large{y_2=0.3+(0.1)(3\cos(0.1)-2(0.3))}\) I just got a different answer, but is this the correct format?
Should be.
hang on again...
I definitely get 0.6585 something try it again.
I get 0.538501 What am I doing wrong D:
Ok, what the deuce...
I really don't know...
that is... why you're not getting it... why don't you list down your steps here, one at a time
For the next term I have, 1.08423
Sorry, what? You used y1 = 0.658something?
And yes, that's right :)
Yep, y2=0.658501
So you finally got it then? :D
I do believe so! Thanks very much!
You have y1, y2, y3 all down. finish it off with y4
@austinL hey don't leave me hanging, buddy D:
I am just finishing up. \(t=~~~~~~~h=0.1\) \(0.0~~~~~~~~~0.3\\ 0.1~~~~~~~~~0.658501\\ 0.2~~~~~~~~~1.08423\\ 0.3~~~~~~~~~1.58768\\ 0.4~~~~~~~~~2.18153\)
a bit off...
2.18153... is actually y5 (or when t = 0.5)
Don't need t=0.5
Earth to austin... when t = 0, y should be also be 0 Like... you know, your initial value? XD
Adjusting... \[0.1~~~~~~~~~0.3\\ 0.2~~~~~~~~~0.658501\\ 0.3~~~~~~~~~1.08423\\ 0.4~~~~~~~~~1.58768\\ 0.4~~~~~~~~~2.18153\]
omfg.... *facepalm*
Good thing I asked for a confirm. But you've pretty much gotten the Euler method down again, right? :D
Yeah, I feel much better about it :)
Whoops... \[0.1~~~~~~~~~0.3\\ 0.2~~~~~~~~~0.658501\\ 0.3~~~~~~~~~1.08423\\ 0.4~~~~~~~~~1.58768\\ \color{red}{0.5}~~~~~~~~~2.18153\\TJ ~~~~~~~~~awsum \ \text{^_^ }\]
Thank you very very very much!!!
No problem... now time for me to catch some sleep :) Nighty night ^_^ ----------------------------- Terence out
Nighty night!
Join our real-time social learning platform and learn together with your friends!