Electrical Systems
Explore examples that illustrate modeling, control, and simulation of electrical systems.
Categories
- Electrical Circuits in Simulink and Simscape
Examples of electrical circuits in Simulink® and Simscape™
- Batteries
Examples of batteries
Featured Examples
Shunt Motor
A model of a shunt motor. In a shunt motor, the field and armature windings are connected in parallel. Equivalent circuit parameters are armature resistance Ra = 110 Ohms, field resistance Rf = 2.46KOhms, and back emf coefficient Laf = 5.11. The back-emf is given by Laf*If*Ia*w, where If is the field current, Ia is the armature current, and w is the rotor speed in radians/s. The rotor inertia J is 2.2e-4kgm^2, and rotor damping B is 2.8e-6Nm/(radian/s).
Permanent Magnet DC Motor
This model is based on a Faulhaber Series 0615 DC-Micromotor. The parameters values are set to match the 1.5V variant of this motor. The model uses these parameters to verify manufacturer-quoted no-load speed, no-load current, and stall torque.
Nonlinear Bipolar Transistor
An implementation of a nonlinear bipolar transistor based on the Ebers-Moll equivalent circuit. R1 and R2 set the nominal operating point, and the small signal gain is approximately set by the ratio R3/R4. The 1uF decoupling capacitors have been chosen to present negligible impedance at 1KHz. The model is configured for linearization so that a frequency response can be generated.
Small-Signal Bipolar Transistor
The use of a small-signal equivalent transistor model to assess performance of a common-emitter amplifier. The 47K resistor is the bias resistor required to set nominal operating point, and the 470 Ohm resistor is the load resistor. The transistor is represented by a hybrid-parameter equivalent circuit with circuit parameters h_ie (base circuit resistance), h_oe (output admittance), h_fe (forward current gain), and h_re (reverse voltage transfer ratio). Parameters set are typical for a BC107 Group B transistor. The gain is approximately given by -h_fe*470/h_ie =-47. The 1uF decoupling capacitor has been chosen to present negligible impedance at 1KHz compared to the input resistance h_ie, so the output voltage should be 47*10mV = 0.47V peak.
Band-Limited Op-Amp
How higher fidelity or more detailed component models can be built from the Foundation library blocks. The model implements a band-limited op-amp. It includes a first-order dynamic from inputs to outputs, and gives much faster simulation than if using a device-level equivalent circuit, which would normally include multiple transistors. This model also includes the effects of input and output impedance (Rin and Rout in the circuit), but does not include nonlinear effects such as slew-rate limiting.
Finite-Gain Op-Amp
How higher fidelity or more detailed component models can be built from the Foundation library blocks. The Op-Amp block in the Foundation library models the ideal case whereby the gain is infinite, input impedance infinite, and output impedance zero. The Finite Gain Op-Amp block in this example has an open-loop gain of 1e5, input resistance of 100K ohms and output resistance of 10 ohms. As a result, the gain for this amplifier circuit is slightly lower than the gain that can be analytically calculated if the op-amp gain is assumed to be infinite.
Op-Amp Circuit - Differentiator
A differentiator, such as might be used as part of a PID controller. It also illustrates how numerical simulation issues can arise in some idealized circuits. The model runs with the capacitor series parasitic resistance set to its default value of 1e-6 Ohms. Setting it to zero results in a warning and a very slow simulation. See the User's Guide for further information.
Op-Amp Circuit - Inverting Amplifier
A standard inverting op-amp circuit. The gain is given by -R2/R1, and with the values set to R1=1K Ohm and R2=10K Ohm, the 0.1V peak-to-peak input voltage is amplified to 1V peak-to-peak. As the Op-Amp block implements an ideal (i.e. infinite gain) device, this gain is achieved regardless of output load.
Op-Amp Circuit - Noninverting Amplifier
A noninverting op-amp circuit. The gain is given by 1+R2/R1, and with the values set to R1=1K Ohm and R2=10K Ohm, the 0.1V peak-to-peak input voltage is amplified to 1.1V peak-to-peak. As the Op-Amp block implements an ideal (i.e. infinite gain) device, this gain is achieved regardless of output load.
Nonlinear Inductor
An implementation of a nonlinear inductor where inductance depends on current. A tanh
function defines the nonlinear flux-current relationship. The flux saturates for large currents, which can occur, for example, in iron core inductors.
Full-Wave Bridge Rectifier
Size a capacitor for a specific load in a transformer that converts 120 VAC to 12 VDC. The system is modeled as an ideal AC transformer plus full-wave bridge rectifier.
Circuit Breaker
Model a circuit breaker. The electromechanical breaker mechanism is approximated with a first-order time constant, and it is assumed that the mechanical force is proportional to load current. This simple representation is suitable for use in a larger model of a complete system. When the 20V supply is applied at one second, it results in a current that exceeds the circuit breaker current rating, and hence the breaker trips. The reset is then pressed at three seconds, and the voltage is ramped up. The breaker then trips just beyond the circuit breaker current rating.
Solenoid
A solenoid with a spring return. The solenoid is modeled as an inductance whose value L depends on the plunger position x. The back emf for a time-varying inductance is given by:
A Comparison of the Mutual Inductor and Ideal Transformer Library Blocks
The differences in behavior between the Mutual Inductor and Ideal Transformer blocks in the Simscape™ Foundation Library. These two blocks both represent the same system of electromagnetically-coupled windings but make different simplifying assumptions. It is important to understand the assumptions and how they impact model fidelity as a function of frequency. With this, you can make an informed decision about which block to use in a model of your circuit.
Operating Point RLC Transient Response
The response of a DC power supply connected to a series RLC load. The goal is to plot the output voltage response when a load is suddenly attached to the fully powered-up supply. This is done using a Simscape operating point.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)