%% %% This is file `pendrun.m', %% generated with the docstrip utility. %% %% The original source files were: %% %% dae.dtx (with options: `pendrun') %% %% (c) Tony Roberts, v1.0b, 16 May 2000, aroberts@usq.edu.au %% Permission is hereby granted, free of charge, to any person to copy %% this software and associated documentation files. But under no %% circumstances is it to be modified. This copyright and permission %% notice shall be included in all copies or substantial portions of the %% Software. %% %% Execute to run the differential algebraic equation solvers %% on the 5 equation model for the dynamics of a pendulum: %% dx/dt=u %% dy/dt=v %% du/dt=-x*s %% dv/dt=-y*s+1 %% 0=x^2+y^2-1 %% where (x,y) is the location of the bob, (u,v) is its velocity %% and s is proportional to tension in the wire of the pendulum. %% Uses penddae.m for the coded DAEs, pendg.m for some graphics, %% dae4o.m, dae4.m or dae2.m to do the integration. format compact; w0=[1;0;0;0;0]; ts=linspace(0,16,81); w=dae2('penddae',ts,w0,2,'pendg'); %%w=dae4('penddae',ts,w0,1,'pendg'); %%w=dae4o('penddae',ts,w0,1,'pendg'); plot(ts,w); legend(' x',' y',' u',' v',' s') xlabel(' t') %% %% %% End of file `pendrun.m'.