function trapezoidalODE(positions, velocities, firstOrder, dt, nSteps, edges)

f = figure;

% Want to solve dx/dt = firstOrder * x
x = [positions ; velocities];
n = size(positions,1);

for i=1:nSteps
    % TODO:  Step x forward in time here!
    x = inv(eye(2 * n) - dt * firstOrder / 2) * (eye(2 * n) + dt * firstOrder / 2) * x;
    
    positions = x(1:n,:);
    plotGraph(positions,edges,f);
    title(sprintf('Trapezoidal step %d',i));
    drawnow;
end
Doraemonzzz
github-repos/MATLAB/Doraemonzzz-CS205A-Mathematical-Methods-for-Robotics--Vision--and-Graphics/CS205A-Mathematical-Methods-for-Robotics--Vision--and-Graphics-47f3aba77a5233cde2292ac944a9e0f5ee20a4bc/作业/hw8/code/trapezoidalODE.m
CS205A-Mathematical-Methods-for-Robotics--Vision--and-Graphics
github-repos/MATLAB/Doraemonzzz-CS205A-Mathematical-Methods-for-Robotics--Vision--and-Graphics
47f3aba77a5233cde2292ac944a9e0f5ee20a4bc