Skip to main content
Physics LibreTexts

1.2.3: Input Data, Formulas

  • Page ID
    58846
  • \( \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}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    Exploration 3: Input Data, Formulas

     

     

     
     
    x(t) =  

     

    In many animations you will be expected to enter a formula to control the animation (position is given in centimeters and time is given in seconds)Restart. In the Exploration 3, you are to enter in a function \(x(t)\) to control the position of the toy yellow Lamborghini. There are a few important rules for entering functions. Notice that the default value in the text box is \(3\ast t\) and NOT \(3t\). This is the way the computer understands multiplication. You must enter in the multiplication sign, \(\ast\), every time you mean to multiply two things together. Remove the \(\ast\) and see what happens. You get an error and you can see what you entered. Division is represented as \(t/2\) and NOT \(t\backslash 2\). In addition, the Physlet understands the following functions:

    \(\sin(a)\) \(\cos(a)\) \(\tan(a)\) \(\sinh(a)\) \(\cosh(a)\) \(\tanh(a)\)  
    \(\text{asin}(a)\) \(\text{acos}(a)\) \(\text{atan}(a)\) \(\text{asinh}(a)\) \(\text{acosh}(a)\) \(\text{atanh}(a)\)  
    \(\text{step}(a)\) \(\text{sqrt}(a)\) \(\text{sqr}(a)\) \(\text{exp}(a)\) \(\ln(a)\) \(\log(a)\)  
    \(\text{abs}(a)\) \(\text{ceil}(a)\) \(\text{floor}(a)\) \(\text{round}(a)\) \(\text{sign}(a)\) \(\text{int}(a)\) \(\text{frac}(a)\)

    Table \(\PageIndex{1}\)

    where "a" represents the variable expected in the function (here it is \(t\)).

    Try the following functions to control the Lamborghini (note that you are controlling \(x(t)\) of the red ball attached to the Lamborghini):

    1. \(0.3\ast t\ast t\)
    2. \(-20\ast t+3\ast t \wedge 2\) (note that \(t \wedge 2\) is equivalent to \(t\ast t\))
    3. \(\text{int}(t)\)
    4. \(10\ast \sin(\text{pi}\ast t/2)\)
    5. \(\text{step}(t-2)\ast 3\ast (t-2)\)

    Try some others for the practice. Try to keep the Lamborghini on the screen!

    When you get a good-looking graph, right-click on it to clone the graph and resize it for a better view.

    Physlets were developed at Davidson College and converted from Java to JavaScript using the SwingJS system developed at St. Olaf College.


    1.2.3: Input Data, Formulas is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?