Ask your own question, for FREE!
Differential Equations 20 Online
OpenStudy (anonymous):

Need help. Only intelligent people. Anyone good with Matlab??

OpenStudy (anonymous):

what type of math

OpenStudy (anonymous):

Consider the initial value problem dy dt = cos(t)y(t) + cos(t) y(0) = 1 a.) Give the solution to the initial value problem. b.) Find a time step h that would evenly divide the interval [0; 2] into N subintervals and guarantee a local truncation error of at most 0.01 for the Euler method on the same interval. Use this time step to apply the Euler method and the Improved Euler method to this initial value problem over the interval [0; 2] and plot the actual solution along with the two approximated solutions.

OpenStudy (anonymous):

lolol

OpenStudy (anonymous):

math like this is horrible and not really useful...

OpenStudy (anonymous):

Intervals are [0. 2*pi]

OpenStudy (loser66):

is it the first ODE?

OpenStudy (anonymous):

yes

terenzreignz (terenzreignz):

Well... \[\Large \frac{dy}{dt} = \cos(t)y(t) + \cos(t)\] right?

terenzreignz (terenzreignz):

In that case, this equation is separable: \[\Large \frac{\color{blue}{dy}}{\color{red}{dt}}=(y+1)\cos(t)\]

terenzreignz (terenzreignz):

\[\Large \frac{\color{blue}{dy}}{y+1}= \cos(t) \color{red}{dt}\]and then integrate both sides:

OpenStudy (unklerhaukus):

the question looking for a numerical method

OpenStudy (unklerhaukus):

the forward euler scheme for \[\large \frac{dy}{dx}=f(x,y),\qquad y(0)=y_0\]is \[ \large\hat y_{j+1}=\hat y_j+hf(x_j,\hat y_j)\] where the step size is \( h\)

OpenStudy (unklerhaukus):

however the computer will prefer it if you set the initial value first \[\hat y_1=y_0\] then ``` for j=2:N ``` \[\large \large\hat y_{j}=\hat y_{j-1}+h f(x_{j-1},\hat y_{j-1})\] ``` end ```

OpenStudy (unklerhaukus):

the forward euler scheme for \[\large \frac{dy}{dx}=f(x,y),\qquad y(0)=y_0\]is \[ \large\hat y_{j+1}=\hat y_j+hf(x_j,\hat y_j)\] where the step size is \( h\)

OpenStudy (unklerhaukus):

``` function [] = DE (h) %% Parameters % t0 = 0; % min tM = 2; % max N ; % number of subintervals %% this should be a function of h,t,tMax % t ; % domain %% this should be a function t0,tMax,N % y0 = 1; % initial value %% Exact Values % y ; %% find the exact value using separation of variables, as terenzreignz started % %% Approx Values % yHat = zeros(1,N); % empty yHat yHat(1) = y0; % yHat(0) for j=2:N yHat(j) ; %% = yHat +h.*f(x_j-1,yHat_j-1) % end %% Graph % figure(2); clf; grid hold on plot(t, y, 'k') plot(t, yHat,'b') hold off clear ```

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!