The five words
Every model lab is built from the same five things. Learn these and you can build a lab about almost anything that changes over time.
| Word | What it is | Example |
|---|---|---|
| Part | A thing in your lab, with a name and a look (a cup, a tank, a crowd, a ball or a bar). | Coffee |
| Quantity | A number that describes a part: a start value, a unit, and the lowest and highest it can be. | Temperature, 90 ยฐC |
| Rule | How a quantity changes on every tick of the clock. | temperature goes down by cooling ร (temperature โ room) |
| Reader control | A quantity the reader may set the start of. | Cooling rate |
| Check | What success looks like. It is tested over the whole run. | temperature at least 60 ยฐC after 15 minutes |
Your first lab
Open New post โ Problem โ Model lab. The Guide tab ticks these off by itself, and Show me lights up where to click.
- Add a part. Make a new part, or start from one of the four templates and take it apart.
- Give it a quantity. A name, a start value and a unit. Rates are quantities too: "Cooling rate, 0.08 per minute".
- Make it change. Write a rule. The line under it reads it back in plain words, with the value at the start.
- Run it and read it. Press Play. Does it behave the way you expect? If not, look at the rule or a start value.
- Let the reader change something. Switch on Reader can change beside one or two quantities.
- Write a check. It must fail at the start, or readers have nothing to do.
- Show it can be passed. Set the reader controls until the check passes. That's your solution; readers only see it after they answer or reveal it.
Publishing runs everything again on the server: it won't publish a lab whose check already passes, or whose solution doesn't.
Making a part
A name (Coffee, Town, Planet), a look and a colour. The look follows one quantity: a cup changes from cold blue to hot orange, a tank fills, a crowd shows up to 60 dots, a ball grows, a bar rises.
Each quantity has a name, a start value, a unit, and Lowest and Highest values that keep it sensible. Water can't go below 0 litres. The name in rules is made for you: "Room temperature" becomes room_temperature.
Rules, as sentences: "Every minute, temperature goes down by cooling ร (temperature โ room)". A rule can use any quantity in the lab, even another part's. That's how parts affect each other.
Writing rules
You only write the amount. Type it, or build it from the name and sign chips under the box.
| Write | Means |
|---|---|
+ โ ร รท | add, take away, times, divide (you can also type * and /) |
( ) | work this out first: cooling ร (temperature โ room) |
^ | to the power of: speed ^ 2 |
min( , ) max( , ) | the smaller or bigger of two: min(tap, 30) |
sqrt abs exp log sin cos round โฆ | square root, size without sign, and the other usual functions |
pi | 3.14159โฆ |
Three verbs. Goes up by and goes down by change a quantity a little every tick; two such rules on the same quantity add up. Becomes sets it outright after the others, e.g. Fahrenheit becomes temperature ร 9 รท 5 + 32.
Units are on you. A rate "per minute" in a lab whose clock ticks in hours is 60 times too slow. The clock's unit is at the top of the editor; give every rate a unit that matches it.
Five rule patterns
Most school science is one of these, or two of them together.
| Pattern | Rule | Examples |
|---|---|---|
| Grows in proportion | x goes up by rate ร x | bacteria, compound interest, a rumour |
| Heads towards a target | x goes down by rate ร (x โ target) | a cooling cup, a charging battery, a drug leaving the blood |
| Flows in and out | x goes up by inflow โ outflow | a bath, a reservoir, a bank account with spending |
| Two parts interacting | each uses the other: โฆ ร rabbits ร foxes | predators and prey, an epidemic (healthy, ill, recovered) |
| Limits | add ร (1 โ x รท capacity), or set Highest | a population running out of food, a full tank |
Letting readers experiment
- Switch on Reader can change for one or two quantities. More than that and the task turns into guesswork.
- Readers set the start value; your rules take it from there. For a rate, that's simply the rate.
- Lowest and Highest are the slider's ends, so set them to what's realistic.
Writing checks
A condition picks a quantity, a comparison and a number, and when to test it:
- The whole time: the lowest (or highest) value of the run. "Foxes never fall below 5."
- At the end: the last tick. "At least โฌ5,000 after 20 years."
- Afterโฆ: one moment. "At least 60 ยฐC after 15 minutes."
All conditions must hold. A good check fails at the start, can be passed with what the reader may change, and tests one idea. The editor tells you if the first two aren't true.
Why: a task that is already done teaches nothing, and one that can't be done teaches the reader to give up.
Worked examples
The first four are the editor's templates. The fifth is one to build yourself.
| Lab | Parts and rules | Reader | Check |
|---|---|---|---|
| Keep the coffee hot physics, minutes ร 30 | temperature goes down by cooling ร (temperature โ room) | cooling rate | after 15 minutes, temperature โฅ 60 ยฐC |
| Rabbits and foxes biology, years ร 40 | rabbits up by birth ร rabbits โ hunting ร rabbits ร foxes; foxes up by gain ร rabbits ร foxes โ death ร foxes | hunting success | the whole time, rabbits โฅ 5 and foxes โฅ 5 |
| Saving up economics, years ร 20 | money up by money ร interest รท 100 + saving | yearly saving | at the end, money โฅ โฌ5,000 |
| Run a bath maths, minutes ร 20 | water up by tap โ drain ร water | tap flow | the whole time โค 180 L, and at the end โฅ 120 L |
| A cold going round a school health, days ร 30 | three crowds: healthy down by contact ร healthy ร ill; ill up by contact ร healthy ร ill โ recovery ร ill; recovered up by recovery ร ill | contact (hand-washing lowers it) | the whole time, ill โค 60 |
When something's wrong
| Message | What it means | Fix |
|---|---|---|
| I don't know a quantity called "โฆ" | A name in the rule doesn't match any quantity, often a typo. | Use the suggestion, or click a name chip. |
| A bracket "(" is never closed | Every ( needs a ). | Add the missing bracket. |
| Something is missing between โฆ Maybe a ร? | Two things side by side with no sign between them. | Write 2 ร x, not 2x. |
| The numbers run away | A quantity grows without limit, or a rule divides by zero. | Give the quantity a Highest value, or check the rule's signs. |
| Your check already passes at the start | Readers would be done without doing anything. | Make the condition stricter, or start from a weaker set-up. |
| Your solution doesn't pass the check | The values under "Show it can be passed" don't pass. | Move them until the check passes again. |
Using your lab
- As a problem: it's a post like any other. Readers play with it and press Check my answer; the server runs the lab again and marks it.
- In a lesson: add a Try it step and paste the lab's link. Passing its check completes the step.
- In a course: add it as an item; it counts as practice.