PHYS 3330
Physics Undergraduate Labs
Prelab Expectations and Recommendations
Prelabs are essential activities designed to prepare you for the lab. They are due before lab (see Canvas for due dates) and are graded on completion. However, correctness matters—if your prelab work is wrong, you will struggle in lab. Collaborate with peers and come to office hours to make sure you are properly prepared.
1 Why Prelabs Matter
Prelabs are not busywork. They are the cognitive preparation that allows you to focus on experimental challenges during lab rather than simultaneously trying to understand theory, operate unfamiliar equipment, and troubleshoot circuits.
Manage cognitive load: Labs involve equipment operation, troubleshooting, data collection, and analysis. If you are also trying to derive transfer functions or understand complex impedance during lab, you cannot focus on the experimental skills. Prelabs offload the conceptual work so lab time can focus on doing science.
Make predictions: Physics learning research shows that making predictions before experiments—and then confronting discrepancies—is central to learning. Prelabs are not about “getting the right answer”; they are about having an expectation that can be tested. If your measurements match your predictions, you gain confidence in your understanding. If they differ, you have something interesting to investigate.
Build ready-to-use tools: When you arrive at lab with a working Python function and an LTspice simulation, you have predictions that can immediately be compared to measurements. You can update your functions with measured component values and get new predictions in seconds.
2 What You Should Accomplish
For each prelab, aim to:
- Build a conceptual model of the circuit or system—understand what it does and why
- Develop quantitative predictions (transfer functions, expected voltages, frequency responses)
- Create computational tools (Python functions) that can be updated with measured values
- Simulate the circuit in LTspice to verify your analytical understanding
3 Foundational Resources
Before beginning the prelabs, ensure you are comfortable with these foundational skills:
Complex numbers: Labs 3–6 involve transfer functions with magnitude and phase. If expressions like \(T = 1/(1 + j\omega RC)\) look unfamiliar, review the Complex Numbers resource. Work through Practice Problems 1 and 2 at minimum.
LTspice simulation: Every prelab includes simulation work. The Lab 1 prelab walks you through your first LTspice simulation. If you have never used circuit simulation software, watch the tutorial videos linked in Lab 1 before attempting the simulation questions.
These resources are not “extra”—they are prerequisites for effective prelab work.
4 Prelab Readiness Checklist
Before arriving at lab, ask yourself:
Conceptual: Can I explain, in words, what the circuit does and why? (e.g., “This low-pass filter attenuates high-frequency signals because the capacitor impedance decreases at high frequency”)
Quantitative: Do I have numerical predictions for the key measurements? (e.g., “The cutoff frequency should be around 16 kHz given my component values”)
Computational: Can I update my Python functions with measured component values and immediately get new predictions?
Simulated: Does my LTspice simulation match my analytical prediction? If not, do I understand why?
Procedural: Do I know what I will build and what I will measure in lab?
If you cannot answer “yes” to all five, you are not ready. Come to office hours or collaborate with peers.
5 Working Effectively with Python
5.1 Modularize your work
You will be asked to perform calculations in the prelab using predetermined or given values. For example, you may be asked to calculate the parallel resistance of 2 resistors
\[\frac{1}{R_\text{total}} = \frac{1}{R_1}+\frac{1}{R_2}\]
using \(50\ \Omega\) and \(100\ \Omega\). When you get to lab and grab those resistors, you will measure them and they could be something like \(50.5\ \Omega\) and \(98.4\ \Omega\). It will save you time to write your calculations as functions (in Python, Mathematica, etc.) so that you can re-call the function with updated input values.
For example (in Python) instead of
r = 1. / (1. / 50. + 1. / 100.)Write a function instead:
def parallel_r(r1, r2):
return 1. / (1. / r1 + 1. / r2)
print(parallel_r(50., 100.))This way you can re-call the function later in lab with the updated values, rather than copy-pasting code and manually editing numbers.
5.2 Recycling functions
Many of the functions you build could be used several times throughout the course. The parallel_r() function above is a great example of one you may use repeatedly.
A good way to keep all your functions accessible is to create a .py file in your working directory. You can call it whatever you want, but for this example we will call it jlab.py.
In jlab.py you can collect all your functions, and then in your Jupyter notebooks, import and use them like this.
import jlab as jl
print(jl.parallel_r(50.5, 98.4))5.3 Common functions you will build
Throughout the course, you will develop functions for:
- Lab 1–2: Parallel/series resistance, voltage divider transfer function, power calculations
- Lab 3: Filter transfer functions (magnitude and phase), cutoff frequency, Bode plot generation
- Lab 4–5: Op-amp gain calculations, bandwidth, input/output impedance
- Lab 6: Photodiode current, transimpedance gain
- Lab 7–8: Transistor operating point calculations, load lines, curve fitting
- Lab 9–10: 555 timer frequency/duty cycle, ADC conversion
Keep your jlab.py organized and commented—it becomes a valuable reference.
6 Common Pitfalls to Avoid
Treating prelabs as homework to “get done”: If you complete your prelab without understanding what you calculated, you will be lost in lab. Check: Can you explain, without looking at your notes, what your transfer function means physically?
Copy-pasting code without understanding: The point of writing functions is not just efficiency—it is building tools you understand. If you copy a function from a peer, make sure you can explain what each line does.
Skipping the simulation because the math is “right”: LTspice is a second model. Comparing your analytical prediction to your simulation is a check on both. Discrepancies are learning opportunities.
Ignoring units and orders of magnitude: A transfer function of 0.7 at 1 kHz should make sense given your component values. If your Python function returns 0.0007 or 7000, something is wrong.
Waiting until the night before: Prelabs often reveal gaps in understanding. Give yourself time to get help if needed.
7 Technical Details
7.1 Including images and scans
If you make a directory called images in your working directory and place all your images in there, you can include them in a Markdown cell with:

For hand-drawn circuit diagrams or derivations, scan or photograph them clearly and include them the same way.
7.2 Exporting to PDF
You can export Jupyter notebooks to PDF directly through VS Code. Here’s more info on setting up.
7.2.1 HTML alternative
If you’re having trouble exporting to PDF, you can export to HTML and then convert the HTML to PDF with an online tool like Cloud Convert.