3D Double Pendulum: Mathematica-Driven Simulation in nVizx
Author
Bary Wilson
Title
3D Double Pendulum: Mathematica-Driven Simulation in nVizx
Description
This submission is a Mathematica notebook that shows the (equation-driven) motion of a double pendulum in three dimensions. This simulation requires a free download of Splinex nVizx for dynamic viewing. Note: This release is for the Windows platform only.
Category
Educational Materials
Keywords
URL
http://www.notebookarchive.org/2018-10-10qkxkb/
DOI
https://notebookarchive.org/2018-10-10qkxkb
Date Added
2018-10-02
Date Last Modified
2018-10-02
File Size
3.01 megabytes
Supplements
Rights
Redistribution rights reserved




3D Double Pendulum Mathematica-Driven Simulation with nVizx
Authors:
Illya Albrecht
Alexey Moshkov
Bary Wilson
Illya Albrecht
Alexey Moshkov
Bary Wilson
This notebook generates a dynamic 3D simulation of a double pendulum system in nVizx. A particularly interesting feature of this simulation is the ability to use the Camera Motion Orbit tool in nVizx to view the running simulation from different vantage points in 3-space.
To view this simulation, you will need to have the Splinex nVizx software installed on your computer. To obtain a free sample download of nVizx, simply go to www.splinex.com and click on the Trial Download button. Once you have installed nVizx and linked to Mathematica, you can view the simulation in 3D.
A number of other Mathematica notebooks with embedded nVizx functions are available under the HELP menu in the nVizx window.
To view this simulation, you will need to have the Splinex nVizx software installed on your computer. To obtain a free sample download of nVizx, simply go to www.splinex.com and click on the Trial Download button. Once you have installed nVizx and linked to Mathematica, you can view the simulation in 3D.
A number of other Mathematica notebooks with embedded nVizx functions are available under the HELP menu in the nVizx window.
Start by initiating nVizx, and loading Mathematica Graphics Colors:
<<Splinex`Spx`;<<Graphics`Colors`;
Welcome to Splinex nVizx. Enter SpxHelp[] for more information.
In the next cell, the number of control points that will comprise the pendulum balls are set, as is the size of the pendulum weights, and the number of steps for each simulation. An expression for the trajectory is defined in terms of the masses of the balls (mass here is proportional to size).
In the next cell, the number of control points that will comprise the pendulum balls are set, as is the size of the pendulum weights, and the number of steps for each simulation. An expression for the trajectory is defined in terms of the masses of the balls (mass here is proportional to size).
SpxClear[];nPoints=10;c1=1.0;c2=0.5;steps=200;Tra=Table[{{0,0},{Sin[(c1*Cos[(2/3)^(1/2)*t]-c2*Cos[2^(1/2)*t])/5^(1/2)],-Cos[(c1*Cos[(2/3)^(1/2)*t]-c2*Cos[2^(1/2)*t])/5^(1/2)]},{Sin[(c1*Cos[(2/3)^(1/2)*t]-c2*Cos[2^(1/2)*t])/5^(1/2)]+Sin[(2*(c1*Cos[(2/3)^(1/2)*t]+c2*Cos[2^(1/2)*t]))/5^(1/2)],-Cos[(c1*Cos[(2/3)^(1/2)*t]-c2*Cos[2^(1/2)*t])/5^(1/2)]-Cos[(2*(c1*Cos[(2/3)^(1/2)*t]+c2*Cos[2^(1/2)*t]))/5^(1/2)]}},{t,1.,25.,25./steps}];
Next, the stationary anchor block and two spheres that will comprise the double pendulum system are defined. Then the objects are named and colored.
d=Table[{u,v,z},{u,0,5,1},{v,0,2,0.5},{z,0,2,1}];s1=Table2*c1*{Sin[θ]*Cos[φ],Sin[θ]*Sin[φ],Cos[θ]},φ,0,2π-,,θ,0,π,;s2=NTable1*{Sin[θ]*Cos[φ],Sin[θ]*Sin[φ],Cos[θ]},φ,0,2π-,,θ,0,π,;SpxSurface[d];SpxSurface[s1,ClosedTrue];SpxSurface[s2,ClosedTrue];cube=SpxList[][[1]]surf1=SpxList[][[2]]surf2=SpxList[][[3]]<<Graphics`Colors`SpxSelect[cube];SpxSetOptions[WireTrue];SpxSetTransform[Location{0,10,0}];SpxSetColors[SolidColorRed];SpxSelect[surf1];SpxSetOptions[BoundBoxFalse];SpxSetColors[SolidColorBlue];SpxSelect[surf2];SpxSetOptions[BoundBoxFalse];SpxSetColors[SolidColorGreen];
2π
nPoints
2π
nPoints
π
nPoints
2π
nPoints
2π
nPoints
π
nPoints
7
Null
Finally, the lengths (m) of the pendulum "strings" are selected and the animation sequence is set up based on the trajectory expression in the first cell. The pendulum "strings" will not be visible in this simulation. When the animation steps have been completed, motion of the objects is terminated.
(*===Startanimation===*)m=10;SpxRecord[];For[i=0,i<Length[Tra],i++;SpxSelect[surf1];SpxSetTransform[Location{Tra[[i,2,1]]*m,Tra[[i,2,2]]*m+10,0}];SpxSelect[surf2];SpxSetTransform[Location{Tra[[i,3,1]]*m,Tra[[i,3,2]]*m+10,0}];]SpxDone[]
ok
You can use the Camera Tools (see below) in nVizx to change your viewpoint of this simulation while it is running. Best is to use the tool on the far right of the toolbar as shown below (Orbit Tool).
The graphic below is a still image from the Double Pendulum Simulation as run with nVizx.
Copyright2005,SplinexTechnologyInc.AllRightsReserved
End of Double Pendulum Simulation


Cite this as: Bary Wilson, "3D Double Pendulum: Mathematica-Driven Simulation in nVizx" from the Notebook Archive (2015), https://notebookarchive.org/2018-10-10qkxkb

Download

