![]() ![]() Simulating this circuit, we can see exactly how that plays out: The constant voltages are 25 volts in this case. If it’s outside the limits, the limits will be the value. The operational amplifier in the center of the next figure will amplify the voltage at the negative pin by a factor of resistor1/resistor = 30000/10000 = 3, if that value is within the limits from the two constant voltages I’ve connected to the circuit. Let’s take a look first at an inverting amplifier circuit, which happens to be one of the first lab exercises I did at university. There are many ways to improve this filter, and one of them is to add an amplifier to the circuit. Here I can see the peak 600 Hz for both signals, and for the input signals there’s a second peak at 30,000 Hz, where the noise is added. Then I can look at their spectra by using the discrete Fourier transform: In the diagram below, the high-frequency signal is damped.Īnother way to see this is to look at the frequency spectrum of these signals. Next I run a simulation with this model and can directly see the result of the filter. Returning to the RC circuit, in the diagram below, the filter is connected to the power sources and a load resistor. I would have to redo all my work, whereas in SystemModeler I can simply connect it where I want it, and the system will regenerate the simulation equations. Not only has the real-world reassemblance completely disappeared, but it’s also hard to reuse this if I want to change the structure and add an extra component, say an inductor, to it. If I didn’t have such an acausal modeling environment, I’d have to derive the complete relationship from input to output, and then implement that function. Less burden on the modeler and more work for the computer. This brings a very powerful concept to the modeling table, namely, to be able to define components and let the computer figure out a form of the complete system that can be simulated. The same way of defining components from equations works for the resistor, inductor, and so on. Not shown here is the annotation in the code that specifies how the component should look when used in the graphical user interface. ![]() ![]() The code above is written in the object-oriented modeling language Modelica, which SystemModeler implements. The capacitor and resistor components are defined directly from their constitutive equations: for a capacitor, we in general have the equation I(t) = C dV(t)/dt, and if we look at the model for the capacitor, we see exactly this equation popping up: Together they act as a low-pass filter that will filter out the high-frequency components of a signal. The name refers to the two components in the circuit: a resistor (R) and a capacitor (C). Now let’s go for something a bit more interesting and usable, say, an RC circuit. Let’s look at the current in the resistor: I can now query the simulation object for all variables and parameters. Let’s see how SystemModeler handles this. You’d also learn Ohm’s law, stating that I = V/R, so with a potential of 10 volts and a resistance of 5 ohms, we get a current of 2 amperes. This circuit is something that you would build in middle school (at least I did), with the resistor replaced with a small light bulb. To create this circuit, I used drag-and-drop from the built-in components that come with SystemModeler. I named it HelloSystemModeler in the tradition of computer language tutorials, where most first simple programs usually start with a greeting like “Hello, world.” This circuit only contains three components: a resistor, a voltage source (like an ideal battery), and a ground. Let’s start with the simplest electrical circuit I can think of: It’s also available with a student license, or you can buy a home-use license. If you want to follow along, you can download a trial of SystemModeler. In this blog post, I’ll start from very basic circuits with components such as resistors and inductors and gradually add more complexity in the form of amplifiers and switching circuits. With SystemModeler I think it’s easier than ever to get started building virtual circuits and trying what-if scenarios for electrical circuits and systems. In my first circuits class, all calculations were done by hand, and we could check solutions with unintuitive circuit simulators using the SPICE methodology. Explore the contents of this article with a free Wolfram SystemModeler trial. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |