Engineering Programming (MATLAB/Python)

Plotting and data import

Use this for “Data points (2, 10) and (8, 80) lie on a straight line on log–log axes. Find n and a in y = axⁿ.”

Chart

0.11101000.1110100100010⁴x, log scaley, log scalex₁ = 2x = 8, y₂ = 80
y(x) = 3.536x1.5
Log–log axes: a power law draws as a straight line.
This is an example. Type your own values to start a new problem.
y₁
=
a
×
x₁
y₂
=
a
×
x₂

Formulas

n
=
log(
y₂
÷
y₁
)
log(
x₂
÷
x₁
)
1.5
=
log(80 ÷ 10)
log(8 ÷ 2)
y₁
=
a
×
x₁
n
10
=
3.5355
×
2
1.5
y₂
=
a
×
x₂
n
80
=
3.5355
×
8
1.5

Assumptions

•
The data follow y = axⁿ, so log y = log a + n log x: a straight line on log–log axes.
•
Both points have x > 0 and y > 0; a log axis has no place for 0 or a negative.
•
n is the line’s slope on log–log axes, the same in any log base; a is y at x = 1.

Step-by-step

WE KNOW
x₁ = 2, y₁ = 10, x₂ = 8, y₂ = 80
FIND
exponent (n), coefficient (a)
Step 1 · Find exponent (n)
Use n = log(y₂ ÷ y₁) ÷ log(x₂ ÷ x₁)
On log–log axes the slope is the rise in log y over the run in log x.
n
=
log(80 ÷ 10)
log(8 ÷ 2)
n
=
log(8)
log(4)
n
=
0.9031
0.6021
n
=
1.5
Step 2 · Find coefficient (a)
Use y₁ = a × x₁ⁿ
Put the first point into y = axⁿ and divide by x₁ⁿ.
a
=
y₁
x₁
n
a
=
10
2
1.5
a
=
10
2.828
a
=
3.5355
Check
Put the numbers back in. Both sides should match.
1.5
=
log(80 ÷ 10)
log(8 ÷ 2)
✓
10
=
3.5355
×
2
1.5
✓
80
=
3.5355
×
8
1.5
✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.

More problem types

© 2026 SME. All rights reserved.