Ordinate 2DDocs Community Open the studio

Graphs, tables and sweeps

These are Research tools (the Analyze tab). Every run is recorded, so graphs and tables can be made after the run, and the time bar lets you go back to any moment.

The time bar

Home → Time (⌘J) shows the time bar under the scene. Its top row is the time line: a ruler, the recorded run (bright up to now), small amber ticks where you changed something during the run, and the playhead. Drag on it to scrub. Below it are the controls: first frame, frame back, Play, frame forward, Live (the latest frame), the time (click it to go to any time), ◆ Key, the run chip and a menu (Go to a time, Back to start, Make now t = 0). Pressing Play from an earlier time replays the recorded run.

Runs. Change something at an earlier time and press Play: the run goes on differently from there, and the run you left is kept. The time line draws the runs as a tree: each run has a line of its own that branches off the run it was made from, at the moment it was made, with its name at its end. The run you are on is the thick blue line marked current, and the path from the first run to it is blue too; hover any run to see its own path and what it branched from. Click a run to switch to it, or right-click it for more. The run chip (also View → Runs…) lists every run with where it starts and ends and what change made it. You can rename runs, delete them, or use Compare on graphs to draw a run dashed on every graph beside the current one; the Graphs tab opens to show it. Up to nine runs are kept and the oldest go first. Stop clears them along with the recording.

Keyframes. Select a body and its keys appear as diamonds in a row under the time line, one colour per quantity (force x, force y, torque, move x, move y, rotate). To add a key, press ◆ Key (a key at the playhead, with the value the quantity has there now; Enter adds it) or double-click the key row at a time. Drag a diamond to move a key in time (Shift for finer steps); double-click it to change its value; right-click it to choose how it changes to the next key (linear, ease, step or exponential) or to delete it. A force or torque is zero before its first key, so it starts at that key; after the last key the last value holds (end a push with a key of 0). Keys stay when you rewind: if they differ from the recorded run, Play goes on from there with them as a new run. Keyframes write one formula of t into the body's row, so they are ordinary loads and motion.

Graphs

