Mathematical Functions Graphing

What is a Mathematical Function?

In mathematics, a Function is like a "machine" that takes an input value, processes it through calculations, and returns exactly one output value. Typically, we use the variable xx for the input and f(x)f(x) or yy for the output.

Functions allow engineers to create models for various behaviors, such as wave oscillation, beam bending, or changes in electrical current.

Understanding Graphing Variables

For the computer to draw a graph, we need to define the following parameters:

  • Expression: The mathematical formula to plot, such as sin(x) * x or x^2.
  • Variable Name: The independent variable in the equation (usually x).
  • Domain (X-axis bounds): The range of xx values we want to observe (from domainMin to domainMax).
  • Range (Y-axis bounds): The height range of the graph (from yMin to yMax).
  • Sample Count (Resolution): The number of points the computer will calculate to connect the line. Higher values make the graph smoother (but don't set it too high to avoid heavy processing).

Interactive Visualization

Try changing the Expression in the tool below! Interesting examples:

  • Parabola: x^2 (change y range to -10 to 100)
  • Sine Wave: sin(x)
  • Damped Wave: sin(x) / x or sin(x) * exp(-0.1 * x)
Loading interactive visualization...

Observation: If you type the equation incorrectly, or set the Y-axis range narrower than the actual values of the function, the graph might break through the frame or display incompletely. Try adjusting yMin and yMax to cover the wave's height!