Simscape Physical Signal: Why does is exist?

10 visualizzazioni (ultimi 30 giorni)
What is the added value of simscape physical signals compared to normal simulink signals? As far as I can see, from a functional perspective there is no difference between the two types of signals: I can add units to both types, they both have a direction of flow, and they both have similar function blocks like adding, substracting... Only for physical signals the available types of blocks is very limited. Why didn't the matlab guys just use normal simulink lines instead of the physical signals?

Risposta accettata

Nicolas Schmit
Nicolas Schmit il 24 Gen 2018
Simulink signals are causal signals with a sampling rates. Simscape physical signals are variables with time derivatives. These are two different objects, although they serve the same purpose. Because of the way Simscape simulates physical systems it is not possible to directly mix Simulink signals with the Simscape variables.

Più risposte (1)

Steve Miller
Steve Miller il 25 Gen 2018
The important difference between a Simscape physical signal and a Simulink input/output signal is this:
  • the mathematical relationships defined by Simscape physical signals are all evaluated simultaneously
  • the mathematical operations defined by Simulink blocks are evaluated sequentially (one after the other)
Creating a mathematical expression using Simulink blocks can create an algebraic loop, where the value of block inputs depends on the value of the outputs of the same block. In many cases, expressions with algebraic loops cannot be evaluated directly in Simulink. The same expression implemented with Simscape Physical Signal blocks can be simulated without modification, and no algebraic loop error will result.
Equations that result in algebraic loops are very common in physical systems, which is a main reason that Simscape technology was created by MathWorks.
You do not have to use the physical signal blocks if you do not want to. You could implement the equations directly in Simscape language . However, some people are more comfortable with graphical languages than textual languages, so we give users both options for modeling equations with algebraic constraints - graphical and Simscape language.
You can use the Simulink blocks with Simscape physical networks if you wish, but be very careful not to introduce an algebraic loop. The documentation explains why algebraic loops are undesirable and how to identify algebraic loops in your model. You will save yourself a lot of time and frustration by simply implementing the equations in Simscape directly if at all possible.
--Steve
  1 Commento
Dan Herbison
Dan Herbison il 5 Apr 2018
This seems like a UI matter, rather than a numerical issue.
Couldn't your block diagram parser interpret whether a signal is attached to a Simulink block (thus needing to have certain properties) and formulate the required math, as needed, under the hood?
Circuit simulators do this sort of thing automatically when an event driven signal (digital or analog state) is attached to an analog port, i.e. a domain transformer model is automatically inserted by the netlister.

Accedi per commentare.

Categorie

Scopri di più su Physical Units in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by