Skip to content Skip to navigation

Connexions

You are here: Home » Content » Programming with M-files: Analyzing Railgun Data Using For Loops

Navigation

Content Actions

  • Download module PDF
  • Add to ...
    Add the module to:
    • My Favorites
    • A lens
    • An external social bookmarking service
    • My Favorites (What is 'My Favorites'?)
      'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.
    • A lens (What is a lens?)

      Definition of a lens

      Lenses

      A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

      What is in a lens?

      Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

      Who can create a lens?

      Any individual Connexions member, a community, or a respected organization.

      What are tags? tag icon

      Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

    • External bookmarks
  • E-mail the author
  • Rate this module (How does the rating system work?)

    Rating system

    Ratings

    Ratings allow you to judge the quality of modules. If other users have ranked the module then its average rating is displayed below. Ratings are calculated on a scale from one star (Poor) to five stars (Excellent).

    How to rate a module

    Hover over the star that corresponds to the rating you wish to assign. Click on the star to add your rating. Your rating should be based on the quality of the content. You must have an account and be logged in to rate content.

    (0 ratings)

Recently Viewed

This feature requires Javascript to be enabled.

Programming with M-files: Analyzing Railgun Data Using For Loops

Module by: Darryl Morrell

Summary: This is an example of using m-files to solve a simple engineering data analysis problem in which velocity and position of a railgun projectile are computed from acceleration data; the acceleration data is computed from the current driving the railgun.

Note: Your browser may not currently support MathML. See our browser support page for additional details. You can always view the correct math in the PDF version.

Note:

This example requires an understanding of the relationships between acceleration and velocity of an object moving in a straight line. A clear discussion of this relationship can be found in Acceleration; the Wikipedia article Motion Graphs and Derivatives also has an explanation of this relationship, as well as a discussion of average and instantaneous velocity and acceleration and the role derivatives play. Also, in this example, we will compute approximate integrals using the trapezoidal rule; The Wikipedia article Trapezium rule has an explanation of the trapezoidal rule.

Velocity Analysis of an Experimental Rail Gun

A railgun is a device that uses electrical energy to accelerate a projectile; information about railguns can be found at the Wikipedia article Railgun. The paper Effect of Railgun Electrodynamics on Projectile Launch Dynamics shows the current profile of a railgun launch. The acelleration aa of the projectile (in units of ms2 m s 2 ) is a function of the current cc through the projectile (in units of kAmp). This function is given by the equation

a=0.0036c2sgnc a 0.0036 c 2 sgn c (1)
where sgnc sgn c is 1 if c>0 c 0 and -1 if c<0 c 0 .

Exercise 1

Get the data

Download the current data set in the file Current.txt onto your computer (right click on this link). The file is formatted as two columns: the first column is time in mili-seconds, and the second column is current in kA.

The following sequence of commands will load the data, create a vector t of time values, create a vector c of current values, and plot the current as a function of time.

load Current.txt -ascii
t = Current(:,1);
c = Current(:,2);
plot(t,c)
xlabel('time (msec)')
ylabel('current (kA)')
The plot should be similar to that in Figure 1.
Figure 1: Plot of railgun current versus time.
Figure 1 (CurPlot.png)

Exercise 2

Compute the projectile velocity as a function of time. Note that velocity is the integral of acceleration.

References

  1. Alexander E. Zielinski; Paul Weinacht. (1999). Effect of Railgun Electrodynamics on Projectile Launch Dynamics. IEEE Transactions on Magnetics, 35(1), 118-123.

Comments, questions, feedback, criticisms?

Send feedback