- #1
grecko94
- 19
- 1
Hi there I am really new into programiing thing, and I am trying to make program of this problem usin FORTRAN
I want the output to be Time,poisiton,velocity and contact force
and i already know
= amplitude
U = velocity of the car
d = rail distance
and so far this is my program <Moderator's note: please use code tags>
But I am still have no idea how do i make contact force loop
Can someone help me please...
I want the output to be Time,poisiton,velocity and contact force
and i already know
U = velocity of the car
d = rail distance
and so far this is my program <Moderator's note: please use code tags>
Fortran:
program dashpot
implicit none
integer,parameter :: N=10001,IN=300
integer :: i
real :: pi,dt,k,m,c,U,d,wb,am
real,dimension (N)::T,V,X
!initial condition= position,velocity,time, pi
pi = 3.14159265359
dt = 2*pi/FLOAT(N-1)
x(1) = 0
t(1) = 0
v(1) = 1
k = 3533.66
m = 130
c = 0
U = 8
d = 10
wb = 2*pi*U/D
am =0.5
!looping
do I=1, N-1
T(i+1) = dt*i
X(i+1) = x(i) + v(i)*dt
V(i+1) = v(i) + (-k/m*(x(i)-am*sin(wb*u*dt))-c/m*(v(i)-wb*U*am*cos(wb*dt)))*dt
end do
print*, ' T(I) X(I) V(I)'
WRITE (*,"(3F16.8)") (T(I),X(I),V(I),I=1,N,IN)
END PROGRAM dashpot
But I am still have no idea how do i make contact force loop
Can someone help me please...
Attachments
Last edited by a moderator: