Message Boards Message Boards

6
|
4478 Views
|
29 Replies
|
19 Total Likes
View groups...
Share
Share this post:
GROUPS:

[WSG24] Daily Study Group: Introduction to electric circuits

Posted 6 months ago

A Wolfram U Daily Study Group focusing on the beauty of Electrical Engineering begins on the 24th of June.

Join @Leonardo Laguna Ruiz, @Ankit Naik and a group of fellow learners to explore the fundamentals of electrical engineering. You will learn the basic concepts in an intuitive and accessible way. We will delve into analysis methods that will enhance your understanding of how electric circuits work. Next, we will focus on operational amplifiers and their versatile applications, such as solving equations, designing filters, and creating fundamental building blocks for analog synthesizers and analog computers.

This study group is suitable for both beginners and experienced engineers looking to refresh their knowledge and learn new analysis techniques. No prior Wolfram System Modeler or Wolfram Language experience is required to join the study group.

Please feel free to use this thread to collaborate and share ideas, materials and links to other resources with fellow learners.

We look forward to seeing you: June 24th-June 28th & July 8th-July 12th, 11am-12pm CT (4-5pm GMT). Due to the US Independence Day holiday, this Study Group will break during the week of July 1 and resume on July 8.

REGISTER HERE

enter image description here

POSTED BY: Ankit Naik
29 Replies

Hi Ankit;

In calculating both the amplitude and phase angle in electrical circuits, that contain capacitors and inductors, there is a technique called Phasors - which greatly simplifies the calculations. The phasor calculations are easily performed using my TI-89 calculator but cannot find a similar method using Mathematica. However, I would much prefer to use Mathematica. Does Mathematica have something similar to Phasors or is there a recommended method to calculating amplitudes and phase angles in Mathematica?

Thanks,

Mitch Sandlin

POSTED BY: Mitchell Sandlin
Posted 5 months ago

Mitch, phasors can simply be represented as complex numbers, and the Wolfram Language primitives deal just fine with manipulating complex numbers and then extracting the phase/magnitude after doing those manipulations. I asked ChatGPT (4o) your question, and it returned a completely competent answer:

https://chatgpt.com/share/2d90bf49-19af-43f7-8d7c-18c935d35a88 .

In general, ChatGPT is great for generating little code fragments of Wolfram Language code for questions just like this. Just keep in mind that all of the LLMs will create slightly or completely wonky answers from time to time. Trust, but verify.

POSTED BY: Phil Earnhardt
Posted 5 months ago

Also, there are multiple examples in the Wolfram Demonstrations project that mention phasors. You can download, run, and peruse the source code for each of these little projects.

POSTED BY: Phil Earnhardt

Hey Ankit,

Did you see my previous post?

Here is the thing. The learning curve for learning how to use System Modeler is steep. It doesn't really follow the paradigm of Wolfram Language. I start to think I am getting the hang of it, but then I get these weird curve balls. My purpose for following this class is not so much to learn circuit design, but it's to learn how to use System Modeler effectively in circuit design. That's not the emphasis for this class as it turns out, but still, a little help might convince me to buy the too or convince me to convince my corner of Boeing to buy the tool.

POSTED BY: Carl Hahn

In taking the quizzes, I would like to verify Question 2 in Quiz 1 and Question 6 in Quiz 2, in which I answered B and C respectively. If my answers are in fact incorrect, would someone please explain why.

Thanks,

Mitch Sandlin

POSTED BY: Mitchell Sandlin
Posted 6 months ago

Wolfram U prefers that students not discuss quiz answers in the DSG for a course. You should e-mail wolfram-u@wolfram.com or you can put info in the feedback form that pops up at the end of each lecture.

FWIW, I'll also be providing them feedback to the quizzes.

POSTED BY: Phil Earnhardt

I have checked the questions you mention and it seems that the answer key is incorrect, so the options we took as correct are wrong. I will update the quiz to reflect the correct answers.

Posted 5 months ago

I have checked the questions you mention and it seems that the answer key is incorrect, so the options we took as correct are wrong. I will update the quiz to reflect the correct answers.

Leo, I just had my score on Quiz 1 re-checked. I refreshed the course framework (in my Safari browser). The suspect question is still getting flagged as incorrect. As far as I can tell, the quiz answer sheet has never been updated with the correct answer. It's been almost 3 days since the errors on Quiz 1 and Quiz 2 were reported and over 2 days since you said that they would be fixed. Please fix them promptly. There's some in-course joke I should say about hysteresis at this point, but I can't quite figure out what it is. :)

I apologize for sending this message to the public forum, but this is the only means we're given to contact the instruction staff. If this were in an in-person class, I would speak directly with the teacher or the TAs.

POSTED BY: Phil Earnhardt

Hi Phil,

Thank you for your ongoing participation and feedback in the Wolfram U Study Groups. I apologize for the delay in updating the framework; our developer is currently serving as a Mentor at the Summer Research Program and is only sporadically available this week. We strive to thoroughly test the course internally before sharing it, but as we've mentioned throughout the series, this is a beta version and minor errors are expected.

The framework will soon be updated with bug fixes, the final exam, and exercises, and we will notify registrants when they are ready for review. Please note that quiz notebooks saved to your personal cloud account will need to be deleted before retaking them, thank you for your patience.

Please continue to send us your feedback, it is always appreciated. Have a wonderful weekend!

Cassidy Hinkle

Wolfram U Team

POSTED BY: Cassidy Hinkle

Thanks for the posts, Ankit.

I am running through the Wolfram U package for System Modeler (Wolfram System Modeler: An Introduction) and when I got to section 3 (Create Components and Animations) we are asked to work through building a pendulum simulation. As best as I can tell, I've had duplicated all the instructions both on the video and the down loaded notebook, but I get the following error message when I first run the simulation:

"14.0.017201150762775915755.sim Error: No unit information generated/Users/carlj.hahn/Library/Caches/com.wolfram.SystemModeler/WolframSystemModeler-14.0/sme.14.0.017201150762775915755_units.json Build failed at 10:44:39 (took 00:02)."

I have no idea what that means. Do you?

POSTED BY: Carl Hahn

Hi Carl,

It looks like the error you're encountering is due to the use of an older version of the Modelica standard libraries in your model. This can cause compatibility issues.

enter image description here

Specifically, the DCMotor component in the model is outdated and uses an older Modelica version component name ( Modelica.Electrical.Analog.Basic.EMF EMF(k = 2) "DC motor electro motoric force";)

By replacing it with the rotationalEMF component (Modelica.Electrical.Analog.Basic.RotationalEMF ), you should be able to resolve the issue and run the simulation successfully.

enter image description here

I've modified the model accordingly and am attaching the updated version.

Attachments:
POSTED BY: Vedat Senol

Can you try to switch the Modelica Version to 3.2.3 and simulate again? enter image description here

Right-click on Modelica library, go to version and switch to 3.2.3, and try to simulate? Let me know if that works else I will troubleshoot further.

In version 14, we made version 4.0.0 as the default. I am currently updating the Wolfram U videos to use this new version.

POSTED BY: Ankit Naik
Posted 6 months ago

The YouTube channel "Practical Engineering" had a discussion about real power vs. reactive power on the electrical grid. The video was documenting a recent failure of the grid in Montreal that was linked to the electromagnetic energy of coronal mass ejections: https://www.youtube.com/watch?v=ZwkNTwWJP5k (22 minutes).

Before the failure is discussed, the video talks about the need for reactive power in the grid -- and how engineers compensate for that need for more power. In short, the characteristics of the grid can be changed by installing large inductors and capacitors near equipment placing induction/capacitance demands on the grid. Some of those compensation devices are banks of capacitors; some are a motor that is just spinning without being connected to a load. The spinning motor allows it to both absorb and inject power into the grid.

Reactive power isn't ever consumed. In some sense, it's not real. As our instructors have noted, power in AC circuits has a real component and an imaginary component. This "imaginary" component still must be provided -- even though the destination equipment will put the power back into the grid somewhere else in the 50Hz/60Hz cycle. Measurement for the amount of reactive power consumed is somewhat complicated. For this and other reasons, homes are not charged for any reactive power they require. OTOH, businesses that demand much electrical power are charged for their reactive power usage. They pay not only for their real power usage, but for their imaginary power usage.

This video provides an excellent example of the need for complex numbers to understand AC circuits -- both small and massively large AC circuits. I suppose something other than complex numbers could be used to manage the housekeeping, but complex numbers have the precise amount of complexity to both visualize and calculate the physics of what's happening in an AC circuit.

I highly recommend this little video -- something to view during our "holiday" week in the DSG.

POSTED BY: Phil Earnhardt
Posted 6 months ago

In today's class, somebody asked:

why are frequencies represented with imaginary numbers?

I highly recommend ChatGPT for this kind of question. That exact question yields a comprhensive answer in the AI. Since ChatGPT 4o is available freely for anyone who requests an account; I highly recommend using that tool. OpenAI even provides an app for MacOS to help keep things uncluttered on your desktop.

In class today, our instructors were discussing the variety of sinusoidal behaviors associated with electronics and signal processing. I believe they were searching for a particular word. There is a pertinent list of such terms available online in the Electromagnetic Terms section of the Wikipedia entry for Oliver Heaviside. The terms are admittance, elastance, conductance, electret, impedance, inductance, permeability, permittance, and permittivity. Two other terms were coined by Heaviside's peers around the same time: susceptance and reactance. These terms were coined from 1885 to 1894. Some are widely used today in physics and engineering; others have withered into obscurity. Some terms deal with real values; others deal with imaginary values. The Wikipedia article contains links defining each of these terms.

Anyone who thoroughly understands these eleven concepts is a signal processing wizard.

POSTED BY: Phil Earnhardt
Posted 6 months ago

Hi There,

I noticed that Modelica electrical has an additional library called Spice. This gives more advanced settings for components like capacitors etc. Is there an easy way to add this to System Modeler?

POSTED BY: Sean G

The capacitor model in the Electrical and the Spice library looks the same to me. Unfortunately, we do not support it yet. For this course, you can create all the models using the Modelica.Electrical library.

class Modelica.Electrical.Analog.Basic.Capacitor
  Real v(quantity = "ElectricPotential", unit = "V", start = 0.0) "Voltage drop of the two pins (= p.v - n.v)";
  Real p.v(quantity = "ElectricPotential", unit = "V") "Potential at the pin";
  Real p.i(quantity = "ElectricCurrent", unit = "A") "Current flowing into the pin";
  Real n.v(quantity = "ElectricPotential", unit = "V") "Potential at the pin";
  Real n.i(quantity = "ElectricCurrent", unit = "A") "Current flowing into the pin";
  Real i(quantity = "ElectricCurrent", unit = "A") "Current flowing from pin p to pin n";
  parameter Real C(quantity = "Capacitance", unit = "F", min = 0.0, start = 1.0) = 1.0 "Capacitance";
equation
  n.i = 0.0;
  p.i = 0.0;
  v = p.v - n.v;
  0.0 = n.i + p.i;
  i = p.i;
  i = C * der(v);
end Modelica.Electrical.Analog.Basic.Capacitor;

class Spice3.Basic.C_Capacitor
  Real v(quantity = "ElectricPotential", unit = "V") "Voltage drop of the two pins (= p.v - n.v)";
  Real p.v(quantity = "ElectricPotential", unit = "V") "Potential at the pin";
  Real p.i(quantity = "ElectricCurrent", unit = "A") "Current flowing into the pin";
  Real n.v(quantity = "ElectricPotential", unit = "V") "Potential at the pin";
  Real n.i(quantity = "ElectricCurrent", unit = "A") "Current flowing into the pin";
  Real i(quantity = "ElectricCurrent", unit = "A") "Current flowing from pin p to pin n";
  parameter Real C(quantity = "Capacitance", unit = "F", min = -1.7976931348623157e+308, start = 0.0) = 0.0 "Capacitance";
  final constant Real WSMServices.Machine.Real_MAX = 1.7976931348623157e+308 "Maximum finite Real number.";
  parameter Real IC(quantity = "ElectricPotential", unit = "V") = 0.0 "Initial value of voltage";
  final constant Real ModelicaServices.Machine.inf = 1.7976931348623157e+308 "Biggest Real number such that inf and -inf are representable on the machine";
  evaluated parameter Boolean UIC = false "Use initial conditions: true, if initial condition is used";
  protected Real vinternal(quantity = "ElectricPotential", unit = "V") "Capacitor voltage";
  final constant Real Modelica.Constants.inf = 1.7976931348623157e+308 "Biggest Real number such that inf and -inf are representable on the machine";
equation
  n.i = 0.0;
  p.i = 0.0;
  v = p.v - n.v;
  0.0 = n.i + p.i;
  i = p.i;
  vinternal = p.v - n.v;
  i = C * der(vinternal);
end Spice3.Basic.C_Capacitor;
POSTED BY: Ankit Naik

As @Ankit Naik mentions, we do not have full support for the Modelica SPICE library in System Modeler. That means that some parts of the library can fail. The SPICE library contains more detailed models of semiconductor devices. The models included in the Modelica.Electrical library are simpler but they are still very useful. I usually stick to those because, for analysis purposes, they are easier to use and they tend to be faster.

Posted 6 months ago

Hi Leonardo,

I can see how it can be a real advantage to take a more simplistic approach. For example, system modeler is probably never going to be as accurate as a dedicated multi-physics FEA but it will get reasonable ballpark answers very quickly for complex multi-physics system-level problems (which is a big advantage). Accurate simulation for electronics can be very complex, System Modeler seems to be taking a more high-level simpler approach which is nice.

Is there any strategy for automatically taking outputs from software like Ansys, Comsol, LTSpice or other simulation programs and integrate the outputs as part of a system-level multi-physics simulation that System Modeler could model?

This would help solve scaling issues with the packages I mentioned above; they are so computationally intensive that doing large systems are not really feasible. It would be interesting to see some System Modeler examples doing this.

Another application where I'd love to see what System Modeler can do is as a tool something like LangChain where LLM outputs can be chained together to action complex tasks.

Apologies, my question maybe a little off-base, just a few general thoughts/questions.

POSTED BY: Sean G

For example, system modeler is probably never going to be as accurate as a dedicated multi-physics FEA but it will get reasonable ballpark answers very quickly for complex multi-physics system-level problems (which is a big advantage)

There are a few techniques that can be applied with System Modeler in order to get fast solutions to problems where FEA is usually used. For example, when modeling flexible elements. A flexible bar can be simulated splitting it into small segments and approximating the deformation. It's a tradeoff, with FEA you can get a more accurate result, but with System Modeler you can get good enough solution in a reasonable time. @Vedat Senol has made a few applications like this.

In the case of electric circuits it is not always necessary to perform simulations with the most accurate semiconductor models. For example, when developing circuits with operational amplifiers, one can use a detailed model of the op-amp to analyze extreme cases. But in most situations, for the work I do, a behavioral model of the op-amp is more than enough. System Modeler makes very easy to create these behavioral models and perform very fast simulations. For example, in the course I run a simulation of a full synthesizer and render a few seconds of audio in a reasonable time. Using a SPICE-like simulator would take much longer.

Is there any strategy for automatically taking outputs from software like Ansys, Comsol, LTSpice or other simulation programs and integrate the outputs as part of a system-level multi-physics simulation that System Modeler could model?

It depends on what the other simulators allow. System Modeler can produce FMUs, under the FMI standard https://fmi-standard.org/. This allows models created in System Modeler to be exchanged with other simulators therefore making sending an receiving data much simpler. Is up to the other simulators to adopt such standard in order to make interoperability easier.

In the case of FEA, Mathematica provides tools to perform FEA analysis and it is possible to combine with System Modeler. Again @Vedat Senol has made a few examples.

Another application where I'd love to see what System Modeler can do is as a tool something like LangChain where LLM outputs can be chained together to action complex tasks.

I haven't seen anything combining System Modeler with LLMs. What we do have is running neural networks built in Mathematica running with System Modeler using the ONNX format.

Hello Dr Ruiz,

In yesterday's lecture 11, towards the end, we went from the simple 2 loop 4 node resistor circuit to what System Modeler did with it, which was very complex. You went by that really fast. We should dwell on that. What all can you do with that model? That seemed to put a finger on the strength of System Modeler. In particular the associated thermal modeling. Can you model resistors whose values change with temperature? Can you model thermal runaway? Can you show the effect of putting a fan on the circuit, or a thermal fin, to prevent thermal runaway? A simple circuit like that seems to be a perfect pedagogical tool for looking at complex issues like that. I've seen circuits fail because even though that had low dissipation, there was no way for the heat to get out. A beginner's mistake, but one that is easy to make because thermal analysis is not traditionally included in circuit analysis.

POSTED BY: Carl Hahn

That's a very good question. I quickly created a model comparing 3 different cases: ideal (no thermal interaction), thermally isolated from the ambient and exposed to the ambient. Here is the model and results: enter image description here enter image description here

The model can be found here if you want to play with the parameters: https://amoeba.wolfram.com/index.php/s/TWQFSjnT9WTyxSj

POSTED BY: Ankit Naik

You can also imagine passing the heat from the resistor to a container (with air) encasing the circuit. This will help in understanding the increased pressure inside the container (when the system is thermally isolated). enter image description here enter image description here

Model can be found here: https://amoeba.wolfram.com/index.php/s/7cs8fL3LY8SF3D5

POSTED BY: Ankit Naik
Posted 6 months ago
POSTED BY: Phil Earnhardt

Thank you for your very nice explanation, and the interesting analogy between the electric grid and the arterial network. I have long been wondering why the heart is a pulsatile and not a continuous pump. There does not seem to be much information on this topic in the literature. The scarce information I found, focusses on the generation of blood flow and suggests that anatomically a pulsatile pump is simpler than a continuous pump, and also that a pulsatile pump may adapt (increase or decrease flow) more easily depending on the need (activity or rest). You focus on the alternative explanation that the heart may be a pulsatile pump because a pulsatile blood flow may be transmitted more efficiently through the arterial tree. It is very interesting that AC vs. DC electric current may also be discussed from the perspective of energy generation and energy transmission, and that AC current appears to be more advantageous than DC current from both these perspectives.

Posted 6 months ago

Most (but not all) of the pertinent pages from "Scale" are available on the Google Books preview of the text.They start on p. 118 of the book in the section entitled "9. METABOLIC RATE AND CIRCULATORY SYSTEMS IN MAMMALS, PLANTS, AND TREES" and into the next section "10. DIGRESSION ON NIKOLA TESLA, IMPEDANCE MATCHING, AND AC/DC". It gives you a good taste of the entire text.

I had forgotten that impedance matching is the same as non-reflectivity at a boundary/interface. Did you ever see the Shive Wave Machine? This video shows John Shive himself demonstrating his machine: showing impedance matching then an impedance mismatch. Brilliant stuff -- a fantastic visualization. I once saw one of these machines tucked away in a lecture hall, but I never saw a live demonstration.

Biology uses impedance everywhere. The middle ear is an example of impedance matching: funky geometries of 3 little bones to translate vibrations in the air to a liquid medium.

It's great you asked yourself the question why the heart is a pulsatile and not a continuous pump.

POSTED BY: Phil Earnhardt

Just thinking out loud here: From what you quoted, the imbalance appears to have been in the generator frequencies to start with? I imagine they need to stay synchronized in frequency if they are sharing loads. Otherwise you set up a beat frequency at the difference frequency between the two generating systems, and their voltages will move from being in phase to being out of phase, back to being in phase again at the rate of the beat frequency. I don't know how power grids really work, but I imagine this will cause intolerable voltage variations as they sum in phase and out of phase. Did that happen? It's a simple graph to add two sine waves of equal amplitude but with a slight difference in phase to show what happens.

But upon closer inspection of the article you mentioned it looks like the real complaint was simply that having a slightly lower frequency than the assumed 50 Hz, kitchen equipment that assumes 50 Hz and some kind of zero crossing counter as a clock reference will get a long term clock drift.

As an aside, when we talk about load impedances being a function of frequency, unless the load has a very high Q (lossless resonance), they don't change very much in the vicinity of the frequency of the stimulus. Bio-mechanical systems (a cool topic) are inherently lossy and must have low Qs. To a first order it would be surprising to see much sensitivity to the frequency of the stimulus. But I can see additions and cancellations of multiple stimulus playing a role. And our internal body clocks seem to get reset every day according to the motion of the sun.

POSTED BY: Carl Hahn
Posted 6 months ago

the imbalance appears to have been in the generator frequencies to start with?

As I understand it, all generators in a grid will be synchronized at the same exact frequency. Care is taken when bringing a new generator online to have each of the three phases match the rest of the grid. The video https://www.youtube.com/watch?v=RGPCIypib5Q shows an "offline" generator being brought onto the "grid". The video starts getting interesting around 3:00; the two generators are brought onto the same circuit about 40 seconds later. If a bunch of generators are on the grid, they will all remain in sync. Bringing a generator online is a procedure that was worked out by Nicola Tesla (and others) well over 100 years ago. The first synchronizations were done manually, but I'm certain automated equipment to bring a new generator online has existed for a very long time.

I do not know what condition existed at the border to drag the frequency of the entire European grid down. It had to be an extreme event for the grid. I am gobsmacked that the condition continued to exist for weeks; zillions of officials monitoring the grid must have noticed. What took them so long to take action? Both technical and political questions abound.

WRT the Q factor of our musculoskeletal network, I haven't found any published papers on the topic. I figured out one way to look at the Q: I torque a gently-contracted fist with the thumb and middle fingers of the opposite hand and then release it. The release is similar to snapping the fingers. You can have the pronators and supinators in the arm at a varieties of tensions (i.e., co-activations). When you release the hand, you can see it oscillating for 1-2 cycles before the motion is stopped. Whether you have a slight or large co-activation, the damping is always in that same range. We appear to be a heavily damped system. I thought it was way cool to identify a piece of anatomy where one could observe the rapid damping of oscillations in our musculoskeletal system. I fondly hope I can find more!

I'd love to hear what pithy comments our instructors have on this rather esoteric topic of the great European grid frequency leak of 2018. What exactly was it that dragged the grid frequency down? Is there any applicability to other systems that are modeled with impedance? Can you reduce this phenomenon to a WL demonstration showing how the frequency loss would happen? If this question has wandered too far to be valuable for this course, please consider discussing it in a future posting to the Wolfram Community board. Thanks!

POSTED BY: Phil Earnhardt
Posted 6 months ago

Hello. I'm registered for the Daily Study Group!

In early 2018, there was an incident in the European electrical power grid. From the Ars Technica reporting on the incident European grid dispute resolved, lost 6 minutes returned to oven clocks:

Last month, the European Network of Transmission System Operators (ENTSO-E) publicly admonished Serbia and Kosovo for not properly balancing their grids according to previous agreements. "This average frequency deviation, that has never happened in any similar way in the CE [Continental Europe] Power system, must cease," the group wrote. "ENTSO-E is urging European and national governments and policymakers to take swift action."

Two days later, on March 8, the Transmission System Operators (TSOs) from Serbia and Kosovo confirmed that they were back to balancing their grids appropriately.

The incident piqued my curiosity: it's a unique example where load influenced the frequency of the AC power grid. Even though the 50Hz grid never dropped below 49.996Hz, this remains (to the best of my knowledge) a unique deviation from that most-important frequency. Technically, what happened? What was the imbalance, and how could it have this significant an impact on the entire European grid? My understanding is that a 1% drop in the line frequency of a grid could have serious impact on some old (stodgy) generators. Is it possible to have a Wolfram Language simulation showing what happened for the class? What was this imbalance, and how much of an imbalance would it take to produce a 1% drop in the frequency? I'd love to hear a brief discussion about this incident during the class, but realize it may be a bit late to change the presentation. Perhaps a homework example?

The dynamics of electricity is a secondary interest to me. Many other systems -- including mechanical systems like our musculoskeletal system -- use stored energy in their oscillating cycles. The same impedance model used in electrical systems can be applied to many mechanical systems. Impedance is inherently dependent on frequency, but most don't understand the frequency-dependent dynamic in biomechanics. That must change.

Since electricity is discussed far more than any other domain studying impedance, I pay attention when Wolfram Research is discussing such things. Thank you for this WSG.

POSTED BY: Phil Earnhardt

To understand such failures, perhaps it is better to start simple and create a model with the different components involved in the system. Here is a model that I created using a third-party free PowerSystems library with System Modeler.

The model has 2 mechanical generation units that have a PI controller to maintain the frequency at 50 Hz. Some constant loads, transmission lines and, a variable load that leads to fluctuation of frequency. enter image description here

Whenever the load varies there is a change in frequency and the controller tries to adjust the rotational speed of the generation unit to get back to the desired frequency. There could be other reasons that can change the frequency as well like fault in the transmission lines or disturbances in the generation unit.

enter image description here

POSTED BY: Ankit Naik
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract