Hints for Assignment 4 (AMSC/CMSC460, Fall 2018)

Hint for Problem 2: In Matlab v is a vector with 19 entries v(1),...,v(19). You have to write an m-file f.m which starts with function y = f(v) and which returns a vector y with 19 entries y(1),...,y(19). Use a for loop in Matlab.
Note that \(v_0=0\) and \(v_{20}=0\). Therefore we have
   y(1) =         ( 2*v(1) - v(2) )/h^2 - F*sin(v(1))
   y(2) = ( -v(1) + 2*v(2) - v(3) )/h^2 - F*sin(v(2))
etc. . Note that the equations for y(1) and y(19) are different.