Select a body or a joint and press Plot Selected, or open Graphs and use + Series: any quantity of a body (position, velocity, acceleration, angle, angular velocity, momentum, kinetic, potential and total energy, forces), of a joint (a pin's angle, a spring's extension and force, a cable's tension) or of the whole system (total energy, momentum, centre of mass). A graph back-fills from the recorded run. Click in a graph to jump the scene to that time. Axes, ranges, titles (LaTeX allowed), colours and line styles are in the graph's editor. Export a graph as PNG, SVG or pgfplots.

Look up… (on the graphs' and the table's toolbars): choose a tracked quantity and type a value: every moment of the recorded run it had that value is listed, with every other tracked quantity at that moment (between two samples, by straight-line interpolation), and Go to takes the time bar there. When was the ball 2 m up, and how fast was it going?

Comparing runs

To compare two runs on one graph — a heavier mass, a steeper launch — open the graph's editor and press Keep This Run (Data page → Compare runs). The graph's curves are frozen and drawn dashed in the same colours, named Run 1 (kept) in the legend. Press Stop, change the value, and run again: the new run is drawn beside the kept one. Click a kept run's legend entry to hide it, its × to remove it. Up to six kept runs per graph; they are saved with the scene and appear in the graph's PNG, SVG and pgfplots exports.

The table

Table shows the run as a sheet: time t, quantity columns, and formula columns. Quantity columns are named from the scene: the body m₁'s y is y1, its speed v1, its kinetic energy KE1; another body's y_Bob; the system's KE_sys. Copy cells, export CSV, and Insert chart to plot columns against each other.

Formulas

A formula column is computed over the whole run:

0.5*m1*v1^2               kinetic energy, in J
ddt(y1)                   derivative, in m/s
integral(v1)              cumulative integral, in m
(m2 - m1)*g/(m1 + m2)     a theory value to compare
if(t < 1, 0, F0)          a switch at 1 s
  • Numbers, + − * / ^, comparisons and parentheses; t, the columns, g, pi, e, a body's mass (m1, m_Bob) and named constants (with units).
  • Functions: sin cos tan asin acos atan atan2 sinh cosh tanh sqrt cbrt abs exp ln log log10 log2 pow hypot mod sign floor ceil round min max clamp if step deg rad sind cosd tand, ddt(col), integral(col), and whole-column mean sum std first last peak min max.
  • Units are carried: 0.5*m1*v1^2 is in J, m1*g in N. Adding two values of different dimensions warns.
  • A mistake says what and where: Unknown name "v12" — did you mean v1?

A formula column can be shown on a graph as a theory curve beside the measured one, with the difference.

The Formulas tab

Analyze → Formulas is a calculator over the scene. Where the table computes a formula over the whole run, the Formulas tab gives single values at the time shown on the time bar. Scrub the time bar and they change with it.

  • + Variable gives a name to one quantity of the selected body, spring, rod or cable: its speed (v1), its x position (x1), a spring's extension or stiffness (k_Spring_1), a cable's tension, the system's energy. A variable is live, or taken at the start (x1_0, for a displacement) or at the current time.
  • + Formula and type one: p1 = m1*v1, (m2 - m1)*g/(m1 + m2). It can use the variables, other formulas, the masses (m1), g, t, pi, the constants and the table's columns. Units are carried, as in the table, and mistakes are shown as you type.
  • Library inserts textbook formulas bound to the selected body, spring or rod. It covers kinematics, Newton's laws, energy, momentum, rotation, springs, the pendulum and the system's conservation laws. Compare the theory with the simulation at any moment.
  • On scene puts a formula on the figure as a label, for example "KE₁ = ½ m₁ v₁² = 2.67 J". The label updates live and appears in every export. In its Properties, choose formula and value, or the value only, and the number of decimals.
  • LaTeX copies the line. Set… writes a value into the paused scene (a body's position or velocity, a spring's stiffness). Undo takes it back.

The Formulas tab is part of Pro, like graphs and tables.

Uncertainties

Measured values are never exact. Type a ± beside a variable, either a number in its unit (0.05) or a percentage (2%). A formula that uses it then shows value ± uncertainty, propagated to first order: u² = Σ (∂f/∂x · σ)², with the variables treated as independent. Hover the value to see how much each variable contributes. The uncertainty is shown with two significant figures and the value rounded to the same place; a label placed on the scene and the LaTeX line carry it too. For a strongly curved formula or a large uncertainty, use the Monte Carlo run below instead.

Parameter sweeps

Analyze → Parameter Sweep reruns the scene for a range of one parameter (a mass, a spring's k, gravity, a constant) and records outputs (a period, a peak, a final value, a column's statistic). The result is a sweep sheet in the table, and a graph of every output against the parameter in the Graphs tab (with all the graph tools: trend lines, styles, pgfplots); export it as CSV. The run you had is kept.

Monte Carlo

Analyze → Monte Carlo runs the scene many times with chosen parameters scattered at random (a mass ± 2 %, a friction ± 0.05; normal or uniform, with a seed so the run can be repeated). Each output is reported as mean ± standard deviation (also the standard error, minimum, maximum and the number of runs), with a histogram, a table of every run and a CSV. A mass, radius, stiffness or gravity stays positive.

With Also sweep ticked the scatter is repeated at each value of another parameter, and the graph shows the means against that parameter with the standard deviations as error bars: the period of a pendulum against its length, with the spread that a ± on the length and the mass gives.

Error bars

Any series of a graph can have error bars: Graphs → Editor → Error bars gives a series a fixed ±, a percentage of its value, or another column of the table as the ± of each point. They are in the PNG, SVG and PDF exports and in the pgfplots (TikZ) export, and the axis grows to hold them.

Recording from a script

A Python script can add its own rows with s.record(t=s.time, x=ball.x): they go to a sheet named Script.