Computer Science and Engineering

Modeling And Simulation Technology

Problem 1


Assignment Details:


Problem #1: (5 points)

Basic simulation programming and a simple dynamics model.

Assigned: 2012-01-18
Due: 2012-01-23

Overview:

Build a Java, C or C++ program that implements the required algorithm, then compile and run it on a machine, put the deliverables into the form specified below and turn the package in.

Details:

Implement the following calculations in a loop which takes t from 0.00 to 5.00 in increments of 0.1.

Equations:

   Initialize:

      dt = 0.10    (it is constant)
      t0 = 0.00

      dx0 = 0.10    (it is constant)
      x0 = 0.00

      ddy = 1.00   (it is constant)
      dy0 = 0.00
      y0 = 1.00

   Repeat the following steps while ti <= 5.0

      dxi = dx(i - 1)
      xi = x(i - 1) + dxi * dt

      dyi = dy(i - 1) - ddy * dt2
      yi = y(i - 1) + dyi * dt
      if y goes negative "bounce" by removing some velocity and
      recalculating

         y = -y
         dy = -dy * 0.70;

      ti = t(i - 1) + dt

Print out the values of t, (x, y), and (dx, dy) for each step.

Turn-in:

The files to be turned in for this programming assignment are as follows:

  1. All source code files
  2. A writeup on how to compile, run, and use the program, as well as details of which systems you used, any problems you encountered, and how you overcame them.
  3. The output log text file

These are to be placed in a single jar or tar file and e-mailed as an attachment to jholten@nmt.edu

Extra Credit: (max 1 point)

Have the program generate a graphical presentation of the x-y positions of the point locations for this system by using character plots. The time increments are the successive rows. (A sample character plot, time on the vertical axis)

Sample Solutions: