% A helpful worksheet for Exercise 3.4.1.
% Here is the data for Exercise 3.4.1:

tvals = [0.1 0.6 1.1 1.4];
yvals = [0.11 0.5 0.6 0.5];

% A quick plot of (time, distance) pairs:

scatter(tvals,yvals)

% To fit a function u(a,t) = a*t to this data by adjusting "a", define

syms u(a,t);
u(a,t) = a*t;
syms SS(a)
SS(a) = sum((u(tvals,a)-yvals).^2);

% Then minimize the resulting expression SS as a function of a.
% For parts b, c, and d, do the same but with appropriate modifications to u.
%