Homework #10
Due: April 14, 2025
Problem 1. Solve the following differential equation

y′ = − x2 y,     y(0) = 1,
by:

    (a) Exactly (analytically).
    (b) Euler's method.
    (c) Runge-Kutta method.
and plot the three results in a single graph. Use 0 ≤ x ≤ 1 and h = 0.1.
Use the following syntax:
plot [0:1] "data1.txt" with line, "data2.txt" w l, sin(x)
where "data1.txt" contains data from the Euler method and "data2.txt" contains data from the R-K method.


Problem 2. Numerically solve the following differential equations using the Euler method
du

dt
=
v
(1)
dv

dt
=
k vu3 + B cos t,
(2)
with
k = 0.1,     B = 11.0,
and plot the result using gnuplot. Change the parameters to
k = 0.4,     B = 20.0
and show the graph as well. You can use the initial condition as
u(0) = 1,     v(0) = 1.
Also, use
h = 0.01,     i = 10000.



File translated from TEX by TTH, version 4.03.
On 08 Apr 2025, 21:30.