Model common integrated circuits using amplifiers, oscillators,
timers, and counters. Produce a single logic output by combining Boolean
Model a J-K flip-flop from Simscape™ Electrical™ logic components. With the two switches in their default positions, both inputs to the flip-flop are set high so its output state toggles each time the clock signal goes low. Initial conditions are passed to the relevant NAND gates via the initialization commands of the block mask.
How to model a digital potentiometer such as is used to control audio amplifiers from a digital circuit or microprocessor-controlled system. The model also shows how you can create your own custom blocks in order to extend the Simscape™ Electrical™ library.
How noise can be incorporated into an electrical simulation. The circuit models an amplifier with gain 100 and a high-frequency roll off frequency of 10MHz. The op-amp adds noise, and it is assumed that the datasheet specifies an equivalent voltage noise density of 20nV/Hz^0.5. This is implemented using the noise voltage source Vn. Optionally, the thermal noise generated by resistors R1 and R2 can also be included by selecting 'Enabled' for the blocks' noise mode. However, running this model with different combinations of noise sources shows that the main source of noise is the equivalent noise voltage.
How to model a phase-locked loop. The charge pump and filter are modeled using discrete analog components whereas the oscillator is represented as behavioral component using the Simscape™ Electrical™ Voltage-Controlled Oscillator block. The D-type flip-flops in the phase detector are represented in a simplified form using Simulink® blocks to define the behavior, and electrical components are used just at the interface. Non-zero initial conditions are applied to C1 and C2 in order to start the VCO out of phase and test the tracking ability.
How to use the Controlled PWM Voltage and H-Bridge blocks to control a motor. The DC Motor block uses manufacturer datasheet parameters, which specify the motor as delivering 10W mechanical power at 2500 rpm and no-load speed as 4000 rpm when run from a 12V DC supply. Hence if the PWM reference voltage is set to its maximum value of +5V, then the motor should run at 4000 rpm. If it is set to +2.5V, then it should run at approximately 2000 rpm. The Simulation model parameter is set to Averaged for both the Controlled PWM Voltage and H-Bridge blocks, resulting in fast simulation. To validate the averaged behavior, change the Simulation mode parameter to PWM in both blocks.
Model a second-order active low-pass filter. The filter is characterized by the transfer function H(s) = 1 / ( (s/w1)^2 + (1/Q)*(s/w1) + 1 ) where w1 = 2*pi*f1, f1 is the cut-off frequency and Q is the quality factor. Double-click on the Set Design Parameters block to set parameters f1 and Q. The block mask calls a function which sets the parameter values in the model workspace.
Model a Set-dominant SR-Latch from Simscape™ Electrical™ logic components. Initial conditions are passed to the relevant AND gates via the initialization commands of the switches.
Model a Reset-dominant SR-Latch from Simscape™ Electrical™ logic components. Initial conditions are passed to the relevant AND gates via the initialization commands of the switches.
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.
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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office