Skip to content
Tactiverge

School/□ Systems Engineer/Week 1

Functions as engineering models

A spring balance turns a stretch into a force reading. What is the rule inside it, and at what stretch does the rule start lying?

About 35 min · 3 goals · Checked by automated tests

1.Why should I care?

Every simulation, controller and datasheet in this year rests on functions: a rule that turns one quantity into another. Engineers never write just F = 250x. They write F = k·x, k = 250 N/m, valid for 0 ≤ x ≤ 0.10 m. The units tell you what the numbers mean; the domain tells you where the model stops being true.

  • ◇ Write an engineering relationship as a function with input, output, units, parameters and a stated domain.
  • ◇ Fit a straight-line model to data and read the meaning of its slope and intercept with units.
  • ◇ Use residuals to decide whether a model's shape is right.

2.Discover

Start with the spring test and the linear family. Read the best-fit slope: what are its units? Nudge the slope to 80% and 120% and watch the RMS residual climb. Now switch to the wind-tunnel drag data with a linear model: the residuals form a smile-shaped run. That pattern means the shape, not the noise, is wrong.

Loading the interactive…

Can't use the interactive? Read a description instead

The fitter plots data points with a best-fit curve and a residual bar chart beneath it. For the spring data a straight line fits with stiffness about 250 N/m and residuals that flip sign often. For the drag data a straight line leaves a run of positive residuals at both ends and negative in the middle; a power law removes the pattern. The readout states the fitted equation, the RMS residual and how often the residuals change sign.

3.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1

A sensor obeys V = 0.01·T + 0.5 volts (T in °C, valid 0–100 °C). What voltage does it give at 37 °C?

V

4.Predict

A spring was tested from 0 to 0.10 m of stretch and fits F = 250x newtons perfectly. What will it need to stretch 0.30 m?

Guess first. Being wrong here is how the surprise works.

5.Understand

A model is a function with a job

A function takes an input (the independent variable) and returns exactly one output. In engineering both carry units: stretch x in metres, force F in newtons. The parameters are the fixed numbers that tailor a family to one device: stiffness k = 250 N/m. Write all three, every time, or the numbers are meaningless.

Domain: where the model is allowed to speak

Every model has a domain of inputs where it was tested or derived. A thermistor formula may hold from 0 to 100 °C; a spring law up to its elastic limit. Using a model outside its domain is extrapolation. Sometimes it is fine, often it is dangerous, and it must always be said out loud.

Residuals judge the shape

A residual is data minus model at each point. If the model's shape is right, residuals scatter randomly around zero, changing sign often. If they form long runs (all positive in the middle, all negative at the ends) the family is wrong, however small the numbers look. Fit quality has two parts: the size of the residuals and their pattern.

Explain it another way

A function is a vending machine: put in a stretch, get out a force. The parameters are how the machine is set up. The domain is the coin slot: put the wrong thing in and it jams, even if it still gives you something.

Worked example 1

A temperature sensor outputs V = 0.01·T + 0.5 volts for 0 ≤ T ≤ 100 °C. Write the inverse function and find T when V = 1.2 V.

Rearrange: T = (V − 0.5) / 0.01 = 100·(V − 0.5) °C, valid for 0.5 ≤ V ≤ 1.5 V. At 1.2 V: T = 100 × 0.7 = 70 °C, inside the domain.

Worked example 2

A fit to a spring gives F = 251x − 0.1 N. What do 251 and −0.1 mean?

251 N/m is the stiffness: each extra metre of stretch needs 251 N more (2.51 N per centimetre). −0.1 N is the force at zero stretch; it should be zero physically, so it is a small offset from noise or a zero error in the force gauge.

Common mix-ups

  • If the equation gives a number, the number is right.
    ✓ A model is only trustworthy inside the domain where it was tested or derived.
  • Small residuals mean the right model.
    ✓ Residuals must also look random. A patterned residual reveals the wrong shape even when its size is small.

6.Watch

→ Listen for the two functions the lecturer pairs up (distance and speed) and how each one tells you about the other. That pairing is the whole term.

A university lecturer's short overview of how a function and its rate of change are two views of one thing.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

The video is optional: everything you need is also in the lesson text and the interactive.

7.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 2

Same sensor, V = 0.01·T + 0.5. The firmware reads 1.20 V. What temperature is that, in °C?

°C

Practice 3

You fit a straight line to drag force against speed. The residuals are positive at low and high speeds and negative in the middle. What does that tell you?

Practice 4

A fitted model is battery voltage V (V) against time t (h): V = −0.05t + 12.6. What are the units and meaning of −0.05?

Practice 5 · a fresh version every time

An alternating voltage is v(t) = A·sin(2π·f·t) with A = 12 V and f = 2 Hz. What is v at t = 0.003 s, in volts? (Angles in radians.)

V

8.Apply it

Pick a device at home with a dial or display (kitchen scale, bathroom scale, phone battery percentage). Write its function with input, output, units, parameters and domain as you imagine its designer did. Where would extrapolating it be dangerous?

9.Reflect

10.Go further

Concepts: Functions as engineering models · Fitting lines with least squares