Type mismatch for equation in SIMSCAPE

Error compiling Simscape network for model cardsimscape.
Caused by:
['cardsimscape/V12/int idt']: Type mismatch for equation. The left hand side of the equation is {[1x1 double], '1/s'} and the right hand side of the equation is {[1x1 double], 'A'}. In foundation.signal.linear.integrator (line 24)
x = [1x1 double]
I = {[1x1 double], 'A'}
Source code for PS-integrator (int idt) is below.
component integrator
% PS Integrator :0.75 :fixed
% This block performs continuous-time integration of the input Physical Signal.
% Copyright 2005-2018 The MathWorks, Inc.
inputs
I; % :left
end
outputs
O; % :right
end
parameters
x0 = { 0, 's' }; % Initial condition
end
variables(Access = private)
x = {value = x0.*ones(size(I)), priority = priority.high};
end
equations
x.der == I;
O == x;
end
annotations
x0 : UnitDropdown = common
end
end

 采纳的回答

Sabin
Sabin 2022-12-15
Hi,
The problem in this model is that a unit mismatch. The integrator is expecting a unitless physical signal while the Current sensor is providing a Current in Amperes. The solution here would be to use a PS-Gain with value 1 and unit 1/A between the Current Sensor and PS-Integrator. This will strip the unit and the model should work fine.
I hope this helps.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Foundation and Custom Domains 的更多信息

产品

版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by