TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/FabianeloV/Metodo-simplex/llms.txt
Use this file to discover all available pages before exploring further.
/api/v1/gradient prefix exposes two complementary endpoints for unconstrained optimization of functions with 2 or 3 variables.
/solve— iterative gradient descent (or ascent) starting from a user-supplied initial point./graphical— exhaustive critical-point search over a bounded domain, with surface or volume data for visualization.
"x**2 + y**2") and support a "max" or "min" goal.
POST /api/v1/gradient/solve
Applies gradient descent (goal: "min") or gradient ascent (goal: "max") from an initial point x0, updating the point by moving along the (negative) gradient scaled by step_size until the gradient norm falls below tolerance or max_iterations is reached.
Request
Symbolic expression of the objective function using standard Python/SymPy syntax. Variables must match the
variables list exactly.Example: "x**2 + y**2", "3*x**2 - 4*x*y + y**2 + 2*z".List of variable names used in
expression. Must contain 2 or 3 elements. Order determines the coordinate order in x0, optimal_point, gradient arrays, and iteration data.Example: ["x", "y"] or ["x", "y", "z"].Initial point for the gradient iteration. Must have the same number of elements as
variables.Example: [1.0, 1.0].Optimisation direction. Accepted values:
"max" or "min".Learning rate (step length) applied at each gradient update. Must be strictly greater than
0.Convergence criterion on the Euclidean gradient norm
‖∇f‖. Must be greater than 0 and at most 1.0.Maximum number of gradient steps. Accepted range: 1–500.
Response
Outcome of the solve. One of:
"optimal"— gradient norm fell belowtolerance."no_convergence"—max_iterationswas reached without satisfying the tolerance.
Coordinates of the optimal point in the same variable order as
variables. null if not converged.Function value at
optimal_point. null if not converged.Euclidean norm of the gradient at the final iteration.
null if not converged.Actual number of gradient steps performed.
Step-by-step iteration table, one entry per gradient step.
Human-readable string representation of
f as parsed by SymPy (e.g. "x**2 + y**2").Human-readable string representations of each partial derivative, in the same order as
variables (e.g. ["2*x", "2*y"]).Variable names echoed from the request.
Human-readable summary of the result.
Example
Minimize f(x, y) = x² + y² from the initial point(1, 1).
POST /api/v1/gradient/graphical
Locates and classifies all critical points of the objective function within the given variable bounds by running a multivariate Newton solver from multiple starting points on a grid. For 2-variable functions it also computes surface grid data (z[i][j] = f(x[i], y[j])); for 3-variable functions it computes volume scatter data — both ready for Plotly rendering.
Request
Symbolic expression of the objective function. Must reference only the variables listed in
variables.List of 2 or 3 variable names. Order matches
bounds and all output arrays.Per-variable search bounds. Each element is a two-element array
[min, max] with max > min. The number of bound pairs must equal the number of variables.Example: [[-2, 2], [-2, 2]] restricts both x and y to [−2, 2].Optimisation direction. Accepted values:
"max" or "min". Used to select the best critical point from those found.Response
Outcome of the search. One of:
"optimal"— at least one valid critical point was found within the bounds."no_critical_point"— no critical point satisfying the stationarity conditions was found in the domain.
Variable names echoed from the request.
Human-readable string representation of
f as parsed by SymPy.Coordinates of the best critical point found according to
goal. null if status is "no_critical_point".Function value at
optimal_point. null if status is "no_critical_point".All distinct critical points found inside the bounds.
Grid data for 2-variable surface plots.
null for 3-variable problems.Scatter data for 3-variable volume plots.
null for 2-variable problems.Human-readable summary of the result.
Example
Find critical points of f(x, y) = x² + y² within[−2, 2] × [−2, 2].
The
surface field is only populated for 2-variable functions. For 3-variable functions the volume field is populated instead and surface is null.Health Check
GET /api/v1/gradient/health
Returns a liveness confirmation for the Gradient Optimization service.