~jzck/physics-notes

900e37b796fbaf86cae4c17ae652187e0d5a9ece — Jack Halford 1 year, 19 days ago fe6b680
hidden solution
M md/coplanar-double-pendulum.md => md/coplanar-double-pendulum.md +2 -1
@@ 4,11 4,12 @@ type: problem
---

Find the [Lagrangian](lagrangian.md) of a coplanar double pendulum
## Solution

:::solution
$$ L=\mfrac{1}{2}(m_1+m_2)l_1^2\phi_1^2
	+\mfrac{1}{2}m_2l_2^2\phi_2^2
	+m_2l_1l_2\phi_1\phi_2\cos(\phi_1-\phi_2)
	+(m_1+m_2)gl_1\cos\phi_1
	+m_2gl_2\cos\phi_2
$$
:::

M md/erf.md => md/erf.md +1 -1
@@ 26,7 26,7 @@ Therefore we have the particular solution to our ODE

$$ z_p=\frac{e^{rt}}{P(r)} $$

## Generalized ERF
## Higher order ERF

When $P(r)=0$ can simply take the derivative of $(1)$ with respect to $r$.


M md/galileo-relativity.md => md/galileo-relativity.md +1 -1
@@ 1,6 1,6 @@
---
title: Galileo's relativity
type: theory
type: model
---

\begin{equation} L=L(v^2) \end{equation}

M md/inertia-tensor.md => md/inertia-tensor.md +0 -3
@@ 3,9 3,6 @@ title: inertia tensor
type: theory
---

hello
\begin{equation}I_1=I_2=\sum m{x_3}^2,\quad I_3=0 \end{equation}

```eq
LL1/32.1
```

M tools/generate-graph.sh => tools/generate-graph.sh +2 -2
@@ 12,8 12,8 @@ generate_one_node() {
    title=$($GET title $node)
    [ -f graph/$node ] && for line in $(cat graph/$node); do
	type=$(./tools/get type $line)
	[ "$type" == "math" ] && return
	[ "$type" == "problem" ] && return
	[ "$type" == "math" ] && continue
	[ "$type" == "problem" ] && continue
	printf  '    "%s" -> "%s"\n' "$($GET title $line)" "$title"
    done
}

M tools/pf-filter.py => tools/pf-filter.py +8 -7
@@ 4,8 4,6 @@ import subprocess

def prepare(doc):
    pass
    # doc.content.insert(0, pf.RawBlock("<h1>title</h1"))
    # doc.content.insert(1, pf.RawBlock('<body class="theory">'))


def action(elem, doc):


@@ 29,18 27,21 @@ def action(elem, doc):
        elem = pf.RawInline(html, format='html')
        return elem

    # load
    # load equation
    if isinstance(elem, pf.CodeBlock):
        if 'eq' in elem.classes:
            res = subprocess.run(["./tools/tex_to_html.sh", "block", f"formularies/{elem.text}.tex"], capture_output=True)
            html = res.stdout.decode('utf-8')
            elem = pf.RawBlock(html, format='html')
            return elem
        return []

    # ref
    if isinstance(elem, pf.Code):
        return elem
    # problem solution hidden
    if isinstance(elem, pf.Div):
        if 'solution' in elem.classes:
            details_start = pf.RawBlock(f'''<details><summary><b>Show solution</b></summary>''')
            details_end = pf.RawBlock('''</details>''')
            return [details_start, elem, details_end]
    return elem


if __name__ == '__main__':