solve_convex_optimization
Specify variables, objective expression, and constraints to solve convex optimization problems such as linear, quadratic, or semidefinite programming.
Instructions
Solve convex optimization problems using CVXPY.
This tool is ideal for mathematical optimization problems with convex objectives
and constraints, including linear programming, quadratic programming, and
semidefinite programming.
Args:
variables: List of variable definitions with 'name' and 'shape'
objective_type: Either 'minimize' or 'maximize'
objective_expr: The objective function expression as a string
constraints: List of constraint expressions as strings
parameters: Dictionary of parameter values (e.g., matrices A, b)
description: Optional problem description
Returns:
Solution results including variable values and objective value
Example:
variables = [{"name": "x", "shape": 2}]
objective_type = "minimize"
objective_expr = "cp.sum_squares(x)"
constraints = ["x >= 0", "cp.sum(x) == 1"]Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variables | Yes | ||
| objective_type | Yes | ||
| objective_expr | Yes | ||
| constraints | Yes | ||
| parameters | No | ||
| description | No |