MATLAB Examples

How the Simscape™ Foundation Library Asynchronous Sample & Hold block can be used to build components with more complex behaviors. The model implements a controllable PWM voltage source

Use the Simscape™ example library ElectroChem_lib. In the model Fe3+ ions are reduced to Fe2+, and Pb is oxidized to Pb2+, thereby releasing chemical energy. The molar flow rate of lead ions

Use the Simscape™ example library Capacitors_lib. The model is constructed using components from the example library. The circuit charges an ultracapacitor from a constant 0.05 amp

How the discrete-time Simscape™ Foundation Library Counter block can be used to build components with more complex behaviors. The model implements a controllable PWM voltage source where

Use Simscape™ to model a variable transport delay. The Transport Delay block models signal propagation through media moving between the Input and the Output terminals. The media velocity

A lumped parameter transmission line model. It is built from a custom Simscape™ component that defines a single T-section segment. The model concatenates 50 segments, each of length 0.1m,

Model a controlled actuator using simplified custom pneumatic components. There are two across variables, defined as pressure and temperature, and two through variables, defined as mass

Write Simscape™ functions to compute numerical values with Simscape expressions and how to use Simscape functions to improve code reuse across components. The top two Simscape component

Models moist air flow in a vehicle heating, ventilation, and air conditioning (HVAC) system. The vehicle cabin is represented as a volume of moist air exchanging heat with the external

Model a lithium cell using the Simscape™ language to implement the elements of an equivalent circuit model with two RC branches. For the defining equations and their validation, see T.

An ideal AC transformer plus full-wave bridge rectifier. It converts 120 volts AC to 12 volts DC. The transformer has a turns ratio of 14, stepping the supply down to 8.6 volts rms, i.e.

Model a lead-acid battery cell using the Simscape™ language to implement the nonlinear equations of the equivalent circuit components. In this way, as opposed to modeling entirely in

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

Model a lithium cell using the Simscape™ language to implement the elements of an equivalent circuit model with one RC branch. For the defining equations and their validation, see T. Huria,

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:

Two models of an RC circuit, one using Simulink® input/output blocks and one using Simscape™ physical networks.

This model shows 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

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

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

A starting point for creation of a new electrical model. The model also opens an Electrical Starter Palette that shows how you can create your own customized library that also provides links

An implementation of a nonlinear inductor where the inductance depends on the current. For best numerical efficiency, the underlying behavior is defined in terms of a current-dependent

Simulate a battery pack consisting of multiple series-connected cells in an efficient manner. It also shows how a fault can be introduced into one of the cells to see the impact on battery

This model shows 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

This model shows 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

This model shows 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

Model a two-pole variable reluctance actuator. Initially the rotor is held at 45 degrees by the rotational spring, and then at 0.1 seconds the motor is activated. The rotor is pulled towards

Two models of a cascaded RC circuit, one using Simulink® input/output blocks and one using Simscape™ physical networks.

This model shows 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

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

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

How the Foundation Library gas components can be used to model a controlled pneumatic actuator. The Directional Valve is a masked subsystem created from Variable Local Restriction (G)

How a pneumatic vane motor can be modeled using the Simscape™ language. The Pneumatic Motor component is built using the Simscape Foundation gas domain. It inherits from the

The choking behavior of a gas orifice modeled by the Local Restriction (G) block. The Controlled Reservoir (G) blocks are used to set up controlled pressure and temperature boundary

Models a gas turbine auxiliary power unit (APU) based on the Brayton Cycle. The Compressor and Turbine blocks are custom components built on top of the Simscape™ Foundation Gas Library. The

Models a ventilation circuit in a building. The air volume inside the building is divided into four zones. The ventilation unit blows cool air into Zone 1 and extracts air from Zone 3. The

How the Foundation library can be used to model systems that span electrical, mechanical and hydraulic domains. In the model, a hydraulic system controls mechanical load position in

A two-way valve acting in a closed-loop circuit together with a double-acting cylinder. The controller is represented as a continuous-time transfer function plus a transport delay. The

A physical system model and controller configured for HIL testing. It is derived from example Hydraulic Actuator with Digital Position Controller,

This model shows how the fluid in a custom double acting cylinder can cavitate and recover. During the repeating cycle of oscillating pressure, the absolute pressure does not get below

Model a transformer using fundamental magnetic library blocks. The transformer is rated 50W, 60 Hz, 120V/12V and assumed to have an efficiency of 94%, no-load magnetizing current of 1% and a

Model a solenoid with spring return. When unpowered, the spring pulls the plunger +5mm away from the center of the coil. Turning on the power supply at t=0.1 seconds pulls the plunger into the

Two models of a double mass-spring-damper, one using Simulink® input/output blocks and one using Simscape™ physical networks.

A model of a system that connects rotational and translational motion. A summing lever drives a load consisting of a mass, viscous friction, and a spring connected to its joint C. Joint B is

A mass attached to a spring and a viscous damper. The mass is driven by an ideal velocity source through a friction element. The motion profile of the source is selected in such a way that

The use of the Simscape™ Lever block in a linkage mechanism. Lever 1 and Lever 4 are first class levers with the fulcrum at the end. Lever 3 is a second class lever with the fulcrum in the middle.

This model shows a mechanical rotational system with stick-slip friction. An inertia is connected to a fixed point by spring and damper. The inertia is driven by a velocity source via a

Two masses connected by a hard stop. Mass 1 is driven by an Ideal Velocity Source. As the velocity input changes direction, Mass 2 will stay at rest until Mass 1 reaches the other end of the

Two models of a mass-spring-damper, one using Simulink® input/output blocks and one using Simscape™ physical networks.

A controlled mass-spring-damper. A controller adjusts the force on the mass to have its position track a command signal. The initial velocity for the mass is 10 meters per second. The

Model a basic engine cooling system using custom thermal liquid blocks. A fixed-displacement pump drives water through the cooling circuit. Heat from the engine is absorbed by the water

Model shows how the Thermal Liquid foundation library can be used to model water hammer in a long pipe. After slowly establishing a steady flow within the pipe by opening a valve accordingly,

Model shows the opposing effects of viscous warming and conductive cooling on the temperature of a buried pipeline segment for heated oil transportation. A requirement for these systems is

Model shows how Foundation Library thermal liquid components can be used to estimate the impact of viscous losses on an actuating system's temperature over a long time scale. A pump supplies

The Antoine class provides a computational framework to help doing simple vapor-liquid equilibrium calculations in Matlab. These notes introduce Antoine's equation, then shows how the

The usage of thermal blocks for developing a model of a long iron rod that is heated with a heat source through face A. Face B and the outer cylindrical surface are open to atmosphere and

Model a simple house heating system. The model contains a heater, thermostat, and a house structure with four parts: inside air, house walls, windows, and roof.

How the thermal behavior of a brushless servomotor can be simulated using a lumped parameter model. Heat generated due to power losses in the stator iron stack, stator winding and rotor is

Models a vapor-compression refrigeration cycle using two-phase fluid components. The compressor drives the R-134a refrigerant through a condenser, an expansion valve, and an

Model the vaporization of water to generate steam. Liquid water enters the pipe at 370 K at a rate of 1 kg/s. The pipe is heated to 1000 K, causing the water flowing inside pipe to saturate.

How two-phase fluid components can be used to simulate cavitation. The model is a translational mechanical converter driven by an oscillating pressure source. During the negative load

Models a steam turbine system based on the Rankine Cycle. The cycle includes superheating and reheating to prevent condensation at the high-pressure turbine and the low-pressure turbine,

Choose your country 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 location from the following list:

See all countries