Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added hw2 work
  • Loading branch information
rcc02007 committed Mar 28, 2018
1 parent 53bf5d8 commit f7c244d
Show file tree
Hide file tree
Showing 13 changed files with 235,189 additions and 513 deletions.
182,148 changes: 182,148 additions & 0 deletions HW_1_plotting.ipynb

Large diffs are not rendered by default.

1,496 changes: 1,496 additions & 0 deletions hw2_work/.ipynb_checkpoints/hw2_work-checkpoint.ipynb

Large diffs are not rendered by default.

Binary file added hw2_work/figures/f3-6.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hw2_work/figures/pend_anim.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hw2_work/figures/roller_coaster.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hw2_work/figures/rotating_pendulum.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hw2_work/figures/spring-mass.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,496 changes: 1,496 additions & 0 deletions hw2_work/hw2_work.ipynb

Large diffs are not rendered by default.

Binary file added hw2_work/octave-workspace
Binary file not shown.
18 changes: 18 additions & 0 deletions hw2_work/ode3.m
@@ -0,0 +1,18 @@
function dr=ode3(t,r,l,k,m)
% first order ODE for pendulum attached to 2 springs
% l is pendulum length
% k is spring stiffness of one spring
% m is mass of pendulum bob
g=9.81;
dr=zeros(size(r));
dr(1)=r(2); % dtheta/dt=dtheta/dt
dr(3)=r(4); % dy/dt=dy/dt
if abs(r(1))<=0.2
dr(2)=-2*k*g/(2*k*l+m*g)*r(1);
dr(4)=-2*k/m*r(3);
else
ddy=1/l*1/sin(r(1))^2*[1 -cos(r(1));-l*cos(r(1)) l]*[-g*sin(r(1));-2*k/m*r(3)];
dr(2)=ddy(1);
dr(4)=ddy(2);
end

10 changes: 10 additions & 0 deletions hw2_work/ode4.m
@@ -0,0 +1,10 @@
function dr=ode4(t,r,k,m)
% first order ODEs for two masses attached by a linear spring
% k is spring stiffness (assume le=0)
% m is mass of each
dr=zeros(size(r));
dr(1)=r(2);
dr(3)=r(4);
dr(2)=r(1).*r(4).^2-2*k/m*r(1);
dr(4)=-2*r(2).*r(4)./(r(1));
end
50,534 changes: 50,021 additions & 513 deletions intro_to_numerical_integration.ipynb

Large diffs are not rendered by default.

Binary file modified octave-workspace
Binary file not shown.

0 comments on commit f7c244d

Please sign in to comment.