Difference between revisions of "Glossary of EM.Cube's Python Functions"

From Emagtech Wiki
Jump to: navigation, search
(EM.Cube's Miscellaneous Python Functions)
(EM.Cube's Miscellaneous Python Functions)
Line 363: Line 363:
 
| EMAG Python function
 
| EMAG Python function
 
| Ramp function
 
| Ramp function
| -
+
| x if x>0, 0 if x<0
 
|-
 
|-
 
| sqr_wave(x)
 
| sqr_wave(x)
Line 385: Line 385:
 
| sin(pi*x)/(pi*x)
 
| sin(pi*x)/(pi*x)
 
|-
 
|-
| gauss(x)
+
| gauss(x,mu,sigma)
 
| EMAG  Python function
 
| EMAG  Python function
| Gaussian function
+
| Gaussian function of mean mu and standard deviation sigma
| -
+
| exp(-0.5*((x-mu)/sigma)**2)/sigma/sqrt(2*pi)
 
|-
 
|-
 
| msin(x,r)
 
| msin(x,r)
Line 403: Line 403:
 
| EMAG  Python function
 
| EMAG  Python function
 
| Sigmoid function of slope a
 
| Sigmoid function of slope a
| -
+
| 2/(1 + exp(-a*x)) - 1
 
|-
 
|-
 
| bh_window(x,T)
 
| bh_window(x,T)

Revision as of 04:11, 5 September 2016

Contents

Standard Python Functions

Syntax Type Description Notes
abs(x) Std. Python function Absolute value function x if x>0, -x if x<0
ceiling(x) Std. Python function Ceiling function Nearest integer >= x
floor(x) Std. Python function Floor function Nearest integer <= x
pow(x,y) Std. Python function Power function x**y
sqrt(x) Std. Python function Square root function pow(x,0.5)
exp(x) Std. Python function Exponential function pow(e,x)
log(x) Std. Python function Natural logarithm function -
log10(x) Std. Python function Base 10 logarithm function ln(x)/ln(10)
factorial(x) Std. Python function Factorial For integer values of x: n! = n(n-1)(n-2)...3.2.1
max(x,y) Std. Python function Maximum of x and y -
min(x,y) Std. Python function Minimum of x and y -
sin(x) Std. Python function Sine function -
cos(x) Std. Python function Cosine function -
tan(x) Std. Python function Tangent function -
asin(x) Std. Python function Inverse sine function -
acos(x) Std. Python function Inverse cosine function -
atan(x) Std. Python function Inverse tangent function -
atan2(x,y) Std. Python function Inverse tangent function -
sinh(x) Std. Python function Hyperbolic sine function -
cosh(x) Std. Python function Hyperbolic cosine function -
tanh(x) Std. Python function Hyperbolic tangent function -
asinh(x) Std. Python function Inverse hyperbolic sine function -
acosh(x) Std. Python function Inverse hyperbolic cosine function -
atanh(x) Std. Python function Inverse hyperbolic tangent function -

Advanced Mathematical Python Functions

Syntax Type Description Notes
sp.sici(x) Std. Python function Sine and cosine integral functions See Trigonometric Integrals on Wikipedia.
sp.fresnel(x) Std. Python function Sine and cosine Fresnel integral functions See Fresnel Integrals on Wikipedia.
sp.ellipe(x) Std. Python function Elliptic function of the first kind See Elliptic Integrals on Wikipedia.
sp.ellipk(x) Std. Python function Elliptic function of the second kind See Elliptic Integrals on Wikipedia.
sp.expi(x) Std. Python function Exponential integral function See Exponential Integrals on Wikipedia.
sp.expn(n,x) Std. Python function Generalized exponential integral function of order n See Exponential Integrals on Wikipedia.
sp.erf(x) Std. Python function Error function See Error Function on Wikipedia.
sp.erfc(x) Std. Python function Complementary error function See Error Function on Wikipedia.
sp.gamma(x) Std. Python function Gamma function See Gamma Function on Wikipedia.
sp.airy(x) Std. Python function Airy function of the first (Ai) and second (Bi) kind and their derivatives See Airy Functions on Wikipedia.
sp.j0(x) Std. Python function Bessel function of the first kind and order 0 See Bessel Functions on Wikipedia.
sp.j1(x) Std. Python function Bessel function of the first kind and order 1 See Bessel Functions on Wikipedia.
sp.jv(n,x) Std. Python function Bessel function of the first kind and order n See Bessel Functions on Wikipedia.
sp.y0(x) Std. Python function Bessel function of the second kind and order 0 See Bessel Functions on Wikipedia.
sp.y1(x) Std. Python function Bessel function of the second kind and order 1 See Bessel Functions on Wikipedia.
sp.yv(n,x) Std. Python function Bessel function of the second kind and order n See Bessel Functions on Wikipedia.
sp.i0(x) Std. Python function Modified Bessel function of the first kind and order 0 See Bessel Functions on Wikipedia.
sp.i1(x) Std. Python function Modified Bessel function of the first kind and order 1 See Bessel Functions on Wikipedia.
sp.iv(n,x) Std. Python function Modified Bessel function of the first kind and order n See Bessel Functions on Wikipedia.
sp.k0(x) Std. Python function Modified Bessel function of the second kind and order 0 See Bessel Functions on Wikipedia.
sp.k1(x) Std. Python function Modified Bessel function of the second kind and order 1 See Bessel Functions on Wikipedia.
sp.kv(n,x) Std. Python function Modified Bessel function of the second kind and order n See Bessel Functions on Wikipedia.
sp.sph_jn(n,x) Std. Python function Spherical Bessel function of the first kind and order n See Bessel Functions on Wikipedia.
sp.sph_yn(n,x) Std. Python function Spherical Bessel function of the second kind and order n See Bessel Functions on Wikipedia.
sp.sph_in(n,x) Std. Python function Modified spherical Bessel function of the first kind and order n See Bessel Functions on Wikipedia.
sp.sph_kn(n,x) Std. Python function Modified spherical Bessel function of the second kind and order n See Bessel Functions on Wikipedia.
sp.lpn(n,x) Std. Python function Legendre function of the first kind and order n See Legendre Polynomials on Wikipedia.
sp.lqn(n,x) Std. Python function Legendre function of the second kind and order n See Legendre Polynomials on Wikipedia.
sp.lpmn(m,n,x) Std. Python function Associated Legendre function of the first kind and order n See Legendre Polynomials on Wikipedia.
sp.lqmn(m,n,x) Std. Python function Associated Legendre function of the second kind and order n See Legendre Polynomials on Wikipedia.
sp.eval_chebyt(n,x) Std. Python function Chebyshev polynomial of the first kind and order n See Chebyshev Polynomials on Wikipedia.
sp.eval_chebyu(n,x) Std. Python function Chebyshev polynomial of the second kind and order n See Chebyshev Polynomials on Wikipedia.
sp.eval_legendre(n,x) Std. Python function Legendre polynomial of order n See Legendre Polynomials on Wikipedia.
sp.eval_laguerre(n,x) Std. Python function Laguerre polynomial of order n See Laguerre Polynomials on Wikipedia.
sp.eval_hermite(n,x) Std. Python function Hermite polynomial of order n See Hermite Polynomials on Wikipedia.
Math_ce(n,r,x) Std. Python function Even periodic (cosine) Mathieu function of order n See Mathieu Functions on Wikipedia.
Math_se(n,r,x) Std. Python function Odd periodic (sine) Mathieu function of order n See Mathieu Functions on Wikipedia.

EM.Cube's Miscellaneous Python Functions

Syntax Type Description Notes
rect(x) EMAG Python function Rectangle function 1 if |x|≤0.5, 0 elsewhere
tri(x) EMAG Python function Triangle function 1-x|≤1, 0 elsewhere
spline2(x) EMAG Python function Quadratic spline function -
spline3(x) EMAG Python function Cubic spline function -
step(x) EMAG Python function Step function 1 if x>0, 0 if x<0
sgn(x) Std. Python function Sign function 1 if x>0, -1 if x<0
ramp(x) EMAG Python function Ramp function x if x>0, 0 if x<0
sqr_wave(x) EMAG Python function Square wave function -
tri_wave(x) EMAG Python function Triangle wave function -
sawtooth(x) EMAG Python function Sawtooth wave function -
sinc(x) EMAG Python function Sinc function sin(pi*x)/(pi*x)
gauss(x,mu,sigma) EMAG Python function Gaussian function of mean mu and standard deviation sigma exp(-0.5*((x-mu)/sigma)**2)/sigma/sqrt(2*pi)
msin(x,r) EMAG Python function super-quadratic sine function of order r -
mcos(x,r) EMAG Python function super-quadratic cosine function of order r -
sigmoid(x,a) EMAG Python function Sigmoid function of slope a 2/(1 + exp(-a*x)) - 1
bh_window(x,T) EMAG Python function Blackman-Harris window function -
bh_step(x,T) EMAG Python function Blackman-Harris step function -
rand(x,y) EMAG Python function Random function -
rosen(x,y,a,b) EMAG Python function Rosenbrock function (a-x)**2 + b*(y-x**2)**2
mean(x,y) EMAG Python function arithmetic mean of x and y 0.5*(x+y)
geo(x,y) EMAG Python function geometric mean of x and y sqrt(x*y)
harm(x,y) EMAG Python function harmonic mean of x and y 2/(1/x+1/y)
sqr2(x,y) EMAG Python function sum of squares of x and y x**2 + y**2
sqr3(x,y,z) EMAG Python function sum of squares of x and y and z x**2 + y**2 + z**3
sqrt2(x,y) EMAG Python function radius of 2D point (x,y) sqrt(x**2 + y**2)
sqrt3(x,y,z) EMAG Python function radius of 3D point (x,y,z) sqrt(x**2 + y**2 + z**3)

EM.Cube's Design Python Functions

Syntax Type Description Notes
microstrip_design(z0,er) EMAG Python function Returns the width-to-height ratio of a microstrip transmission line z0: characteristic impedance in Ohms, er: substrate permittivity
microstrip_z0(w,h,er) EMAG Python function Returns the characteristic impedance of a microstrip transmission line in Ohms w: microstrip width, h: substrate height, er: substrate permittivity
microstrip_eps_eff(w,h,er) EMAG Python function Returns the effective permittivity of a microstrip transmission line w: microstrip width, h: substrate height, er: substrate permittivity
microstrip_lambda_g(w,h,er,freq_hertz) EMAG Python function Returns the guide wavelength of a microstrip transmission line in meters w: microstrip width, h: substrate height, er: substrate permittivity, freq_hertz: frequency in Hz
cpw_design_w(z0,s,h,er) EMAG Python function Returns the slot width of a coplanar waveguide (CPW) transmission line z0: characteristic impedance in Ohms, s: center strip width (or slot spacing), h: substrate height, er: substrate permittivity
cpw_design_s(z0,w,h,er) EMAG Python function Returns the center strip width (or slot spacing) of a coplanar waveguide (CPW) transmission line z0: characteristic impedance in Ohms, w: slot width, h: substrate height, er: substrate permittivity
coaxial_design(z0,er) EMAG Python function Returns the ratio of radius of the outer conductor to the radius of the inner condutcor of a coaxial transmission line z0: characteristic impedance in Ohms, er: core permittivity
waveguide_design(er,freq_hertz) EMAG Python function Returns the minimum larger dimension in meter of the cross section of a hollow rectangular waveguide above cutoff er: filling permittivity, freq_hertz: frequency in Hz
horn_design_a(D0_dB,a_lambda,b_lambda) EMAG Python function Returns the wavelength-normalized larger dimension of the aperture of an optimal pyramidal horn antenna D0_dB: directivity d, a_lambda: wavelength-normalized larger dimension of the feed waveguide, b_lambda: wavelength-normalized smaller dimension of the feed waveguide
horn_design_b(D0_dB,a_lambda,b_lambda) EMAG Python function Returns the wavelength-normalized smaller dimension of the aperture of an optimal pyramidal horn antenna D0_dB: directivity d, a_lambda: wavelength-normalized larger dimension of the feed waveguide, b_lambda: wavelength-normalized smaller dimension of the feed waveguide
horn_design_l(D0_dB,a_lambda,b_lambda) EMAG Python function Returns the wavelength-normalized length of an optimal pyramidal horn antenna D0_dB: directivity d, a_lambda: wavelength-normalized larger dimension of the feed waveguide, b_lambda: wavelength-normalized smaller dimension of the feed waveguide

EM.Cube's Python Functions for Geometric Object Creation

box(string label, any x0, any y0, any z0, any base_x, any base_y, any height[, any cap_top, any cap_bottom])

Example:box("Box_1",0,0,0,50,50,100)

Description: Draws a box object in the project workspace under the currently activated material group node, or modifies the box named 'label' if it already exists.

cylinder(string label, any x0, any y0, any z0, any radius, any height[, any start_angle, any end_angle, any cap_top, any cap_bottom])

Example:cylinder("Cylinder_1",0,0,0,10,100)

Description: Draws a cylinder object in the project workspace under the currently activated material group node, or modifies the cylinder named 'label' if it already exists. The arguments start_angle and end_angle are in degrees and specify a sweep about the cylinder's azimuth axis.

cone(string label, any x0, any y0, any z0, any base_radius, any height[, any top_radius, any start_angle, any end_angle, any cap_top, any cap_bottom])

Example:cone("Cone_1",0,0,0,30,40,20,0,180)

Description: Draws a cone object in the project workspace under the currently activated material group node, or modifies the cone named 'label' if it already exists. The arguments start_angle and end_angle are in degrees and specify a sweep about the cone's azimuth axis.

pyramid(string label, any x0, any y0, any z0, any base_x, any base_y, any height)

Example:pyramid("Pyramid_1",0,0,0,10,10,100)

Description: Draws a pyramid object in the project workspace under the currently activated material group node, or modifies the pyramid named 'label' if it already exists.

sphere(string label, any x0, any y0, any z0, any radius[, any start_angle, any end_angle])

Example:sphere("Sphere_1",0,0,0,10,0,180)

Description: Draws a sphere object in the project workspace under the currently activated Material Group node, or modifies the sphere named 'label' if it already exists. The arguments start_angle and end_angle are in degrees and specify a sweep about the sphere's azimuth axis.

ellipsoid(string label, any x0, any y0, any z0, any radius_x, any radius_y, any radius_z[, any start_angle, any end_angle])

Example:ellipsoid("Ellipsoid_1",0,0,0,100,100,50,0,360)

Description: Draws an ellipsoid object in the project workspace under the currently activated material group node, or modifies the ellipsoid named 'label' if it already exists. The arguments start_angle and end_angle are in degrees and specify a sweep about the ellipsoid's azimuth axis.

torus(string label, any x0, any y0, any z0, any radius_major, any radius_minor[, any start_angle, any end_angle])

Example:torus("Torus_1",0,0,0,50,20)

Description: Draws an torus object in the project workspace under the currently activated material group node, or modifies the torus named 'label' if it already exists. The arguments start_angle and end_angle are in degrees and specify a sweep about the torus's azimuth axis.

rect_strip(string label, any x0, any y0, any z0, any side_x, any side_y)

Example:rect_strip("my_rectangle",0,0,0,50,20)

Description: Draws a rectangle Strip object in the project workspace under the currently activated material group node, or modifies the rectangle strip object named 'label' if it already exists.

circ_strip(string label, any x0, any y0, any z0, any inner_radius, any outer_radius[, any start_angle, any end_angle])

Example:circ_strip("cs_1",0,0,0,50,0)

Description: Draws a circle strip object in the project workspace under the currently activated material group node, or modifies the circle strip object named 'label' if it already exists. The arguments start_angle and end_angle are in degrees and specify a sweep about the circle strip's azimuth axis.

radial_strip(string label, any x0, any y0, any z0, any radius, any base_length, any angle)

Example:radial_strip("Radial_1",0,0,0,50,0,90)

Description: Draws a radial strip object in the project workspace under the currently activated material group node, or modifies the radial strip object named 'label' if it already exists.

ellipse_strip(string label, any x0, any y0, any z0, any radius_x, any radius_y[, any start_angle, any end_angle])

Example:ellipse_strip("es_1",0,0,0,50,0)

Description: Draws a ellipse strip object in the project workspace under the currently activated material group node, or modifies the ellipse strip object named 'label' if it already exists. The arguments start_angle and end_angle are in degrees and specify a sweep about the ellipse strip's azimuth axis.

triangle_strip(string label, any x0, any y0, any z0, any side1, any side2, any angle)

Example:triangle_strip("ts_1",0,0,0,50,100,90)

Description: Draws a triangle strip object in the project workspace under the currently activated material group node, or modifies the triangle strip object named 'label' if it already exists.

taper_strip(string label, any x0, any y0, any z0, any base_width, any top_width, any length, any is_expo)

Example:taper_strip("ts_1",0,0,0,50,100,80,1)

Description: Draws a taper strip object in the project workspace under the currently activated material group node, or modifies the taper strip object named 'label' if it already exists. If the Boolean parameters "is_expo" is 1, an exponential taper will be drawn.

polygon_reg(string label, any x0, any y0, any z0, any radius, any n_sides)

Example:polygon_reg("ts_1",0,0,0,50,100,80,1)

Description: Draws a regular polygon object in the project workspace under the currently activated material group node, or modifies the regular polygon object named 'label' if it already exists.

spiral_strip(string label, any x0, any y0, any z0, any width, any radius_inner, any radius_outer, any nturns, any spiral_dir, any is_dual)

Example:spiral_strip("Spiral _1",0,0,0,10,50,5,0,0)

Description: Draws a spiral strip object in the project workspace under the currently activated material group node, or modifies the spiral strip named 'label' if it already exists. If the Boolean parameter "spiral_dir" is 1, the spiral curve will be drawn counter-clockwise. If the Boolean parameter "is_dual" is 1, a dual-arm spiral curve will be drawn.

polystrip(string label, 3x1 Python tuple p0, 3x1 Python tuple p1, ... 3x1 Python tuple pn)

Example:polystrip("ps_1",(0,0,0),(1,0,0),(1,0,0))

Description: Creates or modifies a Polystrip object in the project workspace. Each point is represented with a Python tuple type. The poly_strip function is 'self-closing' -- there is no need to supply the first point again at the end of the point list.

nurbs_strip(string label, 3x1 Python tuple p0, 3x1 Python tuple p1, ... 3x1 Python tuple pn)

Example:nurbs_strip("ns_1",(0,0,0),(1,0,0),(1,0,0))

Description: Creates or modifies a NURBS Strip object in the project workspace. Each point is represented with a Python tuple type. The nurbs_strip function is 'self-closing' -- there is no need to supply the first point again at the end of the point list.

line(string label, any x0, any y0, any z0, any length[, any dir])

Example:line("my_line",0,0,0,100,"x")

Description: Draws a Line object in the project workspace under the currently activated material group node, or modifies the line named 'label' if it already exists. Without the argument "dir", a vertical line is drawn by default.

circle(string label, any x0, any y0, any z0, any radius, any start_angle, any end_angle)

Example:circle("pyramid_1",0,0,0,10,10,100)

Description: Draws a circular curve object in the project workspace under the currently activated material group node, or modifies the circle named 'label' if it already exists. The parameters start_angle and end_angle are in degrees.

superquad(string label, any x0, any y0, any z0, any diam_x, any diam_y, any order)

Example:superquad("SuperQuad_1",0,0,0,50,20,4)

Description: Draws a super-quadratic curve object in the project workspace under the currently activated material group node, or modifies the super-quadratic curve named 'label' if it already exists. If order = 2, the curve reduces to an ellipse. Higher order make the round edges sharper. An infinite order reduces the curve to a rectangle.

parabola(string label, any x0, any y0, any z0, any focal_length, any axial_length, any half_only)

Example:parabola("Parabola _1",0,0,0,50,20,0)

Description: Draws a parabola object in the project workspace under the currently activated material group node, or modifies the parabola named 'label' if it already exists. If the Boolean parameter "half_only" is 1, only half of the parabola will be drawn.

hyperbola(string label, any x0, any y0, any z0, any diam_x, any diam_y, any axial_length, any half_only)

Example:hyperbola("Hyperbola _1",0,0,0,50,40,20,0)

Description: Draws a hyperbola object in the project workspace under the currently activated material group node, or modifies the hyperbola named 'label' if it already exists. If the Boolean parameter "half_only" is 1, only half of the hyperbola will be drawn.

spiral_curve(string label, any x0, any y0, any z0, any radius_inner, any radius_outer, any nturns, any spiral_dir, any is_dual)

Example:spiral_curve("Spiral _1",0,0,0,10,50,5,0,0)

Description: Draws a spiral curve object in the project workspace under the currently activated material group node, or modifies the spiral curve named 'label' if it already exists. If the Boolean parameter "spiral_dir" is 1, the spiral curve will be drawn counter-clockwise. If the Boolean parameter "is_dual" is 1, a dual-arm spiral curve will be drawn.

helix(string label, any x0, any y0, any z0, any radius_inner, any radius_outer, any nturns, any helix_dir)

Example:helix("Helix_1",0,0,0,15,15,10,0)

Description: Draws a helical curve in the project workspace under the currently activated material group node, or modifies the helix named 'label' if it already exists. The parameter "radius_inner" specifies the helix's radius at the beginning of the helix, and radius_outer specifies the radius at the end of the helix. If the Boolean parameter "helixl_dir" is 1, the helical curve will be drawn counter-clockwise.

polyline(string label, 3x1 Python tuple p0, 3x1 Python tuple p1, ... 3x1 Python tuple pn)

Example:poly_line("pl_1",(0,0,0),(1,0,0),(1,0,0))

Description: Creates or modifies a PolyLine object in the project workspace. Each point is represented with a Python tuple type. The poly_line is closed if p0 is specified again as pn, otherwise, it is open.

nurbs_curve(string label, 3x1 Python tuple p0, 3x1 Python tuple p1, ... 3x1 Python tuple pn)

Example:nurbs_curve("nc_1",(0,0,0),(1,0,0),(1,0,0))

Description: Creates or modifies a NURBS Curve object in the project workspace. Each point is represented with a Python tuple type. The curve is closed if p0 is specified again as pn, otherwise, it is open.

point(string label, any x0, any y0, any z0)

Example:point("Point_1",0,0,10)

Description: Draws a point in the project workspace under the currently activated material group node, or modifies the point named 'label' if it already exists.

EM.Cube's Python Functions for Geometric Object Transformation

translate_by(string label, real x_dist, real y_dist, real z_dist)

Example:translate_by("MyObj",10,10,x)

Description: Translates an object by the specified distances in each direction.

translate_to(string label, real x_dest, real y_dest, real z_dest)

Example:translate_to("MyObj",20,20,x2)

Description: Translates an object to the specified destination.

rotate(string label, any x0, any y0, any z0, any radius, any start_angle, any end_angle)

Example:rotate("pyramid_1",0,0,0,10,10,100)

Description: Draws a circular curve object in the scene under the currently activated Material Group node, or modifies a Circle object if Circle 'label' already exists. The parameters start_angle and end_angle are in degrees.

array(string label, string object, any x_count, any y_count, any z_count, any x_spacing, any y_spacing, any z_spacing)

Example:array("Array_1","Rect_Strip_1",4,4,1,"spacing","spacing",0)

Description: Create or modify an Array object.

explode(string object)

Example:explode("MyArray")

Description: Performs an explode operation on a CAD object named 'object'.

subtract(string label, string object_1, string object_2)

Example:subtract("Subtract_Object","Rect_Strip1","Rect_Strip2")

Description: Creates a Boolean object named 'label' by subtracting object_2 from object_1. An error will be thrown if a Boolean object named 'label' already exists.

union(string label, string object_1, string object_2)

Example:union("Union_Object","Rect_Strip1","Rect_Strip2")

Description: Creates a Boolean object named 'label' by unioning object_1 and object_2. An error will be thrown if a Boolean object named 'label' already exists.

intersect(string label, string object_1, string object_2)

Example:intersect("Intersection_Object","Rect_Strip1","Rect_Strip2")

Description: Creates a Boolean object named 'label' by intersecting object_1 and object_2. An error will be thrown if a Boolean object named 'label' already exists.

extrude(string label, string object, any height)

Example:extrude("Extrude_Object","Rect_Strip1",50)

Description: Creates or modifies an Extrusion object from CAD object 'object'. If modifying an existing extrusion, 'object' is ignored, and the pre-existing primitive is used. extrude(...) can only extrude objects that have a single face, and will extrude in the direction of the face's normal.

revolve(string label, string object, any x0, any y0, any z0, any uX, any uY, any uZ, any rot_angle)

Example:revolve("Rev1","Line_1",0,0,0,0,0,1)

Description: Creates or modifies a Revolution object called 'label', with a primitive object named 'object'. If modifying an existing Revolution object, 'object' is ignored, and the pre-existing primitive object is used. (x0,y0,z0) specifies the center of revolution, and (uX,uY,uZ) specifies the revolution axis. rot_angle is in degrees.

EM.Cube's Python Functions for Material or Object Group Creation

color_group(string label)

Example: color_group("Color_1")

Description: Creates a color group in CubeCAD module. If the color group 'label' already exists, the group is activated.

pec_group(string label)

Example: pec_group("PEC_1")

Description: Creates a PEC material group in the current module. If the PEC group 'label' already exists, the group is activated.

pec_voltage_group(string label, any voltage)

Example: pec_voltage_group("PEC_1",10)

Description: Creates a fixed-potential PEC object group in the current module. If the PEC group 'label' already exists, the group is activated.

pec_via_group(string label, any host_layer)

Example: pec_via_group("PEC_1",10)

Description: Creates an embedded PEC via set group in the current module. If the PEC via group 'label' already exists, the group is activated.

thinwire_group(string label, any radius)

Example: thinwire_group("Thinwire_1",4)

Description: Creates a Thinwire material group in the current module. If the thin wire group 'label' already exists, the group is activated.

pmc_group(string label)

Example: pmc_group("PMC_1")

Description: Creates a PMC material group in the current module. If the PMC group 'label' already exists, the group is activated.

slot_group(string label)

Example: slot_group("PMC_1")

Description: Creates a slot trace group in the current module. If the slot trace group 'label' already exists, the group is activated.

dielectric_group(string label, any eps, any sigma, any mu, any rho)

Example: dielectric_group("Dielectric_1","my_eps",0,1,0)

Description: Creates a dielectric material group in the current module with the specified material properties. If the dielectric group 'label' already exists, the group is activated.

impenetrable_surface_group(string label, any eps, any sigma)

Example: impenetrable_surface_group("Impenet_1",2.2,0.0001)

Description: Creates an impenetrable surface group in EM.Terrano. If the impenetrable surface group 'label' already exists, the group is activated.

penetrable_surface_group(string label, any eps, any sigma, any thickness)

Example: penetrable_surface_group("Penet_1",2.2,0.0001, 1)

Description: Creates a penetrable surface group in EM.Terrano. If the penetrable surface group 'label' already exists, the group is activated.

penetrable_volume_group(string label, any eps, any sigma)

Example: penetrable_volume_group("Vol_Penet_1",2.2,0.0001)

Description: Creates a penetrable volume group in EM.Terrano. If the penetrable volume group 'label' already exists, the group is activated.

terrain_group(string label, any eps, any sigma)

Example: terrain_group("Terrain_1",5.0,0.0001)

Description: Creates an terrain surface group in EM.Terrano. If the terrain surface group 'label' already exists, the group is activated.

base_point_group(string label)

Example: base_point_set("BP_Set_1")

Description: Creates a base point set in EM.Terrano. If the base point set group 'label' already exists, the group is activated.

virtual_group(string label)

Example: virtual_group("VIR_1")

Description: Creates a virtual object group in EM.Terrano. If the virtual group 'label' already exists, the group is activated.

impedance_surface_group(string label, any z_real, any z_imag)

Example: impedance_surface_group("IMP_1",100,-100)

Description: Creates a impedance_surface group in EM.Illumina. If the impedance surface group 'label' already exists, the group is activated.

conductive_sheet_group(string label, any sigma, any thickness)

Example: conductive_sheet_group("Cond_1",100, 0.01)

Description: Creates a conductive sheet group in EM.Picasso. If the conductive sheet group 'label' already exists, the group is activated.

charge_group(string label, any density)

Example: charge_group("Charge_1",-1e-5)

Description: Creates a volume charge source group in EM.Ferma. If the charge group 'label' already exists, the group is activated.

magnet_group(string label, any mu, any Mx, any My, any Mz)

Example: magnet_group("Magnet_1",1,0,0,100)

Description: Creates a permanent magnet source group in EM.Ferma. If the magnet group 'label' already exists, the group is activated.

volume_current_group(string label, any Jx, any Jy, any Jz)

Example: volume_current_group("Magnet_1",0,0,1e6)

Description: Creates a volume current source group in EM.Ferma. If the volume current group 'label' already exists, the group is activated.

wire_current_group(string label, any current, any wire_radius)

Example: wire_current_group("Magnet_1",1,0.5)

Description: Creates a wire current source group in EM.Ferma. If the wire current group 'label' already exists, the group is activated.

EM.Cube's Python Functions for Source & Lumped Device Definition

lumped_src(string label, any line_object, any offset, any polarity[, any amplitude, any phase, any resistance])

Example: lumped_src("LS_1","Line_1",50,0)

Description: Creates a lumped source in EM.Tempo. If the lumped source 'label' already exists, its properties are modified.

distributed_src(string label, any rect_object, any field_dir, any profile[, any amplitude, any phase, any resistance])

Example: distributed_src("DS_1","Rect_1","+y","uniform")

Description: Creates a distributed source in EM.Tempo. If the distributed source 'label' already exists, its properties are modified.

microstrip_src(string label, any rect_object, any height, any edge[, any amplitude, any phase, any resistance])

Example: microstrip_src("MS_1","Rect_1",1.5,"+x")

Description: Creates a microstrip port source in EM.Tempo. If the microstrip port 'label' already exists, its properties are modified.

cpw_src(string label, any rect_object, any spacing, any edge[, any amplitude, any phase, any resistance])

Example: cpw_src("CPW_1","Rect_1",1.5,"+x")

Description: Creates a CPW port source in EM.Tempo. If the CPW port 'label' already exists, its properties are modified.

coaxial_src(string label, any cylinder_object, any outer_radius, any edge[, any amplitude, any phase, any resistance])

Example: coaxial_src("COAX_1","Cyl_1",1.5,"+z")

Description: Creates a coaxial port source in EM.Tempo. If the coaxial port 'label' already exists, its properties are modified.

waveguide_src(string label, any box_object, any offset, any is_negative[, any amplitude, any phase, any resistance])

Example: waveguide_src("WG_1","Box_1",50,0)

Description: Creates a waveguide port source in EM.Tempo. If the waveguide port 'label' already exists, its properties are modified.

wire_gap_src(string label, any line_object, any offset, any polarity[, any amplitude, any phase, any resistance])

Example: wire_gap_src("WIG_1","Line_1",50,0)

Description: Creates a wire gap circuit source in EM.Libera. If the wire gap source 'label' already exists, its properties are modified.

rect_gap_src(string label, any rect_object, any offset, any polarity[, any amplitude, any phase, any resistance])

Example: rect_gap_src("GAP_1","Rect_1",0,0)

Description: Creates a strip gap circuit source in EM.Picasso or EM.Libera. If the strip gap source 'label' already exists, its properties are modified.

probe_gap_src(string label, any via_object, any polarity[, any amplitude, any phase, any resistance])

Example: probe_gap_src("Probe_1","Via_1",0)

Description: Creates a probe gap circuit source in EM.Picasso. If the probe gap source 'label' already exists, its properties are modified.

wave_port(string label, any rect_object, any offset, any is_negative[, any amplitude, any phase, any resistance])

Example: wave_port("WP_1","Rect_1",0,0)

Description: Creates a scattering wave port source in EM.Picasso or EM.Libera. If the wave port 'label' already exists, its properties are modified.

short_dipole(string label, any x0, any y0, any z0, any length, any uX, any uY, any uZ, any amplitude, any phase)

Example: wave_port("SD_1",0,0,50,3,0,0,1,1,0)

Description: Creates a Hertzian short dipole source. If the short dipole source 'label' already exists, its properties are modified.

planewave(string label, any theta, any phi, any polarization)

Example: planewave("PW_1",180,0,"tm")

Description: Creates a plane wave source. If the plane wave source 'label' already exists, its properties are modified.

gauss_beam(string label, any theta, any phi, any polarization, any focus_x, any focus_y, any focus_z, any radius, any p_mode, any q_mode)

Example: gauss_beam("PW_1",180,0,"tm",0,0,0,20,0,0)

Description: Creates a Gaussian beam source in EM.Tempo. If the Gaussian beam source 'label' already exists, its properties are modified.

huygens_src(string label, any filename[, any set_lcs, any polarization, any x0, any y0, any z0, any x_rot, any y_rot, any z_rot])

Example: huygens_src("HS_1","Huygens_1.HUY",1,100,100,0,0,0,0)

Description: Creates a Huygens source. If the Huygens source 'label' already exists, its properties are modified.

transmitter_set(string label, any base_point_set[, any pattern_file, any rot_x, any rot_y, any rot_z)

Example: transmitter_set("TX_1","PT_1","DPL_STD.RAD",0,90,0)

Description: Creates a transmitter set in EM.Terrano. If the transmitter set 'label' already exists, its properties are modified.

resistor(string label, any line_object, any offset, any resistance)

Example: resistor("Res_1","Line_1",25,50)

Description: Creates a resistor in EM.Tempo. If the resistor 'label' already exists, its properties are modified.

capacitor(string label, any line_object, any offset, any capacitance_pF)

Example: capacitor("Cap_1","Line_1",25,10)

Description: Creates a capacitor in EM.Tempo. If the capacitor 'label' already exists, its properties are modified.

inductor(string label, any line_object, any offset, any inductance_nH)

Example: inductor("Cap_1","Line_1",25,10)

Description: Creates a inductor in EM.Tempo. If the inductor 'label' already exists, its properties are modified.

diode(string label, any line_object, any polarity, any is_fA, any temperature_K, any ideality_factor)

Example: diode("Diode_1","Line_1",25,0,10,300,1)

Description: Creates a diode in EM.Tempo. If the diode 'label' already exists, its properties are modified.

EM.Cube's Python Functions for Observable Definition

port_definition_default(string label)

Example: port_definition_default("PD_1")

Description: Creates a default port definition observable. If the observable 'label' already exists, its properties are modified.

port_definition_custom(string label, (string port_1_src_1, string port_1_src_2, ..., string port_1_impedance), (string port_2_src_1, string port_2_src_2, ..., string port_2_impedance), ...)

Example: port_definition_custom("PD_1",("LS_1","LS_2",50),,("LS_3","LS_4",50))

Description: Creates a custom port definition observable. If the observable 'label' already exists, its properties are modified.

farfield(string label, any theta_incr, any phi_incr)

Example: farfield("FF_1",1,1)

Description: Creates a far-field radiation pattern observable. If the observable 'label' already exists, its properties are modified.

rcs_bistatic(string label, any theta_incr, any phi_incr)

Example: rcs_bistatic("RCS_1",1,1)

Description: Creates a bistatic RCS observable. If the observable 'label' already exists, its properties are modified.

current_dist(string label)

Example: current_dist("CD_1")

Description: Creates a current distribution observable. If the observable 'label' already exists, its properties are modified.

field_sensor(string label, any dir_coordinate, any x0, any y0, any z0, any xSize, any ySize, any zSize, any xSamples, any ySamples, any zSamples)

Example: field_sensor("FS_1","z",0,0,0,100,100,0,25,25,0)

Description: Creates a near-field sensor observable. If the observable 'label' already exists, its properties are modified.

field_sensor_grid(string label, any dir_coordinate, any x0, any y0, any z0)

Example: field_sensor_grid("FS_1","z",0,0,0)

Description: Creates a near-field sensor observable in EM.Tempo or EM.Ferma. If the observable 'label' already exists, its properties are modified.

field_probe(string label, any x0, any y0, any z0)

Example: field_probe("FS_1",0,0,50)

Description: Creates a temporal field probe observable in EM.Tempo or EM.Ferma. If the observable 'label' already exists, its properties are modified.

receiver_set(string label, any base_point_set[, any pattern_file, any rot_x, any rot_y, any rot_z)

Example: receiver_set("TX_1","PT_1","DPL_STD.RAD",0,90,0)

Description: Creates a receiver set in EM.Terrano. If the receiver set 'label' already exists, its properties are modified.

huygens_surface(string label, any x1, any y1, any z1, any x2, any y2, any z2, any xSamples, any ySamples, any zSamples)

Example: huygens_surface("HS_1",-10,-10,-10,10,10,10,40,40,40)

Description: Creates a Huygens surface observable. If the observable 'label' already exists, its properties are modified.

huygens_surface_grid(string label, any x1, any y1, any z1, any x2, any y2, any z2)

Example: huygens_surface_grid("HS_1",-10,-10,-10,10,10,10)

Description: Creates a Huygens surface observable in EM.Tempo. If the observable 'label' already exists, its properties are modified.

voltage_integral(string label, any x1, any y1, any z1, any x2, any y2, any z2)

Example: voltage_integral("FI_1",0,0,-10,0,0,10)

Description: Creates a voltage integral observable in EM.Ferma. If the observable 'label' already exists, its properties are modified.

current_integral(string label, any x1, any y1, any z1, any x2, any y2, any z2)

Example: current_integral("FI_1",-10,-10,0,10,10,0)

Description: Creates a current integral observable in EM.Ferma. If the observable 'label' already exists, its properties are modified.

conduction_current_integral(string label, any x1, any y1, any z1, any x2, any y2, any z2)

Example: conduction_current_integral("FI_1",-10,-10,0,10,10,0)

Description: Creates a conduction current integral observable in EM.Ferma. If the observable 'label' already exists, its properties are modified.

capacitance(string label, any x1, any y1, any z1, any x2, any y2, any z2, any x3, any y3, any z3, any x4, any y4, any z4)

Example: capacitance("FI_1",-10,-10,5,10,10,10,0,0,-10,0,0,10)

Description: Creates a capacitance integral observable in EM.Ferma. If the observable 'label' already exists, its properties are modified.

inductance(string label, any x1, any y1, any z1, any x2, any y2, any z2, any x3, any y3, any z3, any x4, any y4, any z4)

Example: inductance("FI_1",0,0,-10,10,0,10,2.5,-2.5,0,7.5,2.5,0)

Description: Creates a inductance integral observable in EM.Ferma. If the observable 'label' already exists, its properties are modified.

resistance(string label, any x1, any y1, any z1, any x2, any y2, any z2, any x3, any y3, any z3, any x4, any y4, any z4)

Example: resistance("FI_1",0,0,-10,0,0,10,-10,-10,0,10,10,0)

Description: Creates a resistance integral observable in EM.Ferma. If the observable 'label' already exists, its properties are modified.

flux_electric(string label, any x1, any y1, any z1, any x2, any y2, any z2)

Example: flux_electric("FI_1",-10,-10,5,10,10,10)

Description: Creates an electric flux integral observable in EM.Ferma. If the observable 'label' already exists, its properties are modified.

flux_magnetic(string label, any x1, any y1, any z1, any x2, any y2, any z2)

Example: flux_magnetic("FI_1",0,0,-10,10,0,10)

Description: Creates a magnetic flux integral observable in EM.Ferma. If the observable 'label' already exists, its properties are modified.

energy_electric(string label, any x1, any y1, any z1, any x2, any y2, any z2)

Example: energy_electric("FI_1",-10,-10,-10,10,10,10)

Description: Creates an electric energy integral observable in EM.Ferma. If the observable 'label' already exists, its properties are modified.

energy_magnetic(string label, any x1, any y1, any z1, any x2, any y2, any z2)

Example: energy_magnetic("FI_1",-10,-10,-10,10,10,10)

Description: Creates a magnetic energy integral observable in EM.Ferma. If the observable 'label' already exists, its properties are modified.

ohmic_loss(string label, any x1, any y1, any z1, any x2, any y2, any z2)

Example: ohmic_loss("FI_1",-10,-10,-10,10,10,10)

Description: Creates an ohmic loss integral observable in EM.Ferma. If the observable 'label' already exists, its properties are modified.

solution_plane(string label, any field_sensor_label, any is_quasi)

Example: solution_plane("FI_1","FS_1",1)

Description: Creates a 2D solution plane observable in EM.Ferma. If the observable 'label' already exists, its properties are modified.

EM.Cube's Python Functions for Simulation-Related Functions & Operations

select_module(string module_name)

Example: select_module("EM.Tempo")

Description: Selects and sets EM.Cube's active module.

set_units(string units)

Example: set_units("meter")

Description: Sets EM.Cube's project length units.

set_frequency(string value)

Example: set_frequency(2.4e9)

Description: Sets EM.Cube's center frequency.

set_bandwidth(string value)

Example: set_bandwidth(1e9)

Description: Sets EM.Cube's frequency bandwidth.

run_analysis()

Description: Runs a simulation.

set_periodic(string is_periodic, string spacingX, string spacingY)

Example: set_periodic(1,50,50)

Description: Designates the physical structure as periodic and sets the periods along the X and Y directions.

mesh()

Description: Generates and displays the mesh of the physical structure.

emtempo_mesh_settings(string cells_per_lambda, string ratio_contour, string ratio_thin, string ratio_abs)

Example: emtempo_mesh_settings(30,0.1,0.1,0.02)

Description: Sets the parameters of EM.Tempo's adaptive mesh generator.

emillumina_mesh_settings(string cells_per_lambda)

Example: emillumina_mesh_settings(30)

Description: Sets the parameters of EM.Illumina's mesh generator.

empicasso_mesh_settings(string cells_per_lambda, string ratio_contour, string ratio_thin, string ratio_abs)

Example: empicasso_mesh_settings(30)

Description: Sets the parameters of EM.Picasso's planar hybrid mesh generator.

emlibera_mesh_settings(string cells_per_lambda)

Example: emlibera_mesh_settings(30)

Description: Sets the parameters of EM.Libera's mesh generator.

emferma_mesh_settings(string cell_size_x, string cell_size_y, string cell_size_z)

Example: emferma_mesh_settings(0.5,0.5,0.5)

Description: Sets the parameters of EM.Ferma's fixed-cell mesh generator.

emterrano_mesh_settings(string edge_length, string angle_tol)

Example: emterrano_mesh_settings(5,10)

Description: Sets the parameters of EM.Terrano's facet mesh generator.

cubecad_mesh_settings(string edge_length, string angle_tol)

Example: cubecad_mesh_settings(5,10)

Description: Sets the parameters of CubeCAD's mesh generator.

emtempo_engine_settings(string engine, string power_threshhold, string max_timesteps)

Example: emtempo_engine_settings("single-precision",-50,20000)

Description: Sets the parameters of EM.Tempo's FDTD simulation engine.

emterrano_engine_settings(string bounce_count, string do_edge_diffraction, string angular_resolution, string ray_threshhold)

Example: emterrano_engine_settings(5,1,1,-100)

Description: Sets the parameters of EM.Terrano's SBR simulation engine.

empicasso_engine_settings(string matrix_solver, string error_tol, string max_iterations)

Example: empicasso_engine_settings("bicg",1e-3,1000)

Description: Sets the parameters of EM.Picasso's planar MoM simulation engine.

emillumina_engine_settings(string engine, string is_fixed_iteration, string error_tol, string max_iterations)

Example: emillumina_engine_settings("ipo",0,1e-2,20)

Description: Sets the parameters of EM.Illumina's Physical Optics simulation engine.

emferma_engine_settings(string matrix_solver, string error_tol, string max_iterations)

Example: emferma_engine_settings("bicg-stab",1e-3,100)

Description: Sets the parameters of EM.Ferma's electrostatic and magnetostatic simulation engines.

emlibera_engine_settings_wmom(string matrix_solver, string error_tol, string max_iterations)

Example: emlibera_engine_settings_wmom("bicg",1e-3,1000)

Description: Sets the parameters of EM.Libera's wire MoM simulation engines.

emlibera_engine_settings_smom(string matrix_solver, string error_tol, string max_iterations, string ncpus, string formulation, string alpha)

Example: emlibera_engine_settings_smom("bicg",1e-3,1000,4,"efie",0.4)

Description: Sets the parameters of EM.Libera's surface MoM simulation engines.



{"global_ground",emag_set_ground,METH_VARARGS,"global_ground(ground_on,eps,sigma) -- Set or unset global ground in EM.Terrano."},

{"get_domain_extent",emag_dom_getextents,METH_VARARGS,"get_domain_extent(coordinate) -- Get the specified extent of the domain box."}, {"set_domain_offset",emag_dom_offset,METH_VARARGS,"set_domain_offset(dxn_offset,dxp_offset,dyn_offset,dyp_offset,dzn_offset,dzp_offset) -- Set the offset values of the domain box in project units in all six directions."}, {"set_domain_offset_lambda",emag_dom_offset_lambda,METH_VARARGS,"set_domain_offset_lambda(dxn_offset,dxp_offset,dyn_offset,dyp_offset,dzn_offset,dzp_offset) -- Set the offset values of the domain box in wavelengths in all six directions."}, {"set_boundary_conditions",emag_set_bc,METH_VARARGS,"set_boundary_conditions(xn_type,xp_type,yn_type,yp_type,zn_type,zp_type) -- Set the boundary conditions on all the six walls of the domain box."},


{"zoom_extents",emag_zoom_extents,METH_VARARGS,"zoom_extents() --"}, {"freeze",emag_freeze,METH_VARARGS,"freeze(object,freeze_state) --"},

{"add_variable",emag_add_variable,METH_VARARGS,"add_variable(var_name,value) -- Add a variable to EM.Cube's variable list."},

{"plot_file",emag_plot_file_cartesian,METH_VARARGS,"plot_file(filename) -- Plot the contents of data file in EM.Grid."},

{"background_layer",emag_background_layer,METH_VARARGS,"background_layer(label,eps,sigma,mu,thickness) -- Add or modify a substrate layer in EM.Picasso."}, {"set_stackup_order",emag_set_stackup_order,METH_VARARGS,"set_stackup_order(\"THS\",layer_name_1,layer_name_2,...,layer_name_n,\"BHS\") -- Re-order EM.Picasso stackup based on background layer names and trace names."}, {"delete_background_layer",emag_delete_background_layer,METH_VARARGS,"delete_background_layer(label) -- Delete background layer denoted by label."},



 

Back icon.png Back to EM.Cube Main Page