フィルターのクリア

Relational operators in Simscape Language

3 ビュー (過去 30 日間)
Santiago Alfonso Ospina Botero
Santiago Alfonso Ospina Botero 2023 年 2 月 28 日
Hi,
Im trying to create a custom component in Simscapa language. In particular I'm modelnig a GDT (Gas Discharge Tube) and for that I want to create a piece wise function, like the following,
equations
assert(Threshold_Voltage > 0)
v == p.v - n.v; % Voltage across between node p and node n
if (abs(v) < Threshold_Voltage)
i == v/Insulation_Resistance;
elseif (Threshold_Voltage <= abs(v) < Glow_Voltage)
i == v/Break2Glow_Resistance;
else
i == v/Glow_Resitance;
end
end
And when I try to download the code to the component the following messsage apears:
So basically inducates me to use this other notation ' (a==b)==c' etc. but I don'r really understand how they work...
¿Does anyone know how this works and have an idea on how to implement it?

採用された回答

Sabin
Sabin 2023 年 3 月 4 日
In your case I would change the condition '(Threshold_Voltage <= abs(v) < Glow_Voltage)' into '(abs(v) >= Threshold_Voltage && abs(v) < Glow_Voltage)'. In this way there is no ambiguity and the code should compile. I hope this helps.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFoundation and Custom Domains についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by