تم الحل ✓
categoryرياضيات
schoolبكالوريوس
event_available2026-07-13
السؤال
Transcribed Image Text:
2. Given the initial conditions, y(0) = 1 and y'(0) = 0, solve the following initial-value
problem from t = 0 to 4:
d²y
dt²+4y=0
Obtain your solution with (a) Euler's method and (b) fourth-order RK method. In
both cases, use a step size of 0.1. Plot both solutions on the same graph along with the
exact solution y = cos 2t.
Hints: (this problem will be discussed on 12/6 during class)
The given second-order Ordinary Differential Equation (ODE) can be transformed into
two first-order ODEs:
dy
dt
dz
-4y
dt
Thus, they can be solved simultaneously by methods such as Euler's method or fourth-
order RK method for solution.
Please compute for the first two time steps by hand calculation and complete the
remaining time steps by using commands computation or a script written by you in
MATLAB to aid in your computation. You are not to use the pre-written MATLAB
functions such as ode23, ode45 etc. for solution. Please plot the results by all methods in
one graph.
More hints:
While you are not to use pre-written MATLAB functions such as ode23, ode45 etc., it is
acceptable to use function eulode (Figure 22.3 on page 560 of the textbook) and function
rk4sys (Figure 22.8 on page 576 of the textbook) to aid in your computation for the
remaining time steps.
check_circle الجواب — حل مفصل خطوة بخطوة
hourglass_top
🔒
الحل الكامل متاح للمشتركين
اشترك في أرشيف الأسئلة لعرض هذا الحل وآلاف الحلول المفصلة خطوة بخطوة من معلمين معتمدين.