0% found this document useful (0 votes)
37 views25 pages

Electron Collisions Ohm's Law Complex Number Ground Kirchhoff's Voltage Law Voltage Dividers Thevenin Equivalent Circuits

This document is a tutorial on electronics schematics and simulations, offering an integrated approach to understanding electrical engineering concepts through interactive learning. It provides guidance on using CircuitLab software for drawing schematics, running various types of circuit simulations, and enhancing understanding of related mathematical and physical principles. The tutorial includes step-by-step instructions for manipulating components, running DC, time-domain, and frequency-domain simulations, and emphasizes the importance of foundational knowledge in calculus and physics.

Uploaded by

oligo emmanuel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views25 pages

Electron Collisions Ohm's Law Complex Number Ground Kirchhoff's Voltage Law Voltage Dividers Thevenin Equivalent Circuits

This document is a tutorial on electronics schematics and simulations, offering an integrated approach to understanding electrical engineering concepts through interactive learning. It provides guidance on using CircuitLab software for drawing schematics, running various types of circuit simulations, and enhancing understanding of related mathematical and physical principles. The tutorial includes step-by-step instructions for manipulating components, running DC, time-domain, and frequency-domain simulations, and emphasizes the importance of foundational knowledge in calculus and physics.

Uploaded by

oligo emmanuel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

0.

2
Schematics & Simulations Tutorial

0. INTRODUCTION

0.1 Introduction
A free, interactive electronics book that combines the math, the physics, and the engineering
intuition. 3 min read

Electronic systems rule our modern world, bridging the gap between
software and physical reality. From communication to industrial process
control to transportation to entertainment, the field of electronics continues
to grow in reach and complexity. A working knowledge of basic electrical
engineering concepts is now a powerful tool in many fields, and this value is
likely to grow in the coming decades.

The motto of this book is “one level deeper.” I’ve watched thousands of
students of electronics struggle to build an intuition for the topic because
they couldn’t connect the math, the physics, and the practical implications.
In this book, I’ll attempt to change that by presenting an integrated
approach, offering insight that is “one level deeper” than the immediate
topic at hand. For example, have you considered:

 how electron collisions lead to Ohm’s Law’s linearity


 how one complex number represents an entire sinusoidal signal
 how the electrical concept of ground is just a consequence of Kirchhoff’s
Voltage Law
 how voltage dividers and Thevenin equivalent circuits are recursively
related

This is just a small taste of the kind of richly layered understanding that
electronics experts have, but it’s rarely found all in one place.

Let’s fix that.

And let’s do it with hundreds of interactive schematics that you can load,
simulate, change, and simulate again, like this one:
Welcome to CircuitLab
circuitlab.com/c7pq5wm
Edit - Simulate
Exercise Click the circuit above.

When you click, the CircuitLab software opens in a new tab in your browser.
You can run a simulation of the circuit pictured, and then you can modify the
circuit and run it again.

While simulation can never completely replace hands-on electronics


experimentation, it’s a handy tool to make learning electronics faster and
easier.
Corequisites
Studying electronics goes hand-in-hand with calculus, linear algebra,
differential equations, and classical physics (including thermodynamics,
electricity, and magnetism). These are complementary. Studying electronics
will enhance your understanding of calculus as much as studying calculus
will enhance your understanding of electronics.

For online resources in these topics, we recommend these courses which


provide excellent written lecture notes and/or video lectures:

 MIT 18.01 - Single Variable Calculus


 MIT 18.02 - Multivariable Calculus
 MIT 18.03 - Differential Equations
 MIT 18.06 - Linear Algebra
 MIT 8.01SC - Physics I: Classical Mechanics
 MIT 8.02T - Physics II: Electricity & Magnetism
 MIT 8.022 - Physics II: Electricity & Magnetism (Advanced)

0.2
Schematics & Simulations Tutorial
How to draw schematics and run circuit simulations. 12 min read

You can click any schematic in this book to open the circuit in the CircuitLab
circuit simulator software, which lets you edit and simulate circuits in your
browser. The circuit will always open in a new browser tab so you can
continue reading along.

Below are a few brief tutorials to walk you through the essential schematic
drawing and circuit simulation features so you can start building your own
circuits as fast as possible.

Basic Schematic Manipulation


Inrush Current Spike when Switching Capacitive Load
circuitlab.com/c9xrh77yk942d
Edit - Simulate
Click the circuit above and follow the steps below to quickly learn the
Exercise
user interface.

Getting Around
1. Click to open the circuit above.
2. To zoom the schematic:
o use the mousewheel, or
o use a two-finger drag up or down on your touchpad, or
o use the Ctrl-Plus or Ctrl-Minus keyboard shortcuts (Command-Plus
or Command-Minus on macOS), or
o use the zoom in/out controls in the bottom right of the CircuitLab
window, or
o use the Zoom In, Zoom Out, or Zoom to Fit options in the Edit menu
3. To pan around the schematic:
o hold the Ctrl (or Command) key while using your primary mouse
button to drag, or
o hold the middle mouse button (press mousewheel) and drag, or
o switch to Pan mode using the bottom-left button within the CircuitLab
window

Interacting With Components


1. To move a component:
o click and drag on voltage source V1, and move it a few grid lines to
the left
o click and drag the bottom-most horizontal wire, and move it a few
grid lines further down
o Notice that the software keeps the wires connected intelligently. This
feature is called Smart Wires. To disable this feature if it’s not doing
what you’d like, just tap the Alt (or Option, or Esc) key once while
dragging.
2. To rotate a component:
o First, single-click on resistor R1 to select it.
o Then, either:
 press R to rotate clockwise, or
 press Shift+R to rotate counterclockwise, or
 right-click and use the Rotate CW or Rotate CCW options in the
context menu
3. To flip a component:
o First, single-click on resistor R1 to select it.
o Then, either:
 press H to flip horizontally, or
 press V to flip vertically, or
 right-click and use the Flip Horizontally or Flip Vertically options in
the context menu
4. To delete a component:
o First, single-click on resistor R1 to select it.
o Then, either:
 press Backspace or the Delete key to delete it, or
 use the Delete option in the Edit menu, or
 right-click and use the Delete option in the context menu
5. To undo:
o press Ctrl+Z (or Command+Z), or
o use the Undo option in the Edit menu
o right-click and use the Undo option in the context menu
6. To modify a component’s value or appearance:
o First, double-click on capacitor C1 to bring up the properties sheet,
or
o right-click on capacitor C1 and use the Edit Parameters option in the
context menu
o Change the DISP parameter, short for “DISPlay type”, to “Polarized”,
and observe the change on the schematic.
o Change the C parameter, short for “Capacitance”, to 22m / 2 , and
observe the change on the schematic.
o Finally, single-click on any blank space in the schematic to close the
properties sheet.

Adding Components
1. To insert a component:
o First, use the mousewheel or two-finger scroll to scroll within the
toolbox on the left until you find the component you’d like
o Then, either:
 drag the component from the toolbox to your schematic, or
 click the component in the toolbox, and then click in the
schematic
2. To search for components:
o start typing in the search box at the top of the toolbox, or
o press / (frontslash) to bring keyboard focus to the search box
o Search can help you rapidly create components:
 enter 10k to create a 10 kΩ resistor, for example
 or, enter 2.2u to create a 2.2 μF capacitor, for example

Wires
1. To connect wires to your components:
o Hold your mouse over any terminal of any component. A gray circle
will appear.
o Click and drag to draw a wire wherever you’d like it to go.
2. You can also use the wire element from the toolbox.

Saving
1. To save your work, or generate schematic images as PDF, PNG, SVG, or
EPS files:
o press Ctrl+S (or Command+S) to save
o use the corresponding options under the File menu

Great! You’re now ready to draw your own schematics.

DC Circuit Simulation
Power Efficiency of LED and Resistor with Resistor Parameter Sweep
circuitlab.com/c54th39gx3k5e
Edit - Simulate
Click the circuit above and follow the steps below to learn how to run
Exercise
DC circuit simulations.

1. Click to open the circuit above.


2. Click Simulate at the bottom of the screen.
3. Click the DC tab.
4. Click Run DC Solver.
5. Observe the list of outputs. These include:
o voltages
o currents
o power dissipation
o expressions like efficiency, a ratio of powers
6. Mouse over various wires and terminals in the schematic window. The
voltage and current values will appear at the bottom-right.
7. Click any wires or terminals in the schematic to add those voltages and
currents to the list of expressions in the simulation output.
8. Modify the circuit, and then re-run the DC simulation again.

DC Sweep Simulation
Power Efficiency of LED and Resistor with Resistor Parameter Sweep
circuitlab.com/c54th39gx3k5e
Edit - Simulate
Click the circuit above and follow the steps below to learn how to run
Exercise
DC sweep circuit simulations.

1. Click to open the circuit above.


2. Click Simulate at the bottom of the screen.
3. In the DC Sweep tab, look at the simulation settings:
o the Parameter is set to V1.V , meaning the simulator should alter
the voltage of voltage source V1 and use this as the independent
variable on the x-axis of the plot.
o the Sweep Type is set to Linear , meaning the simulator should try
equally-spaced voltages.
o the Start is 0 and the End is 5 , with a Step of 0.01 , indicating that
the simulator should sweep across these voltages: 0.00,0.01,0.02,
…,4.98,4.99,5.00 .
o the optional Second Parameter is enabled, set to try three different
resistor values for the parameter R1.R , the resistance of resistor
R1: 95 Ω,100 Ω,105 Ω .
o the Outputs list has two expressions to plot:
 the first is P(D1)/-P(V1) , which indicates the ratio
of power consumed in diode D1 to the power supplied by V1.
 the second is I(D1.nA) , indicating the current going into the
anode of diode D1.
 You can add new outputs using the + Add Expression button.
 It’s usually easier to add new outputs just by clicking various
nodes and terminals on the schematic.
o the optional Advanced Graphing… window contains settings about
how and what to plot.
4. Click Run DC Sweep. The simulation results are calculated and the
results are plotted.
5. Mouse over any traces to see values along the curve.
6. Click and drag to zoom in to any region of the plot. Double click to
zoom out again.
7. Pull out green horizontal and vertical markers from the edges of the
graph windows to measure features of the plot.
8. Right click in the plot for a context menu.
9. At the top-right of the plot window, use Export Plot Images or Export
Plot CSV to export simulation results.

Time-Domain Simulation
Inrush Current Spike when Switching Capacitive Load
circuitlab.com/c9xrh77yk942d
Edit - Simulate
Click the circuit above and follow the steps below to learn how to run
Exercise
time domain circuit simulations.

1. Click to open the circuit above.


2. Click Simulate at the bottom of the screen.
3. In the Time Domain tab, look at the simulation settings:
o the Start Time is almost always 0 . Setting it to any higher number
simply starts the plot later.
o the Stop Time is set to 50m , which means 50 milliseconds (0.050
seconds). Check out the Human-Friendly Inputs section of the
documentation and the Orders of Magnitude, Logarithmic Scales, and
Decibels section of this book on these metric prefixes.
o the Time Step is set to 10u , which means 10 microseconds
(0.000010 seconds). This sets the resolution of the simulation.
 Choose a smaller time step number here for a higher-resolution
simulation.
 Choose a larger time step for less processing time required to run
the simulation.
 As a rule of thumb, a reasonable time step to start with
is 110 to 120 or so of the period of the highest frequency you’re
interested in. For example, if you have a circuit operating at 1000
Hz, which is a period of 11000 Hz=1 ms , you should aim for a time
step of no more than 50u or 100u.
 Note that the Stop Time and Time Step also accept expressions. If
you’re looking at behavior at 60 Hz, for example, you can set the
stop time to be 1/60 * 10 for ten for cycles, and the time step to
be 1/60 / 20 for 1/20th of a cycle as a simulator time step.
 Another quick rule of thumb is to pick a time step about 1/1000th
as long as your stop time.
 If you’re not sure, start with more finely-grained timesteps for
more accurate results.
o the Skip Initial is set to No. This is the normal behavior.
 Skip Initial = No is the default. It means that the simulator will
first try to find a DC solution to cover the initial operating point
state of the circuit at time t=0 , before the time-domain
simulation begins.
 Skip Initial = Yes should be used sparingly. It means that the
simulator will treat all capacitors and inductors as discharged
before t=0 .
 The recommended way of controlling the initial conditions is to
use switches or the Voltage/Current Step Source elements, rather
than using the Skip Initial mode. Skip Initial tends to cause issues
with more advanced components like transistors.
o the Outputs list has one expression to plot:
 I(F1.nB) indicates that the simulator should plot the current
going into one of the terminals of the fuse F1.
 You can add new outputs using the + Add Expression button.
 It’s usually easier to add new outputs just by clicking various
nodes and terminals on the schematic.
o the optional Advanced Graphing… window contains settings about
how and what to plot.
4. Click Run Time-Domain Simulation. The simulation results are
calculated and the results are plotted.
5. Mouse over the blue trace to see values along the curve.
6. Click and drag to zoom in to any region of the plot. Double click to
zoom out again.
7. Pull out green horizontal and vertical markers from the edges of the
graph windows to measure features of the plot.
8. Right click in the plot for a context menu.
9. Right click on the I(F1.nB) within the plot’s legend to bring up options
to calculate the integral, RMS, or average values of a signal. Adjust the
green vertical markers to specify the time window over which to perform
the calculation.
10. At the top-right of the plot window, use Export Plot
Images or Export Plot CSV to export simulation results.

Frequency-Domain Simulation (Bode Plot)


Op-Amp Non-Inverting Amplifier: Bandwidth versus Gain
circuitlab.com/ceve6hbrgydvv
Edit - Simulate
Click the circuit above and follow the steps below to learn how to run
Exercise
frequency domain circuit simulations.

1. Click to open the circuit above.


2. Click Simulate at the bottom of the screen.
3. In the Frequency Domain tab, look at the simulation settings:
o the Input is set to V1 , the name of a voltage source. For frequency-
domain analysis, the input source must always be a voltage or
current source in your circuit.
o the Start frequency is set to 1 Hz.
o the Stop frequency is set to 1e8 Hz, or 100 MHz. As above, you may
also specify values like “100M” for 100 MHz, or “5G” for 5 GHz.
o the Points/Decade is set to 20 . This will make calculations at twenty
different points per decade of frequency, evenly spaced on a
logarithmic frequency scale.
 Use more Points/Decade if you’re studying a narrow-band
phenomenon, like a resonance or high-Q filter. It can make sense
to use 1000 points/decade or more in these situations.
 Use fewer Points/Decade to make the simulation calculations run
faster if you need less resolution.
 As a rule of thumb, when in doubt, 20 points/decade is a good
starting point.
o the optional Sweep Parameter is set to R2.R , meaning the
simulator should change the resistance of the resistor named R2.
o the Sweep Type is set to Custom , with two comma-separated values
specified: 9k,99k , indicating the simulator should first simulate the
circuit R2=9 kΩ , and should then try the circuit again with R2=99 kΩ .
Both results will be plotted together for easy comparison.
o the Outputs list has two expressions to plot:
 DB(MAG(V(out))) indicates the magntiude of the output voltage
signal, relative to the input, in a logarithmic decibel scale. +20dB
would indicate the output voltage was 10X larger than the input,
and +40dB would indicate 100X larger.
 PHDEG(V(out)) indicates the phase angle, in degrees, of the
output voltage signal, relative to the input. See the section
on Complex Numbers for more.
 These two plots together are conventionally called a Bode plot.
 You can add new outputs using the + Add Expression button.
See the expressions documentation for more information about
how to handle the complex-valued results.
 It’s usually easier to add new outputs just by clicking various
nodes and terminals on the schematic.
o the optional Advanced Graphing… window contains settings about
how and what to plot.
4. Click Run Frequency-Domain Simulation. The simulation results are
calculated and the results are plotted.
5. Mouse over the blue trace to see values along the curve.
6. Click and drag to zoom in to any region of the plot. Double click to
zoom out again.
7. Pull out green horizontal and vertical markers from the edges of the
graph windows to measure features of the plot.
8. Right click in the plot for a context menu.
9. At the top-right of the plot window, use Export Plot Images or Export
Plot CSV to export simulation results.

More About CircuitLab


CircuitLab has many video tutorials to help you get started with the software.
We highly recommend watching a few videos to learn how to make use of all
the drawing and simulation features.

There’s also documentation.

1.2
Orders of Magnitude, Logarithmic Scales, and Decibels
1.1
Algebraic Approximations
Asymptotic and intermediate approximation techniques for back-of-the-envelope problem solving. 9
min read

The behavior of an electronic circuit can be described by a system of


equations. However, that system is often large and nonlinear. It is often
impractical to find the exact algebraic solution to these systems.

One of the most common tools engineers (of all kinds!) use to make this
complexity manageable is to make algebraic approximations when it’s
safe to do so. While you may have seen these techniques previously, here’s
a quick refresher in context.

For the next few sections of approximations, we’ll consider this simple
function y(x) as an example to explore a few approximation techniques:
y(x)=11+x
This equation is not a linear relationship, but it (or a similar looking fraction)
often comes out of many circuit networks. From this one function, we can
make three types of algebraic approximations:

 Large Asymptotic Approximation: |x|≫1


 Small Asymptotic Approximation: |x|≪1
 Intermediate Approximation at a Point: for example, at x≈1

Large Asymptotic Approximation


For “large” x , we really mean |x|≫1 (read as “the absolute value of x is
much greater than 1”) in this case. That’s because the denominator
of y(x) is 1+x , and:
1+x≈xfor x≫1
(You should read the squiggly equals sign ≈ as “is approximately equal to.”)
This is just saying
that 1+1000=1001≈1000 and 1+1000000=1000001≈1000000 , an
approximation which seems to get better as x gets bigger. (We can similarly
handle the x→−∞ case but will keep it positive herein for simplicity.)
Note that we’ve chosen 1 as our comparison point because it’s the other
addend in the denominator, and we’re considering which addend (x or 1 )
dominates the denominator and thus the entire expression. If our expression
were 1200π+x , we’d use |x|≫200π as our comparison point.
Let’s put a “hat” over our original function y(x) so that we call our
approximation ^y(x) . Plugging our approximated denominator back into our
formula to get an estimate for the fraction:
^y1(x)=1x
This is only an approximation for the original function y(x) , but it’s an
increasingly good one as x→∞ .
Error in Large Asymptotic Approximation
How good is this approximation? We can consider the approximation
error e1(x) :
e1(x)=^y1(x)−y(x)=(1x)−(11+x)=(1+x)x(1+x)−x(1+x)x=(1+x)
−xx(1+x)=1x(1+x)=1x+x2
It may seem a bit circular, but we can actually use our approximation

then x2≫x . In regards to the denominator of e1(x) , we can then say


technique again on the error function. Since we are assuming that x≫1 ,

that x+x2≈x2 , and the error is approximately:


^e1(x)=1x2
This means that if x=1000 then our approximation error due to
using ^y1(x) instead of y(x) is about one part in a million. Whether that’s
close enough for any particular situation is for you to determine, but in many
practical cases, being off by only one part in a million is much better than
many manufacturing tolerances or noise sources, so using the approximation
may be a very reasonable choice.
Limit of Large Asymptotic Approximation
In fact, depending on the structure of our equations and for really huge
values of x , it might be appropriate (though usually is not!) to take the full
limit of x→∞ :
limx→∞^y(x)=limx→∞1x=0
Note that the limit of the original y(x) is also the limit of the
approximation ^y1(x) .
However, if you’re not very careful in taking approximations, it is very
dangerous to remove too much information. Your approximations will quickly
mislead you if you always assume that 11+x≈0 – be warned!
Approximations Gone Wrong
If you look closely, the idea above that

x2+x≈x2for x→∞
may seem a bit strange. In fact, the absolute error in this approximation
itself actually grows as x→∞ . That’s because we’re speaking about the
approximation colloquially in the context of the overall problem, rather than
strictly in a mathematical sense.
The generally accepted and more strict definition of a good asymptotic
approximation involves a limit (in the calculus sense) and a fraction:

^y(x)≈y(x)for x→∞if and only iflimx→∞^y(x)y(x)=1


In using this fractional limit to define the ≈ approximate equivalence, we’re
treating y and ^y as multiplicative terms or divisors. When defining
approximations in this way, multiplication and division are generally OK, but
you generally want to avoid or be very careful when taking approximations
that will get added or subtracted from other approximations. That’s because
additive or subtractive cancellation can make your terms of interest
disappear if you’re not careful.
If you’re ever unsure of whether it’s safe to make an approximation, try to
solve using the full, un-simplified function, and see if the solution matches
the approximation closely enough. Alternatively, create a higher-order
approximation, where you include one or two more terms below the most-
significant term.

Small Asymptotic Approximation


For “small” x , by which we really mean |x|≪1 , a new approximation is
needed for our function y(x)=11+x .
At x=0 :
y(x=0)=11+0=1
But what happens if x is not exactly zero, but is simply small?
Suppose x=1100 :
y(x=1100)=11+1100y(x=1100)=100100+1y(x=1100)=100101y(x=1100)=0.
9900990099…
If you have a calculus background, the simplest way to get a linear
approximation near x=0 is to take the derivative of y(x) there and use it to
construct a tangent line:
y′(x)=dydxy′(x)=ddx(11+x)y′(x)=ddx(1+x)−1y′(x)=−(1+x)−2y′(x)=−1(1+x)2y
′(0)=−1(1+0)2y′(0)=−1
Now that we have the point value y(0)=1 and the derivative value y
′(0)=−1 we can construct the tangent line:
^y2(x)=y(0)+y′(0)⋅(x−0)^y2(x)=1+(−1)⋅(x−0)^y2(x)=1−x
At the end of the day, we now have the approximation that:

11+x≈1−xfor |x|≪1
This is a very useful approximation and we might see it in other formats. For
one example, consider the ratio of resistances:

z=R1R1+R2
This fraction comes up in the analysis of every resistor divider. We can factor
out R1 from the denominator and find:
z=R1R1(1+R2R1)z=11+R2R1z=11+x
If we simply define x=R2R1 , the ratio of resistances, then our
function y(x) and all the approximations we’ve developed here apply to the

If R2≪R1 (and both R1>0 and R2>0 as is typical of all real resistors), then |x|
resistor divider problem.

≪1 , and we’re back to our approximation above.


Suppose, for a practical example, that R1 represents the input impedance of
one amplifier stage, and R2 represents the output impedance of the previous
stage. In that case, z represents the voltage transfer ratio between stages,
and we might want to make sure it was as close to 1 as reasonably possible.
For example, if we knew that x=R2R1=0.01=1% (i.e. that there was a 100X
ratio between the resistances), we could now quickly estimate the voltage
transfer ratio as approximately:
^z=1−0.01=0.99=99%
This is just an easier and more intuitive calculation to reason about than
using the full exact form:

z=11+0.01
which, for most people, is harder to think about directly!

Intermediate Approximation at a Point


