Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
function totalPE = collar_potential_energy(x_C,theta)
% Solves the potential energy of a collar on a rod given initial position and angle.
% USAGE: totalPE = collar_potential_energy(x_C,theta)
m = 0.5; % mass is 0.5 kg
g = -9.81; % acceleration due to gravity
k = 30; % spring constant
PE_g= m*x_C*g*sind(theta); % potential energy due to gravity
DL = 0.5 - sqrt((0.5^2) - ((0.5-x_C).^2));
PE_s = 0.5*k.*((DL).^2); % potentual energy due to spring
totalPE = PE_g + PE_s;
end