====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
gibson:teaching:fall-2012:math445:pf1-solns [2012/12/11 14:21] gibson |
gibson:teaching:fall-2012:math445:pf1-solns [2012/12/11 14:22] (current) gibson |
||
---|---|---|---|
Line 239: | Line 239: | ||
from the initial conditions $x(0) = [y(0), ~v_y(0)] = [0, 0]$. | from the initial conditions $x(0) = [y(0), ~v_y(0)] = [0, 0]$. | ||
+ | <code> | ||
g = 9.81; | g = 9.81; | ||
mu = 0.35; | mu = 0.35; | ||
Line 244: | Line 245: | ||
[t, X] = ode45(f, 0:100, [0 ; 0]); | [t, X] = ode45(f, 0:100, [0 ; 0]); | ||
+ | </code> | ||
Line 277: | Line 278: | ||
of A. | of A. | ||
+ | <code> | ||
function y = sparse_matvec_mult(A,x) | function y = sparse_matvec_mult(A,x) | ||
K = nnz(A); | K = nnz(A); | ||
Line 288: | Line 290: | ||
end | end | ||
end | end | ||
+ | </code> |