Effacer les filtres
Effacer les filtres

Simscape ignores parameter units

1 vue (au cours des 30 derniers jours)
Christian
Christian le 1 Oct 2019
Commenté : J Chen le 2 Oct 2019
Hi!
I have a problem with a custom component. For investigation purposes I created the followinf minimal example of what I try to do. Running a model with this example throws an error showing a unit mismatch in line "Fg = Fn + Fs". Appearently simscape ignores the unit of Fg which I defined in the parameters section. Changing all units to '1'm (which I want to avoid) everthing works well.
component zeroTest
outputs
Fn = {[0, 0, 0], 'N'}; % Force normal direction
Fs = {[0, 0, 0], 'N'}; % Force slope direction
end
parameters
Fg = {[0, 0, 1], 'N'}; % Gravity Force
n = {[0.5, 0, 1], '1'}; % Normal vector
end
variables
a = {1, '1/N'}; % Scaling factor between n and Fg
end
equations
Fg == Fn + Fs; % Fn and Fg shall sum up to Fg
Fn * Fs' == 0; % Fn and Fs shall be orthogonal
a*Fn == n; % Fn point in normal direction
end
end
Error Message:
Error compiling Simscape network for model myTestModel.
Caused by:
Error using Common.zeroTest> (line 18)
['myTestModel/zeroTest']: Type mismatch for equation. The left hand side of the equation is [0 0 1] and the
right hand side of the equation is {[1x3 double], 'N'}.
Fg = [0 0 1]
Fn = {[1x3 double], 'N'}
Fs = {[1x3 double], 'N'}
There seems to be something simple I am missing. Hopefully anyone can point me in the right direction.
  1 commentaire
J Chen
J Chen le 2 Oct 2019
The first two lines in the equation section make no sense. A parameter can't equate to two outputs. The two outputs probably should be inputs.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Foundation and Custom Domains dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by