Simscape Mecanico Con Matlab
Simscape Mecanico Con Matlab
Pgina 1 de 15
3. Open the Simscape > Foundation Library > Mechanical> Translational Elements library.
4. Drag the Mass, Translational Spring, Translational Damper, and two Mechanical Translational
Reference blocks into the model window.
5. Orient the blocks as shown in the following illustration. To rotate a block, select it and press Ctrl+R.
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 2 de 15
6. Connect the Translational Spring, Translational Damper, and Mass blocks to one of the Mechanical
Translational Reference blocks as shown in the next illustration.
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 3 de 15
7. To add the representation of the force acting on the mass, open the Simscape > Foundation Library >
Mechanical> Mechanical Sources library and add the Ideal Force Source block to your diagram.
To reflect the correct direction of the force shown in the original schematic, flip the block by selecting
Diagram > Rotate& Flip > Flip Block > Up-Down from the top menu bar of the model window.
Connect the block's port C (for "case") to the second Mechanical Translational Reference block, and its
port R (for "rod") to the Mass block, as shown below.
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 4 de 15
8. Add the sensor to measure speed and position of the mass. Place the Ideal Translational Motion
Sensor block from the Mechanical Sensors library into your diagram and connect it as shown below.
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 5 de 15
9. Now you need to add the sources and scopes. They are found in the regular Simulink libraries. Open
the Simulink > Sources library and copy the Signal Builder block into the model. Then open the
Simulink > Sinks library and copy two Scope blocks. Rename one of the Scope blocks to Velocity
and the other to Position.
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 6 de 15
10. Every time you connect a Simulink source or scope to a Simscape diagram, you have to use an
appropriate converter block, to convert Simulink signals into physical signals and vice versa. Open the
Simscape > Utilities library and copy a Simulink-PS Converter block and two PS-Simulink Converter
blocks into the model. Connect the blocks as shown below.
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 7 de 15
11. Each topologically distinct physical network in a diagram requires exactly one Solver Configuration
block, found in the Simscape > Utilities library. Copy this block into your model and connect it to the
circuit by creating a branching point and connecting it to the only port of the Solver Configuration block.
Your diagram now should look like this.
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 8 de 15
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 9 de 15
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 10 de 15
The Velocity scope outputs the mass velocity, and the Position scope outputs the mass displacement
as a function of time. Double-click both scopes to open them.
2. To run the simulation, click
model, calculates the initial conditions, and runs the simulation. For a detailed description of this
process, see How Simscape Simulation Works. Completion of this step may take a few seconds. The
message in the bottom-left corner of the model window provides the status update.
3. Once the simulation starts running, the Velocity and Position scope windows display the simulation
results, as shown in the next illustration.
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 11 de 15
In the beginning, the mass is at rest. Then at 4 seconds, as the input signal changes abruptly, the mass
velocity spikes in the positive direction and gradually returns to zero. The mass position at the same
time changes more gradually, on account of inertia and damping, and stays at the new value as long as
the force is acting upon it. At 6 seconds, when the input signal changes back to zero, the velocity gets a
mirror spike, and the mass gradually returns to its initial position.
You can now adjust various inputs and block parameters and see their effect on the mass velocity and
displacement.
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 12 de 15
3. Run the simulation. The simulation results are shown in the following illustration.
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 13 de 15
3. Next, double-click the Translational Damper block. Set its Damping coefficient to 500 N/(m/s).
4. Run the simulation. Because of the increase in viscosity, the mass is slower both in reaching its
maximum displacement and in returning to the initial position, as shown in the following illustration.
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 14 de 15
More About
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016
Pgina 15 de 15
https://www.mathworks.com/help/physmod/simscape/ug/creating-and-simulating-a-si... 13/10/2016