Study and science
Check homework and lab work with units that carry through every step, run statistics on your results and solve equations that are awkward to rearrange by hand. When the units in an answer come out wrong, you know to look again at the formula.
Physics with units
Give every quantity its unit and let Varlig keep track. Kilometres per hour, metres per second squared and kilograms combine into the right unit for each answer.
# A car braking hard from 108 km/hspeed = 108 km/h in m/s gives 30 m/sdeceleration = 6 m/s²braking distance = speed^2 / (2 * deceleration) gives 75 mstopping time = speed / deceleration gives 5 smass = 1200 kgkinetic energy = 0.5 * mass * speed^2 in kJ gives 540 kJbraking force = mass * deceleration gives 7,200 Nbraking force * braking distance in kJ gives 540 kJConverting the speed to metres per second first keeps every later answer in SI units, and a force times a distance comes out as work, so the last two lines confirm that the brakes remove all the kinetic energy. If you multiply where the formula should divide, the answer shows a tangled unit such as (m/s)²·m/s² instead of metres, a quick sign to check your working. See Arithmetic with units and Powers and roots.
Constants and textbook units
Data books write units with dots, slashes, brackets and superscripts. Type them as they’re printed and the formula works out in the unit it should.
# Heating half a litre of water by 20 degrees4186 J/kg/°C * 0.5 kg * 20 °C gives 41,860 J# The gravitational constant, as the data book prints itG = 6.674e-11 N·m²/kg² gives 6.674e-11 N·m²/kg²G * 5.972e24 kg * 80 kg / (6371 km)^2 gives 785.5625626253 N1 N in kg*m/s^2 gives 1 kg·m/s²1 kg·m²/s² in J gives 1 J# The speed of sound at sea levelMach 1 in km/h gives 1,225.044 km/h*, · and ⋅ all multiply, ^2 and ² both square, and a bracketed denominator groups everything inside it. Base units that spell out a named unit take its name, so the weight of an 80 kg person comes out in newtons; ask for kg*m/s^2 back and you get exactly that. A heat capacity written J/kgK, with the kelvin run on, reads as J/(kg·K) too. See Units from a textbook or datasheet.
Concentrations and solutions
Chemistry and biology quote the same amount as a percentage, a molarity or parts per million. Varlig converts between them, and treats a fraction of water as a concentration.
# 0.00243 mol made up to 25.0 cm³0.00243 mol / 25.0 cm³ gives 0.0972 mol/L# Saline at 0.9%0.9% in g/L gives 9 g/L# Chlorine at 2 ppm2 ppm in % gives 0.0002%1 ppm in mg/L gives 1 mg/L# Dosing a 200 L tank to 20 ppm20 ppm * 200 L in g gives 4 g# Sea water, about 35 parts per thousand35 ppt of 150 kg gives 5.25 kgA small amount measured into cubic centimetres reads per litre, which is the unit a molarity is quoted in. Parts per million of water weigh as the water does, so a dose in ppm times a volume gives grams. ppt is parts per thousand, as salinity is written. See Parts per thousand, million and billion.
Statistics on lab results
Put repeated measurements in a list to get the mean, the spread and how far you are from the accepted value.
# Pendulum measurements of greadings = [9.74 m/s², 9.86 m/s², 9.79 m/s², 9.83 m/s², 9.88 m/s²]measured = average(readings) gives 9.82 m/s²spread = stddev(readings)spread to 2 sf gives 0.056 m/s²Standard error: spread / sqrt(count(readings)) to 2 sf gives 0.025 m/s²accepted = 9.81 m/s²Difference: (measured - accepted) / accepted as % to 2 dp gives 0.1%average and stddev keep the units of your readings. stddev is the sample standard deviation, the usual choice for repeated measurements. A label before the colon says what each line is, and to 2 sf rounds any line to significant figures, whether it’s a name, a formula or a function’s answer. Write the abbreviation however your subject does: sf, SF, s.f., sig fig and sig. figs all work. A zero that is one of the figures you asked for stays on, so 31.0357 m to 3 sf is 31.0 m rather than 31 m, and the answer shows the precision you actually have. to 2 dp rounds to decimal places instead, and drops trailing zeros. See Summary statistics, Spread and Significant figures.
Solving equations
Give solve an equation, the unknown and a range to search. For simultaneous linear equations, use solve_system.
# Roots of x^2 + 3x - 10 = 0solve(x^2 + 3x - 10 = 0, x, 0, 5) gives 2solve(x^2 + 3x - 10 = 0, x, -10, 0) gives -5# A stone dropped from 45 m: when does it land?solve(4.9t^2 = 45, t, 0, 10) to 2 dp gives 3.03# 2x + 3y = 13 and x - y = -1solve_system([[2, 3], [1, -1]], [13, -1]) gives [2, 3]solve finds one root between the two limits, so choose limits either side of the root you want. Write the equation the way it looks on paper: 4.9t^2 squares t before multiplying. solve_system takes the coefficients row by row and gives x and y in order. See Find one numerical root and Solve a linear system.
Quick maths checks
Check a formula against a direct calculation, or confirm a derivative or an integral before you hand in your work.
# Sum of the first 20 squares, two wayssum(k^2, k, 1, 20) gives 2,87020 * 21 * 41 / 6 gives 2,870# Slope of x^3 - 4x at x = 2derivative(x^3 - 4*x, x, 2) gives 8# Area under x^2 from 0 to 3integrate(x^2, x, 0, 3) gives 9# Ways to choose 3 people from 1010 choose 3 gives 120# Ways to line up 5 people5! gives 120sind(30) gives 0.5When the direct sum and the formula agree, you can trust the formula for bigger numbers. derivative with a point gives the slope there, and integrate gives the area between two limits. See Finite sums and products, Numerical differentiation and Definite integration.
Make it your own
- Turn test marks out of 40 into percentages in one line:
[34, 29, 38] / 40 * 100. - Pace the revision:
40 hours at 4 hours a weekgives 10 weeks, and2 hours in 15 minsplits a session into 8 blocks. - Read a share straight off the figures:
5 kg of 20 kgis 25% and20 min of 1 houris 33.3333333333%. - Work in degrees without switching anything:
cos(30 deg)gives 0.8660254038, and1/4 turn in degreesgives 90°. - Differentiate a formula with constants in it, such as
differentiate(a*x^2 + b*x, x), without givingaandba value first. See Symbolic differentiation. - Check a circuit:
12 V * 2 Agives 24 W, and5000 mAh / 500 mAshows a battery lasts 10 hours. - Find how fast a stone dropped from 45 m lands:
sqrt(2 * 9.81 m/s² * 45 m) to 3 sfgives 29.7 m/s. - Turn a period into a frequency:
1 / 0.02 s in Hzgives 50 Hz, and60 rpm in Hzgives 1 Hz, because both count the same turns. - Work out a U-value from a thickness and a conductivity:
0.27 m / (0.04 W/mK)gives 6.75 m²·K/W, and1 / (6.75 m²·K/W)turns it back into 0.1481481481 W/(m²·K). - Save a formula you use often as a function:
ke(mass, speed) = 0.5 * mass * speed^2, thenke(1200 kg, 30 m/s) in kJ. See Your own functions.