論理演算子と数学演算子
論理演算がサポートされ、特定の優先順位が付けられています。
PREFEKOでは、論理演算子を使用できます。引数がFALSEの場合はTRUEを返し、引数がTRUEの場合はFALSEを返す関数NOT()がサポートされています。区切り記号>、<、>=、<=、=、<>、AND、およびORもサポートされています。変数にブーリアン演算が適用された場合は、0の値がFALSEと見なされ、それ以外はTRUEと解釈されます。同様に、論理演算の結果では、FALSEが0に対応し、TRUEが1に対応します。
- 単一の数字、括弧内の式
- 関数呼び出し
- +と-(符号として使用される場合)
- ^
- * と/
- +と-
- >、<、>=、および<=
- =と<>
- AND
- OR
CL .....
DP A #!x #!y #!z
#z = #!z + 0.5
DP B #!x #!y #z
BL A B
** A dielectric sphere in the field of an incident wave
** Define the variables
#r = 1 ** Radius of the sphere
#betrad = 1 ** Electrical size of the sphere
#epsr = 15 ** The relative dielectric constant
#maxlen = 0.7 ** The maximum edge length
** Define segmentation parameters
IP #maxlen
** The corner points
DP A 0 0 0
DP B 0 0 #r
DP C #r 0 0
** Select the medium
ME 1 0
** Generate an eighth of the sphere
KU A B C 0 0 90 90 #maxlen
** Use symmetry in all three coordinate planes
** yz-plane: ideal electrically conducting plane
** xz-plane: ideal magnetically conducting plane
** xy-plane: only geometrically symmetric
SY 1 2 3 1
** End of the geometry
EG 1 0 0 0 0
** Assigning the dielectric's properties
DI #epsr 1.0
** Incident plane wave excitation
#freq = #betrad * #c0/(2*#pi*#r)
FR 1 0 #freq
A0 0 1 1 1.0 0.0 -180.0
** Near fields along the Z axis
FE 1 1 1 25 0 0.0 0.0 -1.98 0.0 0.0 0.04
FE 4 1 1 50 0 0.0 0.0 -0.98 0.0 0.0 0.04
FE 1 1 1 25 0 0.0 0.0 1.02 0.0 0.0 0.04
** End
EN
変数を使用すれば、形状が変化する構造(反射器の手前にある距離が変化するアンテナなど)の調査が、1つの変数(距離パラメータ)を変えるだけで済むため、容易になります。FORループとIF条件も使用できます。