Skip to content

bjw13002/Roots-and-Optimization

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?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Solver Initial Guess Root Ea Iterations Falsepos 50 39.0566 2.16e-06 10 Bisect 50 39.0566 3.94e-07 6 Mod_Secant 50 39.0568 9.92e-06 624 Newtraph 50 39.0566 7.63e-06 24

Divergence of Newton-Raphson Method Iteration x_i Approximate Error 0 2.0000 NaN 1 2.2857 1.25e+01 2 2.5276 9.57e+00 3 2.7422 7.83e+00 4 2.9375 6.65e+00 5 3.1182 5.79e+00

Convergence of Newton-Raphson Method Iteration x_i Approximate Error 0 0.200000 NaN 1 -0.017391 1.25e+03 2 0.000011 1.65e+05 3 -0.000000 4.51e+11 4 0.000000 4.51e+11 5 0.000000 4.51e+11

Plot of convergence for four numerical solvers.

#HW_4

Collar Potential

function [PE] = collar_potential(x,theta)

X=(.5-sqrt(.5^2 + (.5-x)^2)); PE_s=15X^2; PE_g=4.905x*sind(theta);

PE=PE_g + PE_s;

end

HW_4 Script

%Potential Energy Minimization Script

a=1; for theta=1:90; [x,fx,ea,iter]=goldmin(@(x) collar_potential(x,theta),.01,1,.0001,100); X(a)=x; Theta(a)=theta; FX(a)=fx; a=a+1; end X(a)=X(a-1); Theta(a)=Theta(a-1); plot(Theta,X) title('Potential Energy Optimization') xlabel('Theta (Degrees)') ylabel('x_c (meters)')

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages