필터 지우기
필터 지우기

Simscape ignores parameter units

조회 수: 1 (최근 30일)
Christian
Christian 2019년 10월 1일
댓글: J Chen 2019년 10월 2일
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
J Chen
J Chen 2019년 10월 2일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Foundation and Custom Domains에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by