Skip to content
Permalink
8a917ec4de
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
9 lines (9 sloc) 354 Bytes
function [Total_potential_energy] = collar_potential_energy(x_C,theta)
m=0.5; %define mass
K=30; %define stiffness K
g=9.81; %define gravity constant
PE_g = m*(x_C)*g*sin(theta); %define gravity potential
DL = 0.5 - sqrt(0.5^2+(0.5-x_C)^2);
PE_s=1/2*K *(DL)^2; %define spring potential
Total_potential_energy= PE_g + PE_s; %total potential energy
end