Hello,
I’m considering using PLECS as a simulation environment to support an undergrad course in fundamental circuit analysis. PLECS is very well suited for teaching time-domain response, and of course handles DC resistive circuits nicely.
What I find harder is using it to solve phasor/AC circuits for teaching purposes. Given a simple single-frequency AC circuit where I want students to see complex power and voltage/current phasors, the most straightforward route seems to be: FFT blocks on the voltage and current measurements, a Polar-to-Cartesian conversion to extract real/imaginary components, and then some computational blocks to build complex power and split it into P and Q.
This is fine for research/development, but it’s a lot to expose to undergrads who are just learning phasor analysis. Is there a faster or more “teaching-friendly” way to get phasor and complex power readouts in PLECS?
Of course, I considered building a custom “Wattmeter” component (masked subsystem) to hand out to students, but I’m not sure that would actually be much simpler for them than seeing the FFT/conversion blocks directly (it just moves the complexity somewhere else).
Thanks to everyone.
I don’t have much experience in teaching undergraduate courses, but I can share some of my thoughts to contribute to the discussion.
If I were in your shoes I would consider creating custom blocks for your students. You don’t want students to get bogged down into wiring all these signal processing blocks together in strange ways. It leaves a lot of room for simple connection errors. Even with higher level blocks models could get cluttered. I’ll also point out that the Fourier scope in PLECS does provide magnitude and angle, but it’s sensitive to cursor placement and would be a bit clunky for your purposes.
The other aspect that I imagine students find perennially difficult is the consistency of the phasor representation. Is magnitude peak (matches the time-domain waveforms but need factor of 1/2 for power) or RMS (doesn’t match scope peak but makes power calculation more straightforward). Do students prefer radians or degrees for angle? Can you design blocks that are consistent and remove these sources of confusion? Can you ensure that they don’t mash different conventions together?
I’ll also note these components do not need to be black boxes. What’s inside the box could be revealed over time since the subsystems can be inspected. For example, you can derive a simple DFT-based solution to get the phasor components of ideal sinusoids in PLECS with basic trigonometry that students should be familiar with. That might be less intimidating than a mysterious FT block.
With that said, I sketched out a few concepts for library blocks. I’m sure they could be further refined, but I hope it provides a starting point for your ideas.
rlc_teaching.plecs (82.3 KB)
For the DFT:
v(t) = V·sin(θ+φ) = V·cosφ·sinθ + V·sin φ·cosθ = a·sinθ + b·cosθ
where a = V·cos φ and b = V·sin φ
v(t)·2·cosθ = a·(2·sinθ·cosθ) + b·(2cos²θ) = a·sin2θ + b(1 + cos2θ)
v(t)·2·sinθ = a·(2·sin²θ) + b·(2·sinθ·cosθ) = a(1 − cos2θ) + b·sin2θ
Both sin2θ and cos2θ average to zero over a full cycle, you can apply moving averages return a and b directly. From there one can determine the mangnitude and phase.
You’ll notice this is very similar to the implementation of the Fourier Transform block in the PLECS library.
1 Like
Dear Bryan, thank you very much for being so present on this forum.
Radians and degrees are something that I explain at the beginning of the course and for this reason there is not much confusion on which one to use… peak/RMS is a different story. The physical meaning is easily understood, but the tendency of confusing the quantities during exercises is very, very common. Moreover, the undergrads in question did not study Fourier analysis yet. Probably explaining it through the DFT could be an interesting opportunity to introduce the topic.
Thank you for the block library and the various ideas, they will surely come in handy during the upcoming classes.
Happy to contribute to the discussion. Look forward to hearing about the solutions you develop and lessons learned from your class.