Example 08
set
GIVEN: A system of ODE's
REQUIRED: Solve and present graphically.
SOLUTION: Generate example08.m
A = [ -8/3 0 0; 0 -10 10; 0 28 -1];
y = [35 -10 -7]';
h = 0.01;
p = plot3(y(1),y(2),y(3),'o', ...
'EraseMode','none','MarkerSize',2);
axis([0 50 -25 25 -25 25])
hold on
for i=1:4000
A(1,3) = y(2);
A(3,1) = -y(2);
ydot = A*y;
y = y+ h*ydot;
set(p,'XData',y(1),'YData',y(2),'ZData',y(3))
drawnow
i = i+1;
end
Example
Please send questions or suggestions about this web page to beatnic@aset.psu.edu
ASET | ITS | Penn State
|