So far we’ve handled “extreme” cases: making simplifying approximations
when |x|≪1 and when |x|≫1 . But suppose we want to find a simplified
approximation at some intermediate point that is neither very large nor very
small.
One easy way to do that is by using the same tangent line approach we used
for the small asymptotic approximation, but instead of using x=0 as our
anchor point, use the x value in the middle of the range we want to
approximate.
For example, suppose again we are looking at a resistor divider but now we
have the case where R1≈R2 , so x=R2R1≈1 . Perhaps, due to imperfect
manufacturing or biasing tolerances, the resistances are not exactly equal,
but are close, and we want a simplified formula to describe the voltage
transfer ratio in these cases.
The exact formula is still the same:

y(x)=11+x
But, for values of x close to 1, we can approximate this fraction with a
simpler expression that doesn’t have an x in the denominator. Here’s how
we can construct the tangent line around the point x=1 :
^y3(x)=y(1)+y′(1)⋅(x−1)^y3(x)=12+(−14)⋅(x−1)^y3(x)=34−14x
In fact, we can use CircuitLab just as a plotting engine to generate a graph
showing how good this approximation really is.

Plotting Tangent Line Approximation


circuitlab.com/csg9y465e22fs
Edit - Simulate
Click the “circuit” shown above, then click “Simulate”, then “Run DC
Exercise
Sweep”. You’ll see that the tangent line is a very good approximation for
values of x≈1 , and is a bad approximation far away from that point.
As an exercise, modify this “circuit” to also plot the other approximations
for y(x) , specifically:
^y1(x)=1xfor x→∞^y2(x)=1−xfor |x|→0^y3(x)=34−14xfor x≈1
You may have to adjust the range of values swept for x to make a
reasonable-looking plot. Look at how each approximation is mostly good over
a particular range, but then diverges when moving further away from that
approximation point.
We’ll talk more about linearization later in the Linear & Nonlinear section.

Other Approximation Techniques


The tangent line approximation minimizes the approximation error to 0 at
one particular point, but does not necessarily optimize behavior at other
points.

If we had to approximate some nonlinear function f(x) (possibly even


experimentally derived rather than algebraic) over some bounded range of
input values [x1,x2] , there are several ways we could imagine doing it:

1. Compute the tangent line at the midpoint, xmid=x1+x22 . This would


minimize error in the middle of the range, but does nothing to guarantee
good approximation over the rest of the range.
2. Linear interpolation between the two endpoints. If we
have y1=f(x1) and y2=f(x2) then we can just draw a line between these
two points:

^y(x)=y1+(x−x1)⋅(y2−y1x2−x1)

This would minimize error to zero at the two endpoints, but does nothing
to guarantee good approximation in the middle of the range.

3. Some line that is anchored neither at the endpoints nor midpoints. For
example, if we want to minimize the maximum approximation error over
the entire range, we may have to construct a line different from either
#1 or #2. This could be done numerically (for example, a linear least
squares approach might work) or graphically. This approximation may be
“better” in a practical way; for example, our approximations in #1 and
#2 may be off by 20% at some point along the curve, but our
approximation in #3 might be off by only 5% at its worst.
Here’s a quick example: let’s plot three different approximations for:

g(x)=(x−3)3for 3≤x≤5
The midpoint tangent line, endpoint linear interpolation, and linear least
squares approximations over this range are:

^g1(x)=3x−11^g2(x)=4x−12^g3(x)=3.606x−12.414
Plot these three approximation functions against the original:
Midpoint Tangent, Endpoint Interpolation, and Linear Least Squares
circuitlab.com/c5454x2ae58pt
Edit - Simulate
Click the “circuit” shown above, then click “Simulate”, then “Run DC
Exercise
Sweep”. All approximations have some error, but if you had to pick one,
which of the three approximations do you think is best?

Additionally, these techniques can be combined with preprocessing the


function to make it more linear. For example, f(x) itself may not be very
linear, so it may be better to approximate something else
like logf(x) or √ f(x) with a straight line. This may dramatically improve the
approximation while adding only a little bit of complexity.

What’s Next
In the next section, Orders of Magnitude, Logarithmic Scales, and Decibels,
we’ll use the approximations we’ve made here and see how they combine
with logarithms to form very powerful tools for understanding how a function
behaves over a wide range of input and output values.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy