Clear Filters
Clear Filters

How can I create a 'switch' in the mechanical translational domain of simulink?

5 views (last 30 days)
Hi,
I'm trying to create a sort of 'switch' in the mechanical translational domain of the simulink software. I want a block which will read in a simple input value and, based on that input value, either let the entirety on a mechanical translational signal flow through or block the entirety of the signal. Does anyone know of a way of making this? I'm trying to model a machine with finite elements whereby different finite elements are being 'driven' at different instances based on some input value, hence I require a block which is able to switch on and off which element is being driven.
Thanks in advance.

Answers (1)

Anurag Ojha
Anurag Ojha on 11 May 2023
Hi David,
To create a switch in the mechanical translational domain of Simulink, you can follow these steps:
  1. Open a new Simulink model.
  2. From the Simulink Library Browser, select the "Simulink" library.
  3. From the "Simulink" library, drag and drop a "Switch" block onto your model.
  4. Double-click on the "Switch" block to open its block parameters dialog box.
  5. In the "Criteria for nonzero outputs" drop-down list, select "u1 > 0".
  6. In the "Criteria for zero outputs" drop-down list, select "u1 <= 0".
  7. Connect the input signal to the "u1" input port of the switch block.
  8. Connect the "y" output port of the switch block to the rest of your Simulink model.
The switch block will pass the input signal through to the output when the input is positive (greater than zero), and it will output zero when the input is zero or negative (less than or equal to zero). You can adjust the criteria for switching by changing the values in the "Criteria for nonzero outputs" and "Criteria for zero outputs" drop-down lists.
To explore more refer to following MATLAB documents
Hope it helps!!

Categories

Find more on General Applications in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!