Skip to main content
Engineering LibreTexts

12.1: Given/Find Blocks

  • Page ID
    14985
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    'given/find' block

    We illustrate this through the following example.

    Example 12.1.1

    Solve: 2 = x4 + 3x2 − 1.

    Solution

    In the worksheet, the syntax is

    given
    2 = x4+3x2- 1 (Use ctrl + = for bold symbolic equals sign)

    guess
    x := 1
    x := find(x)
    x =

    The last line will show x = 0.89 once the equals sign is entered. The line x := find(x) solves for x and then stores it back as the variable x. For full details, the guess of x := 1 provides the “seed” for the Newton-Raphson algorithm (Google it). Try changing the seed value to see what happens. For example, if we start with x := −1 we end up with a different answer, namely x = −0.89.

    The given/find process can be extended to solving systems of equations as well as in the next example:

    Example 12.1.2

    Simultaneously solve a + b = 3, a − b = 4 for a, b.

    Solution

    In the worksheet, using ctrl + = for bold symbolic equals sign, the syntax is

    given
    a+b 3
    a-b 4
    guess
    a := 1
    b := 1
    find(a,b)=

    Once, you hit return on the last line, it will become

    \[find(a,b)= \begin{pmatrix} 3.5 \\ -0.5 \end{pmatrix}\nonumber\]

    The given/find capabilities are not limited to linear equations as can be seen in the next example.

    The given/find capabilities are not limited to linear equations as can be seen in the next example.

    Example 12.1.3

    Simultaneously solve t4+r3 = 1 and r−t2 = −2

    Solution

    In the worksheet, using ctrl + = for bold symbolic equals sign, the syntax is

    given

    t4+r3 = 1

    r−t2 = −2

    guess
    r := 1
    t := 1
    find(r,t)=

    Once, you hit return on the last line, it will become

    \[find(r,t)= \begin{pmatrix} -0.783 \\ 1.103 \end{pmatrix}\nonumber\]

    So, one solution is r = −0.783, t = 1.103. Note that this is not the only solution. Can you change the seed (or “guess”) values to get the rest of the solutions?


    This page titled 12.1: Given/Find Blocks is shared under a CC BY-NC 3.0 license and was authored, remixed, and/or curated by Troy Siemers (APEX Calculus) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.