September 20, 2017, Wednesday
University of Colorado at Boulder Search A to Z Campus Map University of Colorado at Boulder CU 
Search Links


From MathBio

Jump to: navigation, search


Fourplots.m is a script used to solve the differential equations from twoeqns.m. The following code plotted the x and y position vs time (figures 1 and 2), as well as the x and y velocity over time (figures 3 and 4). That last 2 figures that would be plotted correspond to x vs y position and the displacement length over time respectively.

[t,x]=ode15s(@twoeqns,[0 .01], [1e-5 0 2e-3 0 2e-3]);
plot(t, x(:, 1));
%axis([0 .0035 0 100])
xlabel('time (s)');
ylabel('x position (mm)');
title('aorta: x position vs. time');
plot(t, x(:, 3));
%axis([0 .0035 0 2.1e-3])
xlabel('time (s)');
ylabel('y position (mm)');
title('aorta: y position vs. time');
plot(t, x(:, 2));
%axis([0 .0045 0 1e7])
xlabel('time (s)');
ylabel('x velocity (mm/s)');
title('aorta: x velocity vs. time');
plot(t, x(:, 4));
%axis([0 .0035 -1 0])
xlabel('time (s)');
ylabel('y velocity (mm/s)');
title('aorta: y velocity vs. time');
plot(x(:, 1), x(:, 3));
% axis([0 25 0 2e-3])
xlabel('x position (mm)');
ylabel('y position(mm)');
title('aorta: y position vs. x position');
plot(t, x(:, 5));
xlabel('time (s)');
ylabel('displacement length (mm)');
title('radius vs. time');