09-LTspice 常用函数解析
可以用于任何自定义的命令:.param 参数定义
.dc
Function NameDescription
abs(x)
绝对值Absolute value of x
acos(x)
反余弦的实部Real part of the arc cosine of x, e.g., acos(-5) returns 3.14159, not 3.14159+2.29243i
arccos(x)Synonym for acos()
acosh(x)
反双曲余弦的实部Real part of the arc hyperbolic cosine of x, e.g., acosh(.5) returns 0, not 1.0472i
asin(x)
反正弦的实部Real part of the arc sine of x, e.g., asin(-5) returns -1.57080, not -1.57080+2.29243i
arcsin(x)Synonym for asin()
asinh(x)
反双曲正弦Arc hyperbolic sine
atan(x)
反正切Arc tangent of x
arctan(x)Synonym for atan()
atan2(y,x)
四象限圆弧切线Four quadrant arc tangent of y/x
atanh(x)
反双曲正切Arc hyperbolic tangent
buf(x)1 if x > .5, else 0
cbrt(x)
立方根Cube root of (x)
ceil(x)
等于或大于x的整数Integer equal or greater than x
cos(x)
角的余弦Cosine of x
cosh(x)
双曲cosxHyperbolic cosine of x
exp(x)
E的x次方e to the x
fabs(x)
abs (x)一样Same as abs(x)
flat(x)
在-x和x之间有均匀分布的随机数Random number between -x and x with uniform distribution
floor(x)
等于或小于x的整数Integer equal to or less than x
gauss(x)
来自高斯分布的随机数和Random number from Gaussian distribution with sigma of x.
hypot(x,y)
平方和sqrt(x**2 + y**2)
if(x,y,z)
比较If x > .5, then y else z
int(x)
取整Convert x to integer
inv(x)
四舍五入0. if x > .5, else 1.
limit(x,y,z)
x y z的中间值Intermediate value of x, y, and z
ln(x)
x的自然对数Natural logarithm of x
log(x)
ln()的替代语法Alternate syntax for ln()
log10(x)
以10为底的对数Base 10 logarithm
max(x,y)
x或y的最大值The greater of x or y
mc(x,y)
一个在x*(1+y)和x*(1-y)之间具有均匀分布的随机数A random number between x*(1+y) and x*(1-y) with uniform distribution.
min(x,y)
x或y的最小值The smaller of x or y
pow(x,y)
x**y的实部Real part of x**y, e.g., pow(-.5,1.5) returns 0., not 0.353553i
pwr(x,y)abs(x)**y
pwrs(x,y)sgn(x)*abs(x)**y
rand(x)
根据x的整数值,0到1之间的随机数Random number between 0 and 1 depending on the integer value of x.
random(x)
类似于rand(),但是值之间的平滑过渡Similar to rand(), but smoothly transitions between values.
round(x)
最接近x的整数Nearest integer to x
sgn(x)
x的迹象Sign of x
sin(x)Sine of x
sinh(x)Hyperbolic sine of x
sqrt(x)Real part of the square root of x, e.g., sqrt(-1) returns 0, not 0.707107i
table(x,a,b,c,d,...)Interpolate a value for x based on a look up table given as a set of pairs of points.
tan(x)Tangent of x.
tanh(x)Hyperbolic tangent of x
u(x)Unit step, i.e., 1 if x > 0., else 0.
uramp(x)x if x > 0., else 0.
以下操作按求值优先级的倒序分组:
OperandDescription
&
将表达式两边转换为布尔值,然后是ANDConvert the expressions to either side to Boolean, then AND.
|
将表达式两边转换为布尔值,然后是ORConvert the expressions to either side to Boolean, then OR.
^
将表达式两边转换为布尔值,然后是XOR值Convert the expressions to either side to Boolean, then XOR.
>True if expression on the left is greater than the expression on the right, otherwise false.
<True if expression on the left is less than the expression on the right, otherwise false.
>=True if expression on the left is greater than or equal the expression on the right, otherwise false.
<=True if expression on the left is less than or equal the expression on the right, otherwise false.
+Floating point addition
-Floating point subtraction
*Floating point multiplication
/Floating point division
**Raise left hand side to power of right hand side, only real part is returned, e.g., -2**1.5 returns zero, not 2.82843i
页:
[1]