Professor Diomar Cesar Lobao

Universidade Federal Fluminense-Volta Redonda, RJ, Brasil

Diomar Cesar


Dept. Ciências Exatas - Exact Science Dept.

Search

gendata.f

      program gendata
      implicit none
c
c   Create fake Experimental Data with random error within a given
c   limit
c
c       John Mahaffy 2/5/95
c
c   Variables:
c     t     -    time (sec) of measurement
c     s     -    distance of fall measured (meters)
c     np    -    number of data points
c
c   Parameters
c     dt   -   time step between measurements
c     v0   -   initial velocity
c     s0   -   initial offset from zero point for distance measurements
c     err  -   full range of permited measurements centered on the "true"
c              location.
c
      integer np,i
      parameter (np=20)
      real t(np),s(np),v0,s0,err,dt,rand,st
      parameter ( dt=2./np, s0=.0025, v0=.05, err=.005)
      open(11,file='fall.data')
      do 20 i=1,np
      t(i)=i*dt
      st=s0+t(i)*v0+.5*9.807*t(i)**2
      s(i)=st+min(st,err)*(.5-rand())
c
c    NOTE THAT:    st-.5*err .le. s(i) .le. st+.5*err
c
      write(11,2000)t(i),s(i)
 2000 format(1x,f7.4,4x,2f10.6)
 20   continue
      stop
      end
Skip to content