%% ================================================================ Why? \begin{center} \emph{ The soul cannot think without a picture. } --- Aristotle\index{Aristotle} (384-322 B.C.). \end{center} %% ================================================================ Level curve problem (J01.3): URL for gtqp Scroll through the document & show them the math & the figure. Claim that it's nice to be able to see what's going on. %% ================================================================ 1D meshgrid dx = 0.1 x = [0, dx, 10]; y = sin(x); y = sin(x) + cos(x); plot(x,y) y = sin(x) .* cos(x); plot(x,y) %% ---------------------------------------------------------------- y = sin(x); plot(x, y, 'LineWidth', 2); yp = gradient(y, dx); hold on plot(x, y, 'LineWidth', 1); How would you numerically estimate a derivative? * Forward difference: [f(x+h) - f(x) ] / h * Backward differences: [f(x) - f(x-h)] / h * Centered differences: [f(x+h) - f(x-h)] / 2h Matlab does: * forward differences on the left edge, * backward differences on the right edge, * centered differences in the middle. x = [1:5] y = x.^2 gradient(y,1) %% ================================================================ 2D meshgrid [x, y] = meshgrid(1:4, 5:9) z = x+y z = x.^2 .* y [dzdx, dzdy] = gradient(z, 1, 1) To fit on the screen: [x,y] z [dzdx,dzdy] %% ---------------------------------------------------------------- Slices x(1,:) = 77 x(:,2) = 999 %% ================================================================ Surfaces embedded in R^3 Show them the top of gdgproj.m Run gdgproj hyp1 Show them hyp1setup.m %% ---------------------------------------------------------------- Dx/Ds et al. %% ---------------------------------------------------------------- quiver3 plots: foot triple and vector triple