微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 电磁仿真讨论 > Conditional Statement in HFSS?

Conditional Statement in HFSS?

时间:03-30 整理:3721RD 点击:
Hi
Is someone aware how to create an "if-then-else" type of conditional statement in HFSS? I wish to assign value to a Project or Design Variable based on a condition. More explicit, my requirement is as follows:
We are aware of creation of project/design variables in HFSS. Say, I wish to create following project variables in HFSS:
SWt: Width of a Microstrip Transmission Line Trace,
SLt : Length of the Microstrip Transmission Line Trace, and
SHs: Height of the Substrate.
What I now wish to do is to create two more such variables for the Width and the Height of a Waveguide Port (that is connected on one of the edges of the microstrip trace), say Wp and Hp. Since, Wp and Hp depend on Wt and Hs, thus, I wish to create a logical expression so as to assign values for Wp and Hp, like the following logic:
if (Wt/Hs < 1)
Wp = 20*round(Wt);
Hp = round(Hs/Wt)*ceil(Hs);
else
Wp = round((Wt^3)/(Hs^2));
Hp = round(Wt);
end
Thanks in Advance!
Vivs.

Someone has suggested that the syntax for "if-then-else" type of statement in HFSS is if(<logical condition>, <statement to be executed for true condition>, <statement to be executed for false condition>).
I will try that out.

The syntax worked [:)]! However, I am not able to use HFSS's intrinsic functions (round and ceil) while assigning values to project variables for Port Dimensions. :( Specifically, I am not able to use them in following ways:
SWp = if(SWt/SHs < 1, 20*round(SWt), round((SWt^3)/(SHs^2)));
SHp = if(SWt/SHs < 1, round(SHs/SWt)*ceil(SHs), round(SWt));
I am forced to remove 'round' and 'ceil' functions from above logic.
Any solutions for this issue?

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top