This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| 
                    gibson:teaching:spring-2016:math445:lecture:timestepping [2016/04/14 18:21] gibson [Problem 1]  | 
                
                    gibson:teaching:spring-2016:math445:lecture:timestepping [2016/04/14 18:23] (current) gibson [Problem 4]  | 
            ||
|---|---|---|---|
| Line 172: | Line 172: | ||
| x0 = [-2.8; y]; % set initial position of particle | x0 = [-2.8; y]; % set initial position of particle | ||
| - | [t, x] = ode45(@v, [0 T], x0); % compute x(t) at given values of t | + | [t, x] = ode45(@v, [0 T], x0); % compute x(t) over range 0 <= t <= T | 
| plot(x(:,1), x(:,2), 'r-');  % plot the path | plot(x(:,1), x(:,2), 'r-');  % plot the path | ||