PHYS 220 — HW #3
This assignment is due at the beginning of lecture on
Monday, 16 Feb.
In lecture we've shown how an nth-order
ode can be recast as a system of n 1st-order ode.
In these 4 problems, you'll be translating the ode given into
a single line of MATLAB code. I'll give an example first:
- The 2nd-order
ode d²x/dt² = -ω²x for a simple harmonic oscillator
- can be recast as dx/dt = v and dv/dt = -ω²x
- a MATLAB vector can then be constructed to represent the
variables, figuratively,
as y = [ x ; v ]
- and the ode can be written, literally, in MATLAB
as dydx
= [ y(2)
; -omega^2 * y(1) ];
For each of the ode below, write both the figurative construction of y
= [ ... ], and the literal line of MATLAB code corresponding
to dydx = [ ... ]. (In essence, you're
writing the function that the function handle deriv will
point to.)
- In simulating a bicyclist capable of constant power output P, we
find dv/dt = F/m, with Fb = P/v & Fdrag = -av -
bv². (This is a 1st-order ode problem, so do not
assume F =
md²x/dt².)
- A damped, non-linear simple pendulum has an equation of motion
d²θ/dt² = -Ω² sin θ - q dθ/dt.
- For a mass m in free fall without air resistance near the surface
of a planet, we find Fx = 0 & Fy = -mg. (Here
you do need to recognize that this is a system of 2nd-order
ode.)
- In projectile motion, one might find equations of
motion for the projectile as Fx = -mbvvx &
Fy = -mg -mbvvy. (Here v is the magnitude of the
velocity vector and vi are its components.)