×

Product

Math
Run the live example Free · no sign-up · runs in your browser

Calculates the algebraic product of all connected input signals. Features a multi-wire input terminal (multiple: true), enabling an arbitrary number of signals to be multiplied together in a single compact node. Essential for instantaneous electrical power calculations (P=V⋅IP = V \cdot I), mechanical power and torque relations (P=τ⋅ωP = \tau \cdot \omega), aerodynamic drag modeling (Fd∝v2F_d \propto v^2), amplitude modulation (AM), and modeling nonlinear multi-variable interactions.

Mathematical Model

For an arbitrary set of NN active input signals u1(t),u2(t),…,uN(t)u_1(t), u_2(t), \dots, u_N(t), the output represents the continuous product:

y(t)=∏i=1Nui(t)=u1(t)⋅u2(t)⋯uN(t)y(t) = \prod_{i=1}^N u_i(t) = u_1(t) \cdot u_2(t) \dotsm u_N(t)

In the boundary case where only a single wire is connected (N=1N = 1), the block functions as a transparent unity passthrough:

y(t)=u1(t)y(t) = u_1(t)

When no inputs are connected (N=0N = 0), the block outputs zero:

y(t)=0.0y(t) = 0.0

Inputs & Outputs

Direction ID Label Type Status
→ In in × number Required
← Out out Product number Output

Usage Examples

Example 1: Instantaneous Electrical Power Calculation

In electrical power system simulations, determining real and reactive power requires multiplying instantaneous voltage and current signals. Wiring the voltage transducer output v(t)=Vpeakcos⁡(ωt)v(t) = V_{\text{peak}} \cos(\omega t) and current transducer output i(t)=Ipeakcos⁡(ωt−ϕ)i(t) = I_{\text{peak}} \cos(\omega t - \phi) into a Product block generates the instantaneous power signal p(t)=v(t)⋅i(t)=Pavg+Pavgcos⁡(2ωt−ϕ)p(t) = v(t) \cdot i(t) = P_{\text{avg}} + P_{\text{avg}} \cos(2\omega t - \phi), which can then be averaged to calculate true active power.

Example 2: Aerodynamic Drag Velocity Squaring (v2v^2)

In flight mechanics and automotive simulation, aerodynamic drag force depends on the square of relative airspeed (Fdrag=12ρCdA⋅v2F_{\text{drag}} = \frac{1}{2} \rho C_d A \cdot v^2). Wiring the velocity signal v(t)v(t) into two terminals of a Product block computes v2(t)v^2(t), which is subsequently scaled by air density and drag coefficients in a Gain block to realistically model quadratic aerodynamic resistance.

Remarks & Best Practices

  • Multi-Wire Input Architecture: Accepts any number of simultaneous input connections (multiple: true), avoiding cascading two-input multipliers across complex diagrams.
  • Disconnected Port Fallback: Although the mathematical identity for multiplication is 1.01.0, this block outputs 0.00.0 when completely disconnected to prevent unexpected non-zero signals on the canvas.
  • Nonlinear Frequency Intermodulation: Multiplicative operations introduce frequency mixing (heterodyning), producing sum and difference frequencies (f1±f2f_1 \pm f_2) and harmonics.
  • High Numerical Precision: Evaluated using 64-bit floating-point numbers (f64), preserving precision across large dynamic ranges.

Related Components

  • Divide: Computes the quotient of numerator and denominator signals (u1/u2u_1 / u_2).
  • Gain: Multiplies a signal by a constant scalar factor.
  • Sum: Adds multiple input signals together.
  • MathFunction: Evaluates mathematical operations such as powers, roots, and logarithms.