diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/mandi')
-rw-r--r-- | Master/texmf-dist/doc/latex/mandi/README | 10 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/mandi/README.md | 10 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/mandi/mandi.pdf | bin | 1343851 -> 468489 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/mandi/vdemo.py | 56 |
4 files changed, 47 insertions, 29 deletions
diff --git a/Master/texmf-dist/doc/latex/mandi/README b/Master/texmf-dist/doc/latex/mandi/README deleted file mode 100644 index cc3680da78b..00000000000 --- a/Master/texmf-dist/doc/latex/mandi/README +++ /dev/null @@ -1,10 +0,0 @@ -The mandi package provides commands for typesetting symbols, expressions, and -quantities used in introductory physics and astronomy. Many of the commands are -inspired by Matter & Interactions by Ruth Chabay and Bruce Sherwood. Many of -the astronomical commands were inspired by my own classroom needs. This package -does not do computations. It only provides commands for typesetting. - -Run mandi.ins through pdfLaTeX to generate files mandi.sty and vdemo.py. Run -mandi.dtx through pdfLaTeX to generate mandi.pdf (documentation). I assume a -TeX Live 2011 or later distribution is installed. - diff --git a/Master/texmf-dist/doc/latex/mandi/README.md b/Master/texmf-dist/doc/latex/mandi/README.md new file mode 100644 index 00000000000..66a938f5de7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mandi/README.md @@ -0,0 +1,10 @@ +mandi provides commands for introductory physics. To install, open a command +line and type the following, repeating 2-4 until there are no warnings: + + 1. lualatex mandi.ins (can also use latex) + 2. lualatex mandi.dtx (lualatex is required) + 3. makeindex -s gind.ist -o mandi.ind mandi.idx + 4. makeindex -s gglo.ist -o mandi.gls mandi.glo + +Move the *.sty files into a directory searched by TeX. +The vdemo.py file is not needed. diff --git a/Master/texmf-dist/doc/latex/mandi/mandi.pdf b/Master/texmf-dist/doc/latex/mandi/mandi.pdf Binary files differindex bb4f4fc9471..f86fe84c069 100644 --- a/Master/texmf-dist/doc/latex/mandi/mandi.pdf +++ b/Master/texmf-dist/doc/latex/mandi/mandi.pdf diff --git a/Master/texmf-dist/doc/latex/mandi/vdemo.py b/Master/texmf-dist/doc/latex/mandi/vdemo.py index 434dce5568c..5d626df6e2a 100644 --- a/Master/texmf-dist/doc/latex/mandi/vdemo.py +++ b/Master/texmf-dist/doc/latex/mandi/vdemo.py @@ -1,25 +1,43 @@ -# from vpython import * -G = 6.7e-11 +scene.width = 400 +scene.height = 760 +# constants and data +g = 9.8 # m/s^2 +mball = 0.03 # kg +Lo = 0.26 # m +ks = 1.8 # N/m +deltat = 0.01 # s -# create objects -giant = sphere(pos=vector(-1e11,0,0),radius=2e10,mass=2e30,color=color.red) -giant.p = vector(0,0,-1e4) * giant.mass -dwarf = sphere(pos=vector(1.5e11,0,0),radius=1e10,mass=1e30,color=color.yellow) -dwarf.p = -giant.p +# objects (origin is at ceiling) +ceiling = box(pos=vector(0,0,0), length=0.2, height=0.01, + width=0.2) +ball = sphere(pos=vector(0,-0.3,0),radius=0.025, + color=color.orange) +spring = helix(pos=ceiling.pos, axis=ball.pos-ceiling.pos, + color=color.cyan,thickness=0.003,coils=40, + radius=0.010) -for a in [giant,dwarf]: - a.orbit = curve(color=a.color,radius=2e9) +# initial values +pball = mball * vector(0,0,0) # kg m/s +Fgrav = mball * g * vector(0,-1,0) # N +t = 0 -dt = 86400 -while 1: - rate(100) - dist = dwarf.pos - giant.pos - force = G * giant.mass * dwarf.mass * dist / mag(dist)**3 - giant.p = giant.p + force*dt - dwarf.p = dwarf.p - force*dt - for a in [giant,dwarf]: - a.pos = a.pos + a.p/a.mass * dt - a.orbit.append(pos=a.pos) +# improve the display +scene.autoscale = False # turn off automatic camera zoom +scene.center = vector(0,-Lo,0) # move camera down +scene.waitfor('click') # wait for a mouse click +# initial calculation loop +# calculation loop +while t < 10: + rate(100) + # we need the stretch + s = mag(ball.pos) - Lo + # we need the spring force + Fspring = ks * s * -norm(spring.axis) + Fnet = Fgrav + Fspring + pball = pball + Fnet * deltat + ball.pos = ball.pos + (pball / mball) * deltat + spring.axis = ball.pos - ceiling.pos + t = t + deltat |