Professional Documents
Culture Documents
Underdamped
C < 2* (k*m)
(2)
C > 2* (k*m)
(3)
C = 2* (k*m)
(4)
Overdamped
Critically Damped
INTRODUCTION
A genetic algorithm is a stochastic algorithm that recreates
natural evolution. It includes the natural events such as mating,
mutation, and elitism throughout the maturing of generations.
The mating of the generations include choosing two parents
based on their fitness and creating two unique children based on
their alleles, or their own unique different variables. Mutation
causes a random children throughout to be reinitialized based
on a mutation percent. When elitism is used, the natural
selection of the best or strongest possible outcome will continue
on is put into consideration by doing so with replacing a
random parent with the best parent. With doing all of this in a
genetic algorithm, possible variables can be optimized within
many models. In a spring-mass-damper system model, given the
damping coefficient and spring constant as unknown variables
and given certain limiting factors, the damping coefficient and
spring constant can be optimized using the genetic algorithm.
(6)
Critically Damped
e-wn*t * (x0+ (vo+ wn* x0)* t)
(7)
(8)
(9)
(10)
(11)
Damping Ratio
(1)
The mass of the slide was given as 1.6 oz and x(t) will
give you the position of the slide dependent on time. The main
differences in the movement of any mass given this equation is
based on the damping ratio. Depending on the damping
coefficient and its relations to the spring constant and the mass,
the system can become underdamped, overdamped, and
critically damped.
GENETIC ALGORITHM
The genetic algorithm is a great way to optimize an
objective function using the natural development of working
towards the best outcome of a model. The fitness of each
generation will be equated and this will tell how close to our
optimized variables we are. This algorithm is created using 100
different parents with two different alleles, the damping
coefficient (c) and the spring constant (k). The first thing
created were the bounds of the alleles. The bounds used for the
damping coefficient were a 0 minimum to the maximum
damping coefficient to stay underdamped. This is done because
in this case the bouncing of the spring caused by underdamping
is ignored because the gun slide is going to hit the rest of the
gun, stopping it when it reaches its initial firing position. The
bounds used for the spring constant were a 0 minimum to the
maximum spring constant that will not exceed an 11lb force to
cock the gun to this fired position. This is found using the force,
position, and spring constant relation.
F = k* x
(12)
ALGORITHM OUTCOMES
After the genetic algorithm is used to optimize the
spring-mass-damped system, the outcomes will vary slightly
every time it is done. This genetic algorithm will run through
100 iterations with a population of 100 people. After running
APPENDIX
L2=(-z*wn)-(wn*sqrt((z*z)-1.));
characteristic equation
// roots of the
temp=fitness [0];
L[1]=0.; U[1]=kmax;
for variable 2 (k)
}
int main(){
int
Na=2,
N=100,
P1,
max_iteration=100;
double rho=0.05, temp;
ofstream output("output.dat");
P2,
a,
count=0,
// Mate parents
for(int k=0; k<N; k+=2){
// Select parents
P1=roulette_wheel(fitness,N);
P2=roulette_wheel(fitness,N);
while(P1==P2){
P2=roulette_wheel(fitness,N);