Equation Solving Tutorial
Equation Solving Tutorial
A live version of this calculation is available at EngineeringPaper.xyz.
In addition to evaluating statements, EngineeringPaper.xyz can solve equations and systems of equations using the System Solve cell type. A System Solve cell can be added using the Add System Solve cell button
$$ \text{System} = \begin{cases} a\cdot x^{2}+b\cdot x+c=0 \end{cases} $$
$$ \text{Solution} = \begin{cases} x & = \quad - \frac{b}{2 \cdot a} + \frac{\sqrt{- 4 \cdot a \cdot c + b^{2}}}{2 \cdot a} \end{cases} $$
The two solutions to the quadratic equation are listed on the right. Since there are multiple solutions, it is necessary to specify which solution is desired to be used in the rest of the sheet. Click the radio buttons below each solution to select that particular solution. Notice that the value of x displayed below is changed based on the selected solution:
$$ x= \frac{- b + \sqrt{- 4 \cdot a \cdot c + b^{2}}}{2 \cdot a} $$
In addition to showing the solutions, the solution can be evaluated at specific values of a, b, and c by treating x as a function:
$$ x\left(a=1,\ b=-6,\ c=8\right)= 4 $$
The above example doesn’t use units but units work the same when solving equations as elsewhere in EngineeringPaper.xyz. For example, to find the velocity of an object dropped from a certain height, the energy approach can be used:
$$ \text{System} = \begin{cases} \frac{1}{2}\cdot m\cdot v^{2}=m\cdot g\cdot h \end{cases} $$
$$ \text{Solution} = \begin{cases} v & = \quad \sqrt{2} \cdot \sqrt{g \cdot h} \end{cases} $$
$$ v= \sqrt{2} \cdot \sqrt{g \cdot h} $$
Notice that the positive solution has been chosen. The solution of a system can be plotted like other expressions in EngineeringPaper.xyz by supplying a range when using the function notation. The plot below displays velocity versus drop height for the range of heights from 0 to 10 meters:
The above examples solved a single equation. A system of equations can also be solved as shown in the example below:
$$ \text{System} = \begin{cases} s+t=1 \ s-t=0 \end{cases} $$
$$ \text{Solution} = \begin{cases} s & = \quad \frac{1}{2} \ t & = \quad \frac{1}{2} \end{cases} $$
Note that a solution is provided only when EngineeringPaper.xyz can find an exact analytical solution. Some systems cannot be solve symbolically. For such systems, EngineeringPaper.xyz can use a numerical approach to solve the system. To switch to the numerical solver, simply provide an initial guess for each parameter in the “Solve for” list. An initial guess is provided use a ~ symbol between the variable and the initial guess. For an example, se the system below:
$$ \text{System} = \begin{cases} \frac{1}{z}=\sin\left(z\right) \end{cases} $$
$$ \text{Solution} = \begin{cases} z & = \quad 6.43911723842 \end{cases} $$
$$ z= 6.43911723841725 $$
Entering the initial guess of z~6.7 tells EngineeringPaper.xyz to use the numerical solver for this particular System Solve Cell. The numerical solver works for multiple equations and unknowns just like the symbolic solver. Additionally, units can be used with the numerical solve in the same way as the symbolic solver. Finally, the numerical solver will only find one solution, even for systems with multiple solutions. See the plot below to see the repeating solutions for this system (the solutions occur where the 1/z and sin(z) curves intersect). To find different solutions, the initial guess value needs to be changed. Try changing the initial guess to 15 to find another solution.
$$ y_{1}=\frac{1}{z_{local}} $$
$$ y_{2}=\sin\left(z_{local}\right) $$