WSMConnectComponents
WSMConnectComponents["newmodel",{"c1"∈"comp1",…},{"c1.a"->"c2.b",…}]
creates the Modelica model "newmodel" by connecting connector a of component c1 with connector b of component c2 etc.
Details and Options
- WSMConnectComponents[newmodel,…] returns WSMModelData[newmodel].
- WSMConnectComponents["PackageA.NewModel",…] inserts "NewModel" into "PackageA".
- The shortest unique component name comp can be used where WSMNames["*.comp"] gives a unique match.
Examples
open allclose allBasic Examples (3)
Scope (4)
Create a block example, sampling a sine wave at regular intervals:
Simulate and plot the sampled signal:
Connect two masses with heat capacity with a thermal conductor:
Set heat capacities, masses, and initial temperatures:
Show that a temperature equilibrium is reached:
Create a mass connected to a spring:
Move the initial position of the mass, stretching the spring:
Generalizations & Extensions (2)
Rule, DirectedEdge, and UndirectedEdge can be used for connections:
Use Rule to specify a connection:
Use DirectedEdge and UndirectedEdge to specify connections:
Applications (3)
Create an inerter, with forces at the terminals proportional to relative acceleration:
Compare how adding an inerter to a damping system influences vibrations:
Set parameter values and simulate the system with a sine vibration force:
Damping effects are of similar magnitude:
Forces acting on the damper component are significantly reduced with an inerter:
Create a model of a DC motor by connecting electrical and mechanical components:
Show the angular velocity of the DC motor:
Create a digital lowpass filter:
Convert the filter into a transfer function:
Create a signal generating source:
Connect the signal source to the filter:
Simulate and plot the signal output and the filtered signal:
Properties & Relations (4)
Use WSMCreateModel to create models based on differential equations:
WSMCreateModel can be used similarly to WSMConnectComponents:
WSMConnectComponentsString creates an inert Modelica String of the model:
Hierarchical models based on existing components enables quick creation of larger systems:
Build a 3D inverted pendulum model with a controller:
A complex multi-domain system can be built using few components: