SME
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
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
✓
← Previous lesson
Element-wise or matrix product
Next lesson →
Exponential rate from two points on a semilog plot
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.
More problem types
Exponential rate from two points on a semilog plot
Use this for “Data points (0, 5) and (4, 20) lie on a straight line on semilog axes. Find k in y = y₀ekx.”
Which axes make the data straight
Use this for “Should data from y = 3e0.5x go on plain, semilog or log–log axes?”
Read and plot a data file
Use this for “Put the steps in order to plot load against extension from a test machine’s CSV file.”