Simscape ignores parameter units

1 visualización (últimos 30 días)
Christian
Christian el 1 de Oct. de 2019
Comentada: J Chen el 2 de Oct. de 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 comentario
J Chen
J Chen el 2 de Oct. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Troubleshooting en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by