\documentclass[]{article}

\usepackage{siunitx}
\usepackage{physics}
\usepackage{graphicx}
\usepackage{fullpage}

\author{C.D. Clark III}
\title{show-your-work/compudoc example}

\begin{document}
\maketitle

% {{{
% from show_your_work import Expression, Equation
% import pint
% ureg = pint.UnitRegistry()
% Q_ = ureg.Quantity
% def Lx_filter(input,fmt=""):
%   text = fmt_filter(input,fmt+"Lx")
%   return text
% jinja2_env.filters["Lx"] = Lx_filter
% line_eq = Equation(r"\\v{y} = \\v{m}\\v{x} + \\v{b}")
% print(line_eq.latex)
% }}}
$$
y = mx + b
$$
This gives the relationship between a dependent variable $y$ on an independent variable $x$.
% {{{
% slope = 3
% y_intercept = 2
% val = 10
% }}}
For example, for a slope $m = 3$ and y-intercept $b = 2$, the value for $y$ at $x = 10$ would be
% {{{
% line_eq.rhs.add_substitution('m',slope)
% line_eq.rhs.add_substitution('b',y_intercept)
% line_eq.rhs.add_substitution('x',val)
% }}}
$$
y = (3)(10) + (2) = 32.0
$$
% {{{
% kinematics_eq1 = Equation( r"\\v{x} = \\v{v} \\v{t} + \\v{x_0}", "meter")
% v = Q_(60,'mph').to("km/hr")
% t = Q_(40,'min')
% x0 = Q_(150,'yd').to("m")
% kinematics_eq1.rhs.add_substitution('v',v)
% kinematics_eq1.rhs.add_substitution('t',t)
% kinematics_eq1.rhs.add_substitution('x_0',x0)
% }}}
Now, when dealing with physical quantities, we will have to consider units. Take an example from kinematics. The
position of an object traveling at constant speed is given by the equation,
$$
x = v t + x_0,
$$
which is just the equation for a line with $v$ as the slope and $x0$ as the y-intercept. If a car is traveling at
$v = \SI[]{96.56064}{\kilo\meter\per\hour}$ and we didn't start the stop watch until we were \SI[]{137.16}{\meter} out of town, the car's distance from town
after traveling for \SI[]{40}{\minute} would be:
$$
x = (\SI[]{96.56064}{\kilo\meter\per\hour}) (\SI[]{40}{\minute}) + (\SI[]{137.16}{\meter}) = \SI[]{64510.920000000006}{\meter}
$$



\end{document}
