You know, FORTRAN isn't so bad
Posted: 27 Oct 2010, 09:48
Sure, there are builds in use that are older than I am, but that's OK. It's pretty easy to learn. Having an IDE makes a big difference, too.
Fucking 23 Years of Pool Parties Fucking
https://www.mabb.us/
Code: Select all
Program yarnImpact
character yarnName !Type of yarn
real cE !Sound speed in the yarn
real L !Length of the yarn
real rho !Density of the yarn
integer n !Number of nodes in the yarn
real V0 !Impact velocity
real mP !Mass of the projectile
real alpha !Courant coefficient
real gamma !Damping coefficient
real x(1000) !Array of node positions along x-axis
real y(1000) !Array of node positions along y-axis
real Vx(1000) !Array of node velocities in x-direction
real Vy(1000) !Array of node velocities in y-direction
real sig(1000) !Array of spring stresses
real theta(1000) !Array of spring angles
real ep(1000) !Array of spring strains
implicit integer (i-j)
print *, "This program will allow us to analyze a projectile impact."
print *, "Please enter the requested data when prompted."
print *, "What type of yarn is being used?"
read *, yarnName
print *, "What is the sound speed for the yarn in m/s?"
read *, cE
print *, "What is the length of the yarn in meters? Suggested: 0.2"
read *, L
print *, "What is the density of the yarn in kg/m3?"
read *, rho
print *, "How many nodes will be analyzed? Suggested: 100"
read *, n
print *, "What is the impact velocity of the projectile in m/s?"
read *, V0
print *, "What is the mass of the projectile in kilograms?"
read *, mP
print *, "What Courant factor will be used in the model?"
read *, alpha
print *, "What damping coefficient will be used in the model?"
print *, "Suggested: 3"
read *, gamma
! Calculates the modulus of elasticity
E=(c**2)*rho
! Calculates the distance between two nodes
dx=L/(n-1)
! Calculates the length of the time step
h=alpha*dx/c
! Yarn cross-section
a=7.854d-5
! Mass of a node
mN=L*a*rho/n
! Fix initial position of nodes in x-axis
Do 5 j=1,n
x(j)=(j-1)*dx
5 Continue
! Set boundary condition for fixed node
Vx(n)=0
Vy(n)=0
end
Code: Select all
Program yarnImpact
character yarnName !Type of yarn
real cE !Sound speed in the yarn
real L !Length of the yarn
real rho !Density of the yarn
integer n !Number of nodes in the yarn
real V0 !Impact velocity
real mP !Mass of the projectile
real alpha !Courant coefficient
real gamma !Damping coefficient
real x(1000) !Array of node positions along x-axis
real y(1000) !Array of node positions along y-axis
real Vx(1000) !Array of node velocities in x-direction
real Vy(1000) !Array of node velocities in y-direction
real sig(1000) !Array of spring stresses
real theta(1000) !Array of spring angles
real ep(1000) !Array of spring strains
implicit integer (i-j)
print *, "This program will allow us to analyze a projectile impact."
print *, "Please enter the requested data when prompted."
print *, "What type of yarn is being used?"
read *, yarnName
print *, "What is the sound speed for the yarn in m/s?"
read *, cE
print *, "What is the length of the yarn in meters? Suggested: 0.2"
read *, L
print *, "What is the density of the yarn in kg/m3?"
read *, rho
print *, "How many nodes will be analyzed? Suggested: 100"
read *, n
print *, "What is the impact velocity of the projectile in m/s?"
read *, V0
print *, "What is the mass of the projectile in kilograms?"
read *, mP
print *, "What Courant factor will be used in the model?"
read *, alpha
print *, "What damping coefficient will be used in the model?"
print *, "Suggested: 3"
read *, gamma
! Calculates the modulus of elasticity
E=(c**2)*rho
! Calculates the distance between two nodes
dx=L/(n-1)
! Calculates the length of the time step
h=alpha*dx/c
! Yarn cross-section
a=7.854d-5
! Mass of a node
mN=L*a*rho/n
! Fix initial position of nodes in x-axis
Do 5 j=1,n
x(j)=(j-1)*dx
5 Continue
! Set boundary condition for fixed node
Vx(n)=0
Vy(n)=0
end