Skip to content
Permalink
1dbc1d0d97
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
12 lines (11 sloc) 352 Bytes
for i= 1:90
theta= i*pi/180;
minimum_potential_energy= @(x_C) 0.5 * x_C*9.81*sin(theta) + 1/2*1000 *(0.5 - sqrt(0.5^2+(0.5-x_C)^2))^2;
[C,fx,ea,iter]=goldmin(minimum_potential_energy,0,5,0.00001,50);
x_C(i)=C;
end
theta= 1:90;
plot(theta,x_C,'.b')
xlabel 'theta'
ylabel 'xc'
title('Steady-state position of collar on rod at angle theta')