casadi-ipopt-nlp

Solve power-system NLPs with CasADi and IPOPT.

4|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill casadi-ipopt-nlp-generalreasoning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: casadi-ipopt-nlp
Source: https://github.com/GeneralReasoning/env-skillsbench/tree/main/energy-ac-optimal-power-flow/environment/skills/casadi-ipopt-nlp
Command: npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill casadi-ipopt-nlp-generalreasoning

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CasADi-IPOPT NLP enables practitioners to formulate and solve large-scale nonlinear optimization problems in power-system contexts, turning complex dynamic equations into solvable models and delivering actionable operating points.

Core Features & Use Cases

  • Symbolic modeling and automatic differentiation with CasADi for large-scale NLPs.
  • IPOPT-based solver with configurable options and robust initialization strategies for multiple startup points.
  • Power-system patterns including per-unit scaling and complex-number formulations to map physical quantities to solver variables.
  • Extract and interpret outputs such as Vm, Va, Pg, Qg for grid operation analysis across contingencies.

Quick Start

Run the CasADi/IPOPT NLP workflow on your power-system data to obtain optimal voltages, angles, and generator setpoints.

Frequently Asked Questions about casadi-ipopt-nlp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I solve nonlinear optimization problems for power systems using CasADi and IPOPT?

To solve nonlinear optimization problems for power systems using CasADi and IPOPT, define symbolic variables, add nonlinear constraints, configure solver options, handle multiple initializations, and extract per-unit scaled AC power-flow solutions.

What is per-unit scaling in AC power-flow optimization and why is it needed?

Per-unit scaling in AC power-flow optimization maps physical grid quantities to solver variables using complex-number formulations. It is needed to normalize system values, ensuring numerical stability when the solver calculates optimal operating points.

Can I extract generator setpoints and voltage magnitudes from an NLP solver output?

Yes, you can extract generator setpoints and voltage magnitudes from the NLP solver output. The solution maps variables to per-bus quantities, outputting voltage magnitude (Vm), voltage angle (Va), active generation (Pg), and reactive generation (Qg).

How do I configure IPOPT solver options and handle multiple initializations for grid analysis?

You can configure IPOPT solver options and handle multiple initializations by setting parameters within the symbolic modeling environment. This approach applies robust initialization strategies across multiple startup points for grid contingency analysis.

Does this nonlinear optimization toolkit support complex-number formulations for AC power systems?

Yes, this nonlinear optimization toolkit supports complex-number formulations for AC power systems. It incorporates power-system patterns that map physical quantities to solver variables, enabling accurate per-unit scaled modeling.