Group Abstract Group Abstract

Message Boards Message Boards

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

[WSG24] Daily Study Group: Introduction to electric circuits

Posted 1 year 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
POSTED BY: Phil Earnhardt
POSTED BY: Phil Earnhardt
POSTED BY: Cassidy Hinkle
POSTED BY: Ankit Naik

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

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.

POSTED BY: Ankit Naik

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
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

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

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

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

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

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.

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

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

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 1 year 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

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
POSTED BY: Phil Earnhardt

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.

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

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

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 1 year 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

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

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
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard