forked from arkadianriver/spectral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plinko.html
82 lines (82 loc) · 5.74 KB
/
plinko.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
layout: page
title: Plinko Game Dynamics
subtitle: Northwestern University: <a href="http://www.mccormick.northwestern.edu/mechanical/courses/descriptions/314-theory-of-machines-dynamics.html">Machine Dynamics</a>
---
<section>
<h3>Technical Skills Used</h3>
<ul>
<li align="left">Mathematica</li>
<li align="left">Euler-Lagrange Equations</li>
<li align="left">Rotational Inertia</li>
<li align="left">Impact Constraints</li>
<li align="left">Constrained Dynamics</li>
<li align="left">External Forces</li>
</ul>
<hr />
<h3>How it Works</h3>
<p>The square prism has the configuration $q=(x,y,\theta)$ and the following dimensions:
<ul>
<li>$Height=2h\ along\ the\ z\ axis$</li>
<li>$Width=2w\ along\ the\ y\ axis$</li>
<li>$Length=2l\ along\ the\ x\ axis$</li>
</ul>
</p>
<p>The equations that define the Lagrangian Dynamics of the square are described below.
<ul>
<li>$KE=\frac{1}{2}{V_{B}}^{T}IV_{B }$</li>
<li>$PE=mgy$</li>
<li>$L=KE-PE$</li>
</ul>
where:
<ul>
<li>$V_{B}=\begin{bmatrix}\dot{x} & \dot{y} & \dot{\theta}\end{bmatrix}^{T}$</li>
<br/>
<li>$I=\begin{bmatrix}m & 0 & 0\\ 0 & m & 0\\ 0 & 0 & \frac{8}{3}hwl\left ( l^2+w^2 \right )\end{bmatrix}$</li>
</ul>
</p>
<p>The Euler-Lagrange Equations are:
<ul>
<li>$\frac{\mathrm{d} }{\mathrm{d} t}\left (\frac{\partial L}{\partial \dot{x}}\right )-\frac{\partial L}{\partial x}=\lambda \frac{\partial \phi}{\partial x}+F_{x}$</li>
<li>$\frac{\mathrm{d} }{\mathrm{d} t}\left (\frac{\partial L}{\partial \dot{y}}\right )-\frac{\partial L}{\partial y}=\lambda \frac{\partial \phi}{\partial y}+F_{y}$</li>
<li>$\frac{\mathrm{d} }{\mathrm{d} t}\left (\frac{\partial L}{\partial \dot{\theta}}\right )-\frac{\partial L}{\partial \theta}=\lambda \frac{\partial \phi}{\partial \theta}$</li>
</ul>
where:
<ul>
<li>$F_{x}=\begin{cases}F\cos \theta & \text{ if } x\leq 7 \\ -\frac{1}{2}\rho C_{D} A \dot{x} & \text{ if } x> 7 \end{cases}$</li>
<br/>
<li>$F_{y}=\begin{cases}F\sin \theta & \text{ if } x\leq 7 \\ -\frac{1}{2}\rho C_{D} A \dot{y} & \text{ if } x> 7 \end{cases}$</li>
</ul>
</p>
<p>The Impact Constraint Equations are described below.
<ul>
<li>$\phi_{x}=x\ coordinate\ \text{of}\ T_{bs}r_{s,pin}=x_{pin}\cos\theta+y_{pin}\sin\theta-x\cos\theta-y\sin\theta$</li>
<br/>
<li>$\phi_{y}=y\ coordinate\ \text{of}\ T_{bs}r_{s,pin}=y_{pin}\cos\theta-x_{pin}\sin\theta+x\sin\theta-y\cos\theta$</li>
<br/>
<li>$\phi_{x,corner}=x\ coordinate\ \text{of}\ T_{sb}r_{b,pin}=\begin{cases}l\cos\theta-w\sin\theta+x & \text{ if } (x_{b},y_{b})= (l,w)\\ l\cos\theta+w\sin\theta+x & \text{ if } (x_{b},y_{b})= (l,-w)\\-l\cos\theta+w\sin\theta+x & \text{ if } (x_{b},y_{b})= (-l,-w)\\-l\cos\theta-w\sin\theta+x & \text{ if } (x_{b},y_{b})= (-l,w)\\\end{cases}$</li>
<br/>
<li>$\phi_{y,corner}=y\ coordinate\ \text{of}\ T_{sb}r_{b,pin}=\begin{cases}w\cos\theta+l\sin\theta+y & \text{ if } (x_{b},y_{b})= (l,w)\\ -w\cos\theta+l\sin\theta+y & \text{ if } (x_{b},y_{b})= (l,-w)\\-w\cos\theta-l\sin\theta+y & \text{ if } (x_{b},y_{b})= (-l,-w)\\w\cos\theta-l\sin\theta+y & \text{ if } (x_{b},y_{b})= (-l,w)\\\end{cases}$</li>
</ul>
</p>
<p>The Impact Update Laws are described below.
<ul>
<li>$\frac{\partial L}{\partial \dot{x}}_{\tau^{+}}-\frac{\partial L}{\partial \dot{x}}_{\tau^{-}}=\lambda \frac{\partial \phi}{\partial x}$</li>
<li>$\frac{\partial L}{\partial \dot{y}}_{\tau^{+}}-\frac{\partial L}{\partial \dot{y}}_{\tau^{-}}=\lambda \frac{\partial \phi}{\partial y}$</li>
<li>$\frac{\partial L}{\partial \dot{\theta}}_{\tau^{+}}-\frac{\partial L}{\partial \dot{\theta}}_{\tau^{-}}=\lambda \frac{\partial \phi}{\partial \theta}$</li>
<li>$H_{\tau^{+}}-H_{\tau^{-}}=0$</li>
</ul>
</p>
<p>The Impact Update Laws are called when the following events occur:
<ul>
<li>$\text{If} \left | \phi_{x} \right | -l-radius_{pin}=0\ \text{and}\ \left | \phi_{y} \right | -w-radius_{pin}=0 \\ \text{then update}\ {x}',{y}',{\theta}'\ \text{using the update laws with}\ \phi=\phi_{x}\ \text{and}\ \phi=\phi_{y}$</li>
<br/>
<li>$\text{If}\ \phi_{x,corner} -7=0\ \text{or}\ \phi_{x,corner} -25=0\\ \text{then update}\ {x}',{y}',{\theta}'\ \text{using the update laws with}\ \phi= \phi_{x,corner}$</li>
<br/>
<li>$\text{If}\ \phi_{y,corner} =0\\ \text{then update}\ {x}',{y}',{\theta}'\ \text{using the update laws with}\ \phi= \phi_{y,corner}$</li>
</ul>
</p>
<hr />
<h3>Demo</h3>
<div class="image"><img src="images/plinko.gif" alt="" /></div>
</section>