search

Class myphysicslab.sims.pendulum.CompareDoublePendulumApp

Provided By
Extends
All Implemented Interfaces

Compares two double pendulum simulations that are run simultaneously: the theoretically accurate RigidDoublePendulumSim and the equivalent double pendulum using the engine2D physics engine's ContactSim. The purpose is to show that the two are closely equivalent.

The angles shown in graphs are modified for the ContactSim so that they are equivalent to the corresponding RigidDoublePendulumSim angles. The adjustment is given by myphysicslab.sims.pendulum.RigidDoublePendulumSim#getGamma1 and myphysicslab.sims.pendulum.RigidDoublePendulumSim#getGamma2.

Creates instance objects such as the simulation and display objects; defines regular expressions for easy Terminal scripting of these objects using short names instead of fully qualified property names.

The constructor takes an argument that specifies the names of the HTML elementId's to look for in the HTML document; these elements are where the user interface of the simulation is created. This allows for having two separate simulation apps running concurrently on a single page.

No global variables are created other than two root global variables: the myphysicslab global holds all of the myPhysicsLab classes; and a global variable is created for this application instance. This application global is created outside of this file in the HTML where the constructor is called. The name of that global variable holding the application is passed to defineNames() method so that short-names in scripts can be properly expanded.

new CompareDoublePendulumApp( elem_ids, centered )

Parameters
elem_ids{container: string, div_graph: string, div_terminal: string, div_time_graph: string, graph_controls: string, images_dir: string, label_terminal: string, show_sim: string, show_terminal: string, sim_applet: string, sim_controls: string, tab_list: string, term_input: string, term_output: string, time_graph_controls: string}

specifies the names of the HTML elementId's to look for in the HTML document; these elements are where the user interface of the simulation is created.

centeredboolean

determines which pendulum configuration to make: centered (true) or offset (false)

Instance Methods

Instance Properties

Type Definitions