Newton 5.0 (February 2021)

 

Author: Thomas A. Moore

This app automates constructing a trajectory diagram, which allows you to predict any object's trajectory if you know its acceleration as a function of time, the object's position, and/or its velocity. [See chapter N3 of Unit N in the Six Ideas That Shaped Physics series of introductory texts (3nd ed., McGraw-Hill, 2017) to learn how to construct such diagrams by hand.]

Setting Up a Situation

Pressing the "Setup" button displays a dialog that allows you to specify the time step (and units), the plane of the object's motion (the xy or xz plane), the object's initial position vector (and units), and its initial velocity vector (either in terms of components or as a magnitude and an angle from the x axis). You can also specify the object's acceleration as the sum of five terms, one in the +x direction, one in the +y (or +z) direction, one in the direction pointing radially away from the object's current position, one pointing "forward" (in the direction of the object's current velocity), and one pointing "sideward", that is, in the direction perpendicular to the object's velocity, to your left if you stand on the plane of motion and look forward along the the velocity (useful for modeling lift or magnetic forces.) You do this by typing a mathematical expression to calculate each term at each step in terms of the current time t, the object's current position coordinate x and y (or z), the current distance r the object is from the origin, its current velocity components vx and vy (or vz), and/or its current speed v. See the bottom of these notes for more information about how to format the mathematical expressions. You can also use the "Cases" menu to quickly set up one of a number of interesting physical cases.

Generating the Trajectory Diagram

Once you have dismissed the "Setup" dialog, you will see the initial velocity vector displayed on the graph. Pressing the "One Step", "5 Steps, "20 Steps" or "50 Steps" button will construct the specified number of steps for the diagram. Pressing the "Step Back" and "Step Back 5" buttons erase the specified number of steps. The "Reset" button restores the graph to the specified initial conditions. The "Overview" radio button shows all steps of the trajectory, while the "Last Step" button shows how the last step was constructed (as well as providing some numerical data). You can also draw a rectangle on the graph to focus in on a certain region (doing will automatically set the "Custom" radio button). Clicking on that "Custom" button directly will zoom out a bit. These last two features allow you to quickly inspect any region you choose.

Printing

You can use your browser's "Print" function to print the page, but on some browsers, you may have to make the page smaller to see the full graph: be sure to check the print preview before you print. A more foolproof method is to take a screen shot of the browser window and print that.

Version Notes

Version 5.0 adds to first Javascript version (4.0) the capabilities of varying the window size and choosing regions to view. I have tried to make this app as simple and user-friendly as possible. The practicalities of the web-based version required some changes in the user interface from the last desktop-based version (the version described in the text), but for the most part, I think that these changes have made the program more useful and transparent. Please send me bug reports or feature requests via "Contact" form on the website. You may also examine the Javascript code by simply looking at the page source.

Appendix: Creating Graphs of One-Dimensional Motion

While this program is not really designed to model one-dimensional motion, one can do this by defining the object's initial velocity in, say, the y direction to be, say 1.0 m/s, and then setting only the x component of the acceleration. Since the object's y-velocity will be constant, this will essentially make the y axis a time axis.

Appendix: More About Entering Expressions

Please note the following when entering mathematical expressions into acceleration boxes in the setup dialog. The variables x, y, t, r, v, vx, vy, and pi are automatically defined and can be used in any expression (if you have set the plane of motion to be the xz plane, z and vz are defined instead of y and vy). Valid operators are + (addition), - (subtraction), * (multiplication), / (division), and ^ (raising to a power). Some examples of valid expressions are

The usual rules of precedence of operations apply: for example in the expression a+b*c^-(d+e), the quantity (d+e) is evaluated first (because it is in parentheses), the result is then negated, the value of c is then raised to that power (since powers have precedence over other operations), the result is then multiplied by b (because multiplication and division take precedence over addition and subtraction), and finally a is added to the result.

The following is a list of the functions that one can use:

Setup for a run based on case:

Axes are:
x and y
x and z
Specify velocity as:
Components
Magnitude and Angle

Time Step:

Time Unit:
Initial Position:
x : m
y : m
Length Unit:
Initial Velocity:
vx : m/s
vy : m/s
Acceleration =
(in m/s2)
   [in the +x direction]
+ [in the +y direction]
+ [radially outward]
+ [in direction of v ]
+ [90° left of v ]

Expressions in the acceleration boxes can include numerical constants and/or the variables x, y, z (position components), r (distance from the origin), t (time), v (speed), vx, vy, and/or vz (velocity components).

Overview Custom   Last Step
Show arrows

Trajectory Diagram for the following situation:

a = 0 in m/s2
r0 = [0, 0, 0] m
v0 = [1, 1, 0] m/s
Δt = 0.05 s
Your browser does not support the canvas element: please update!