How this calculation works
The Monge Ampere equation sets the determinant of a function's Hessian equal to a prescribed positive density. A convexity condition selects the elliptic branch. Without that condition, solving a determinant equation alone can return a different and inappropriate solution.
Use a genuinelymonotone wide-stenclediscretization ofdetD²u=f withconvexity. Min overorthogonalgrid directions of positive directional secondderivativeproducts (negativepartpenalty as inFroeseOberman); normalize directionlengths; boundaryintersectionunequalsteps requiresconsistentmonotone interpolation. Directionset mustcontainbeyondx/y andrefineangularlyforconsistency. DampedNewton/policyiteration withdiscreteconvexinitialguess andresidualreport. Naive centraldet uxxuyy-uxy² isnotmonotone andinsufficient forclaimedviscositymethod. Feasibilityoffixedboundaryconvexitycanfail; mustseparateunresolvedfromno-solution.A worked example
With the prefilled inputs, maximumStencilResidual = 9.618418095325154e-07. Square grid; only perimeter of boundary matrix is fixed. Positive rhs; finite wide-stencil convex solution.
Good to know
Monotone directional determinant minimum with four orthogonal direction pairs and interpolated boundary rays. Finite-stencil convex solution,not an exact continuous Hessian solution or optimal-transport map.
Reference: Primary method reference or author-maintained documentation (opens in a new tab) ↗
A nonlinear equation with a convex branch
The Monge Ampere equation sets the determinant of a function's Hessian equal to a prescribed positive density. A convexity condition selects the elliptic branch. Without that condition, solving a determinant equation alone can return a different and inappropriate solution.
This calculator considers a square domain with fixed boundary values. The supported square grid has nine through twenty-five nodes on each side and a positive common spacing. Only perimeter entries of the boundary array are fixed; its interior entries are replaced by the solver initialization. It does not automatically construct an optimal-transport map from the same-looking determinant equation.
Compare with the Two dimensional Poisson equation calculator on a unit square. Solve nonlinearHessiandeterminant det(D²u)=f withconvexityconstraints; PoissoncontrolsHessiantraceinstead.
Density and boundary compatibility
Square grid; only perimeter of boundary matrix is fixed. Positive rhs; finite wide-stencil convex solution.The right-hand side must be positive under the stated elliptic problem. Boundary values must admit a suitable convex solution. Arbitrary arrays of heights can violate that condition even when every density value is positive.
The page should expose its spatial coordinates and boundary convention. A row-major matrix is not self-explanatory when the vertical axis is reversed by a plot. A wrongly oriented boundary can change the problem while leaving its numerical dimensions valid.
A finite directional determinant stencil
The implementation uses four orthogonal direction pairs generated from(1,0),(1,1),(1,2) and(2,1). It takes a minimum of the products of positive directional curvatures, with a penalty for negative directional curvature. Rays meeting the boundary use the corresponding distances and interpolated perimeter values.
This is a fixed finite-direction numerical scheme, not a claim of an exact continuous Hessian determinant or an automatically angularly refined viscosity limit. The ordinary central-difference determinant is not being substituted, but continuum convergence still requires the assumptions and refinement analysis appropriate to the particular directional construction.
Local bracketing and nonlinear sweeps
The routine updates each interior grid value by bracketing a local scalar equation and bisecting its root while neighboring values are held at their current iterate. It repeats these nonlinear sweeps until the maximum stencil residual meets the selected scaled threshold or the fixed sweep budget is exhausted.
The result includes the final grid, maximum stencil residual, minimum directional curvature and sweep count. These are finite-stencil diagnostics. A failed convexity check or unresolved bracket stops the calculation, and a sweep-cap failure does not prove that the boundary-value problem lacks a mathematical convex solution.
A quadratic worked check
Set the boundary to one half of x squared plus y squared and choose density one throughout the unit square. The Hessian of that quadratic is the identity, so its determinant is one and every unit directional curvature is one.
The same quadratic should satisfy the interior stencil whenever its directional sampling is exact for quadratics. A second test with a rotated positive Hessian is important: passing only the identity example would not reveal missing angular directions or mixed-curvature errors.
Interpreting a numerical surface
The static figure can show contour lines or an exact quadratic benchmark, while the result table reports the maximum equation residual. Convexity is more than a surface looking bowl-shaped from one view. The displayed diagnostics should summarize the actual directional tests used by the solver.
Grid refinement and angular-stencil refinement address different approximations. This release keeps its four direction pairs fixed, so adding nodes does not claim to remove angular bias automatically. A small discrete residual therefore needs to be interpreted together with the scheme and its refinement behavior.
Interpreting the bounded solution
The returned surface solves a finite-stencil approximation when its residual and directional-convexity checks pass. It must not be described as an optimal-transport map, a rigorously enclosed continuum solution or a Newton-solver output; the implemented iteration is a sequence of local bracketed updates. Exact quadratics and grid comparisons remain useful validation tools without supplying those stronger claims.
The bounded browser problem excludes arbitrary nonconvex domains and does not determine whether incompatible-looking boundary data admit some other solution concept. Invalid dimensions, nonpositive density, failed brackets and an exhausted work budget have different meanings. Preserve the actual failure message rather than replacing it with an assertion that no solution exists. Monotone directional determinant minimum with four orthogonal direction pairs and interpolated boundary rays. Finite-stencil convex solution,not an exact continuous Hessian solution or optimal-transport map.
A few questions, answered
Why require convexity?
It selects the elliptic solution branch of the determinant equation.
Can a central-difference determinant be called the same method?
Not without the required monotonicity and convergence properties; the planned method uses a genuine wide stencil.
Does positive density guarantee compatible boundary data?
No; the boundary may still fail to admit the supported convex solution.
Does a small grid residual prove continuum convergence?
No; spatial and angular refinement plus the scheme's assumptions are also required.