Advanced maths

Geometric programming calculator for posynomial objectives and constraints

Optimize positive variables with posynomial objectives and inequalities by converting the model to convex log coordinates.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Optimize positive variables with posynomial objectives and inequalities by converting the model to convex log coordinates.

THE FORMULASet y_i=log(x_i). A term c Πx_i^a_i becomes exp(log(c)+aᵀy), and log of a posynomial becomes log-sum-exp.

A worked example

Minimize x+y subject to 1/(xy)≤1 and 0.1≤x,y≤10. The unique optimum is x=y=1, objective 2, because x+y≥2sqrt(xy)≥2.

Good to know

One to four strictly positive variables with finite positive bounds, up to six posynomial inequalities, three monomial equalities and20 terms per expression. Positive coefficients and bounded real exponents only; convex log-sum-exp model with numerical KKT and refinement diagnostics. No negative-coefficient signomial programs, automatic model convexification or global exact certificate after numerical failure.

Identify monomials and posynomials

In geometric programming, a monomial is a positive coefficient multiplied by positive variables raised to real powers. The powers need not be integers or nonnegative. A posynomial is a finite sum of those monomials with positive coefficients. These definitions differ from the narrower school-algebra meaning of polynomial, so checking coefficient signs and variable domains is essential before entering a model.

The JSON objective is a list of coefficient and exponent-vector terms. Each inequality is another term list constrained to be at most one. Each equality must contain exactly one monomial and is set equal to one. Bounds are finite and strictly positive. A negative coefficient creates a signomial expression outside this calculator’s convex model rather than a small numerical exception to the same method.

The same feasible decisions in log coordinates(1,1)xy = 1Positive coordinates(0,0)u + v = 0Log coordinates
Scroll across to see the full diagram.
The boundary xy=1 becomes u+v=0 for u=log(x),v=log(y).

Compare this with the Convex quadratic programming calculator with constraints. Solves positive-variable monomial/posynomial optimization through a log-domain convex transformation. This is not computing a geometric mean or solving a quadratic objective, and the current generic LP/QP cannot parse or optimize posynomials.

See why logarithms create convexity

Set each new variable y equal to the logarithm of its original positive variable. Products become linear combinations in exponent space. Taking the logarithm of a posynomial produces a log-sum-exp of affine functions, which is convex. Monomial equalities become affine equations, while positive box bounds become ordinary intervals between logarithms of their endpoints.

The transformation is one-to-one on the positive domain, so solving the transformed problem preserves feasible original decisions and the location of an optimum. It does not turn a negative or zero variable into valid input. It also does not justify taking the logarithm of a negative objective term. The accepted algebraic form is the reason the transformed optimization is convex.

Evaluate the transformed model stably

A direct sum of exponentials can overflow even when its logarithm is moderate. Stable log-sum-exp subtracts the largest exponent before summing and adds it back after taking the logarithm. Derivatives use normalized exponential weights, yielding gradients and curvature information for the numerical solver without expanding enormous monomial values in the original coordinates.

The numerical output should include transformed feasibility and stationarity diagnostics as well as original-coordinate constraint values. An apparently small violation in logarithmic coordinates corresponds to a multiplicative original-domain discrepancy. The page should expose enough information to interpret that discrepancy. An iteration failure or an insufficiently refined KKT residual remains unresolved; the convex reformulation does not make an unconverged numerical candidate a certified optimum.

Check the product-constrained default

The default inequality is x^(-1)y^(-1)≤1, which is equivalent to xy≥1 because both variables are positive. The arithmetic-geometric mean inequality gives x+y≥2sqrt(xy)≥2. Equality in both inequalities requires x=y and xy=1, hence the unique feasible equality point attaining the lower bound is (1,1).

In log coordinates the inequality becomes -u-v≤0 and the objective becomes exp(u)+exp(v). The optimum is u=v=0. Its original objective is two, the product constraint is active and the positive bounds are inactive. This example independently checks exponent signs, the normalization to one and the exponential reconstruction of the decision vector, not merely the final objective value.

Read the positive-domain and log-domain picture

The illustration pairs a hyperbolic feasible boundary in the original positive quadrant with a straight constraint boundary in log coordinates. The same physical decision is shown in both panels. Curved appearance in the original coordinates does not imply a nonconvex geometric program after the stated transformation, and the logarithmic panel explains why a convex solver can be used.

Axes in the transformed panel represent logarithms, so equal distances correspond to multiplicative changes in the original variables. Moving one unit is multiplication by the base of the natural logarithm rather than adding one original unit. The diagram is a default example, not an automatically generated proof for any edited JSON. Check the accepted term structure and the actual constraint residuals for the entered problem.

Keep scaling and model assumptions visible

One through four positive variables are supported, with at most six posynomial inequalities, three monomial equalities and twenty terms per expression. Exponents must remain within the implementation’s finite bounds. Combining many orders of magnitude is one motivation for a log-domain representation, but extreme coefficients and exponents can still cause conditioning or feasibility difficulties.

All physical quantities should be made dimensionally consistent before forming sums. Adding monomials with incompatible units does not become meaningful because a numerical solver accepts their coefficients. When variables carry units, nondimensionalization provides a clearer basis for logarithms and exponent interpretation. Save those reference scales with the model so a later coefficient comparison reflects the same mathematical quantities.

Choose GP only when its form is present

A positive-variable optimization problem is not automatically a geometric program. Subtractions, general equalities between posynomials and arbitrary sign-changing formulas can destroy the required convex structure. Some expressions admit legitimate algebraic reformulations, but those need a separate derivation rather than automatic acceptance under this page’s input parser.

Use this page when a posynomial or monomial model has been explicitly constructed and its assumptions suit the application. It returns a numerical optimum candidate with diagnostic evidence rather than a physical design guarantee. If the model is only an approximation to an engineering process, numerical convergence resolves the approximation, while uncertainty in the model remains. Keep those two levels of confidence distinct when interpreting a highly precise output.

A few questions, answered

May exponents be negative?

Yes. Real negative exponents are valid when variables and coefficients are positive.

May a coefficient be negative?

No. That leaves the supported posynomial model.

Can variables equal zero?

No. Strict positivity is required for the logarithmic transformation.

Are posynomial equalities supported?

Only monomial equalities are accepted; general posynomial equality is not a convex GP constraint.

Find your calculator

Start typing to explore the library.