benchflow-ai/skillsbench/casadi-ipopt-nlp
- community
Checking that the SKILL.md file is still in the repository.
Nonlinear optimization with CasADi and IPOPT solver. Use when building and solving NLP problems: defining symbolic variables, adding nonlinear constraints, setting solver options, handling multiple initializations, and extracting solutions. Covers power systems optimization patterns including per-unit scaling and complex number formulations.
Install
npx vskill@latest install benchflow-ai/skillsbench/casadi-ipopt-nlpSKILL.md
CasADi + IPOPT for Nonlinear Programming
CasADi is a symbolic framework for nonlinear optimization. IPOPT is an interior-point solver for large-scale NLP.
Quick start (Linux)
Building an NLP
1. Decision variables
2. Objective function
Build symbolic expression:
3. Constraints
Collect constraints in lists with bounds:
4. Variable bounds
5. Create and call solver
IPOPT options (tuning guide)
| Option | Default | Recommendation | Notes | |
|---|---|---|---|---|
tol | 1e-8 | 1e-7 | Convergence tolerance | |
acceptable_tol | 1e-6 | 1e-5 | Fallback if tol not reached | |
max_iter | 3000 | 2000 | Increase for hard problems | |
mu_strategy | monotone | adaptive | Better for nonconvex | |
print_level | 5 | 0 | Quiet output |
Initialization matters
Nonlinear solvers are sensitive to starting points. Use multiple initializations:
Good initialization strategies:
- Data-derived: Use values from input data, clipped to bounds
- Flat start: Nominal values (e.g., Vm=1.0, Va=0.0)
- Always enforce known constraints in initial point (e.g., reference angle = 0)
Extracting solutions
Power systems patterns
Per-unit scaling
Work in per-unit internally, convert for output:
Cost functions often expect MW, not per-unit - check the formulation.
Bus ID mapping
Power system bus numbers may not be contiguous:
Aggregating per-bus quantities
Common failure modes
- Infeasible: Check bound consistency, constraint signs, unit conversions
- Slow convergence: Try different initialization, relax tolerances temporarily
- Wrong tap handling: MATPOWER uses
tap=0to mean 1.0, not zero - Angle units: Data often in degrees, solver needs radians
- Shunt signs: Check convention for Gs (conductance) vs Bs (susceptance)
- Over-rounding outputs: Keep high precision (≥6 decimals) in results
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtasks/energy-ac-optimal-power-flow/environment/skills/casadi-ipopt-nlp/SKILL.md
Popularity
- Repository stars
- 1,474
- Repository forks
- 325
- 7-day trend score
- 36
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/benchflow-ai/skillsbench/casadi-ipopt-nlp)