Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added rotating pendulum
  • Loading branch information
rcc02007 committed Jan 31, 2018
1 parent f514f06 commit a85741e
Show file tree
Hide file tree
Showing 4 changed files with 349 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ch_03/pend_rot.m
@@ -0,0 +1,5 @@
function dy=pend_rot(t,y,l,w,a)
dy=zeros(size(y));
dy(1)=y(2);
dy(2)=-9.81/l*sin(y(1))+w^2*sin(y(1))*cos(y(1))+a*w^2/l*cos(y(1));
end
10 changes: 10 additions & 0 deletions ch_03/rotating_pendulum.m
@@ -0,0 +1,10 @@

l=0.3;
a=1;
w=10;

my_ode=@(t,y) pend_rot(t,y,l,w,a)

[t,y]=ode23(my_ode,[0 2],[pi/6,0]);

plot(t,y(:,1))
Binary file modified octave-workspace
Binary file not shown.

0 comments on commit a85741e

Please sign in to comment.