[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M72WN9CY0QEG1EDHZJAAHP86":3,"skill-same:01M72WN9CY0QEG1EDHZJAAHP86":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M72WN9CY0QEG1EDHZJAAHP86","locational-marginal-prices",null,"Extract locational marginal prices (LMPs) from DC-OPF solutions using dual values. Use when computing nodal electricity prices, reserve clearing prices, or performing price impact analysis.","agentscope-ai\u002FPawBench","agentscope-ai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F211762292?v=4","01M6CRT6543BZGGVK3P85GC08Q","AgentScope-AI","01M72WJAXCYDAXK74090327ER7",127,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT129_skillsbench_energy-market-pricing\u002Fskills\u002Flocational-marginal-prices\u002FSKILL.md",[],[],"2026-11-10 22:39:42",false,"---\nname: locational-marginal-prices\ndescription: \"Extract locational marginal prices (LMPs) from DC-OPF solutions using dual values. Use when computing nodal electricity prices, reserve clearing prices, or performing price impact analysis.\"\n---\n\n# Locational Marginal Prices (LMPs)\n\nLMPs are the marginal cost of serving one additional MW of load at each bus. In optimization terms, they are the **dual values** (shadow prices) of the nodal power balance constraints.\n\n## LMP Extraction from CVXPY\n\nTo extract LMPs, you must:\n1. Store references to the balance constraints\n2. Solve the problem\n3. Read the dual values after solving\n\n```python\nimport cvxpy as cp\n\n# Store balance constraints separately for dual extraction\nbalance_constraints = []\n\nfor i in range(n_bus):\n    pg_at_bus = sum(Pg[g] for g in range(n_gen) if gen_bus[g] == i)\n    pd = buses[i, 2] \u002F baseMVA\n\n    # Create constraint and store reference\n    balance_con = pg_at_bus - pd == B[i, :] @ theta\n    balance_constraints.append(balance_con)\n    constraints.append(balance_con)\n\n# Solve\nprob = cp.Problem(cp.Minimize(cost), constraints)\nprob.solve(solver=cp.CLARABEL)\n\n# Extract LMPs from duals\nlmp_by_bus = []\nfor i in range(n_bus):\n    bus_num = int(buses[i, 0])\n    dual_val = balance_constraints[i].dual_value\n\n    # Scale: constraint is in per-unit, multiply by baseMVA to get $\u002FMWh\n    lmp = float(dual_val) * baseMVA if dual_val is not None else 0.0\n    lmp_by_bus.append({\n        \"bus\": bus_num,\n        \"lmp_dollars_per_MWh\": round(lmp, 2)\n    })\n```\n\n## LMP Sign Convention\n\nFor a balance constraint written as `generation - load == net_export`:\n- **Positive LMP**: Increasing load at that bus increases total cost (typical case)\n- **Negative LMP**: Increasing load at that bus *decreases* total cost\n\nNegative LMPs commonly occur when:\n- Cheap generation is trapped behind a congested line (can't export power)\n- Adding load at that bus relieves congestion by consuming local excess generation\n- The magnitude can be very large in heavily congested networks (thousands of $\u002FMWh)\n\nNegative LMPs are physically valid and expected in congested systems — they are not errors.\n\n## Reserve Clearing Price\n\nThe reserve MCP is the dual of the system reserve requirement constraint:\n\n```python\n# Store reference to reserve constraint\nreserve_con = cp.sum(Rg) >= reserve_requirement\nconstraints.append(reserve_con)\n\n# After solving:\nreserve_mcp = float(reserve_con.dual_value) if reserve_con.dual_value is not None else 0.0\n```\n\nThe reserve MCP represents the marginal cost of providing one additional MW of reserve capacity system-wide.\n\n## Finding Binding Lines\n\nLines at or near thermal limits (≥99% loading) cause congestion and LMP separation. See the `dc-power-flow` skill for line flow calculation details.\n\n```python\nBINDING_THRESHOLD = 99.0  # Percent loading\n\nbinding_lines = []\nfor k, br in enumerate(branches):\n    f = bus_num_to_idx[int(br[0])]\n    t = bus_num_to_idx[int(br[1])]\n    x, rate = br[3], br[5]\n\n    if x != 0 and rate > 0:\n        b = 1.0 \u002F x\n        flow_MW = b * (theta.value[f] - theta.value[t]) * baseMVA\n        loading_pct = abs(flow_MW) \u002F rate * 100\n\n        if loading_pct >= BINDING_THRESHOLD:\n            binding_lines.append({\n                \"from\": int(br[0]),\n                \"to\": int(br[1]),\n                \"flow_MW\": round(float(flow_MW), 2),\n                \"limit_MW\": round(float(rate), 2)\n            })\n```\n\n## Counterfactual Analysis\n\nTo analyze the impact of relaxing a transmission constraint:\n\n1. **Solve base case** — record costs, LMPs, and binding lines\n2. **Modify constraint** — e.g., increase a line's thermal limit\n3. **Solve counterfactual** — with the relaxed constraint\n4. **Compute impact** — compare costs and LMPs\n\n```python\n# Modify line limit (e.g., increase by 20%)\nfor k in range(n_branch):\n    br_from, br_to = int(branches[k, 0]), int(branches[k, 1])\n    if (br_from == target_from and br_to == target_to) or \\\n       (br_from == target_to and br_to == target_from):\n        branches[k, 5] *= 1.20  # 20% increase\n        break\n\n# After solving both cases:\ncost_reduction = base_cost - cf_cost  # Should be >= 0\n\n# LMP changes per bus\nfor bus_num in base_lmp_map:\n    delta = cf_lmp_map[bus_num] - base_lmp_map[bus_num]\n    # Negative delta = price decreased (congestion relieved)\n\n# Congestion relieved if line was binding in base but not in counterfactual\ncongestion_relieved = was_binding_in_base and not is_binding_in_cf\n```\n\n### Economic Intuition\n\n- **Relaxing a binding constraint** cannot increase cost (may decrease or stay same)\n- **Cost reduction** quantifies the shadow price of the constraint\n- **LMP convergence** after relieving congestion indicates reduced price separation\n","# Locational Marginal Prices (LMPs)\n\nLMPs are the marginal cost of serving one additional MW of load at each bus. In optimization terms, they are the **dual values** (shadow prices) of the nodal power balance constraints.\n\n## LMP Extraction from CVXPY\n\nTo extract LMPs, you must:\n1. Store references to the balance constraints\n2. Solve the problem\n3. Read the dual values after solving\n\n```python\nimport cvxpy as cp\n\n# Store balance constraints separately for dual extraction\nbalance_constraints = []\n\nfor i in range(n_bus):\n    pg_at_bus = sum(Pg[g] for g in range(n_gen) if gen_bus[g] == i)\n    pd = buses[i, 2] \u002F baseMVA\n\n    # Create constraint and store reference\n    balance_con = pg_at_bus - pd == B[i, :] @ theta\n    balance_constraints.append(balance_con)\n    constraints.append(balance_con)\n\n# Solve\nprob = cp.Problem(cp.Minimize(cost), constraints)\nprob.solve(solver=cp.CLARABEL)\n\n# Extract LMPs from duals\nlmp_by_bus = []\nfor i in range(n_bus):\n    bus_num = int(buses[i, 0])\n    dual_val = balance_constraints[i].dual_value\n\n    # Scale: constraint is in per-unit, multiply by baseMVA to get $\u002FMWh\n    lmp = float(dual_val) * baseMVA if dual_val is not None else 0.0\n    lmp_by_bus.append({\n        \"bus\": bus_num,\n        \"lmp_dollars_per_MWh\": round(lmp, 2)\n    })\n```\n\n## LMP Sign Convention\n\nFor a balance constraint written as `generation - load == net_export`:\n- **Positive LMP**: Increasing load at that bus increases total cost (typical case)\n- **Negative LMP**: Increasing load at that bus *decreases* total cost\n\nNegative LMPs commonly occur when:\n- Cheap generation is trapped behind a congested line (can't export power)\n- Adding load at that bus relieves congestion by consuming local excess generation\n- The magnitude can be very large in heavily congested networks (thousands of $\u002FMWh)\n\nNegative LMPs are physically valid and expected in congested systems — they are not errors.\n\n## Reserve Clearing Price\n\nThe reserve MCP is the dual of the system reserve requirement constraint:\n\n```python\n# Store reference to reserve constraint\nreserve_con = cp.sum(Rg) >= reserve_requirement\nconstraints.append(reserve_con)\n\n# After solving:\nreserve_mcp = float(reserve_con.dual_value) if reserve_con.dual_value is not None else 0.0\n```\n\nThe reserve MCP represents the marginal cost of providing one additional MW of reserve capacity system-wide.\n\n## Finding Binding Lines\n\nLines at or near thermal limits (≥99% loading) cause congestion and LMP separation. See the `dc-power-flow` skill for line flow calculation details.\n\n```python\nBINDING_THRESHOLD = 99.0  # Percent loading\n\nbinding_lines = []\nfor k, br in enumerate(branches):\n    f = bus_num_to_idx[int(br[0])]\n    t = bus_num_to_idx[int(br[1])]\n    x, rate = br[3], br[5]\n\n    if x != 0 and rate > 0:\n        b = 1.0 \u002F x\n        flow_MW = b * (theta.value[f] - theta.value[t]) * baseMVA\n        loading_pct = abs(flow_MW) \u002F rate * 100\n\n        if loading_pct >= BINDING_THRESHOLD:\n            binding_lines.append({\n                \"from\": int(br[0]),\n                \"to\": int(br[1]),\n                \"flow_MW\": round(float(flow_MW), 2),\n                \"limit_MW\": round(float(rate), 2)\n            })\n```\n\n## Counterfactual Analysis\n\nTo analyze the impact of relaxing a transmission constraint:\n\n1. **Solve base case** — record costs, LMPs, and binding lines\n2. **Modify constraint** — e.g., increase a line's thermal limit\n3. **Solve counterfactual** — with the relaxed constraint\n4. **Compute impact** — compare costs and LMPs\n\n```python\n# Modify line limit (e.g., increase by 20%)\nfor k in range(n_branch):\n    br_from, br_to = int(branches[k, 0]), int(branches[k, 1])\n    if (br_from == target_from and br_to == target_to) or \\\n       (br_from == target_to and br_to == target_from):\n        branches[k, 5] *= 1.20  # 20% increase\n        break\n\n# After solving both cases:\ncost_reduction = base_cost - cf_cost  # Should be >= 0\n\n# LMP changes per bus\nfor bus_num in base_lmp_map:\n    delta = cf_lmp_map[bus_num] - base_lmp_map[bus_num]\n    # Negative delta = price decreased (congestion relieved)\n\n# Congestion relieved if line was binding in base but not in counterfactual\ncongestion_relieved = was_binding_in_base and not is_binding_in_cf\n```\n\n### Economic Intuition\n\n- **Relaxing a binding constraint** cannot increase cost (may decrease or stay same)\n- **Cost reduction** quantifies the shadow price of the constraint\n- **LMP convergence** after relieving congestion indicates reduced price separation\n",{"name":5,"description":7},"main","0f794a8bb6c27aa9ee4091b2691fa30e4ed9cc8f","data\u002Fpawbench-v1.0\u002Fassets\u002FT129_skillsbench_energy-market-pricing\u002Fskills\u002Flocational-marginal-prices",24,"https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench","https:\u002F\u002Fagentscope-ai.github.io\u002FPawBench\u002F","https:\u002F\u002Fgithub.com\u002Fagentscope-ai","2026-08-03 20:09:53",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add agentscope-ai\u002FPawBench --skill locational-marginal-prices",{"tool":38,"command":39},"bunx","bunx skills add agentscope-ai\u002FPawBench --skill locational-marginal-prices",{"tool":41,"command":42},"pnpm","pnpm dlx skills add agentscope-ai\u002FPawBench --skill locational-marginal-prices","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT129_skillsbench_energy-market-pricing\u002Fskills\u002Flocational-marginal-prices\u002FSKILL.md",true,[],[47,53,60,67,74,81],{"skillNo":48,"name":49,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M72WQCJKBJZB6SC8MMYK3C8R","data-reconciliation","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT140_skillsbench_xlsx-recover-data\u002Fskills\u002Fdata-reconciliation\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M72WQ8R4DZKK1CT397C0ARQD","hierarchical-taxonomy-clustering","Build unified multi-level category taxonomy from hierarchical product category paths from any e-commerce companies using embedding-based recursive clustering with intelligent category naming via weighted word frequency analysis.","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT139_skillsbench_taxonomy-tree-merge\u002Fskills\u002Fhierarchical-taxonomy-clustering\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M72WQ1989ZX613G3PY8Z492J","nlp-research-repo-package-installment","Align Python version and repo-declared dependencies (requirements.txt \u002F environment.yml) before installing packages for NLP research code reproduction.","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT138_skillsbench_simpo-code-reproduction\u002Fskills\u002Fnlp-research-repo-package-installment\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M72WPZ828E746PAB3WCCQARW","state-space-linearization","Linearizing nonlinear dynamics around operating points for control design.","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT137_skillsbench_r2r-mpc-control\u002Fskills\u002Fstate-space-linearization\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M72WPXFXKWDFVTGAYX0B1TSA","mpc-horizon-tuning","Selecting MPC prediction horizon and cost matrices for web handling.","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT137_skillsbench_r2r-mpc-control\u002Fskills\u002Fmpc-horizon-tuning\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M72WPW3863555HM0CACRCCFK","integral-action-design","Adding integral action to MPC for offset-free tension tracking.","https:\u002F\u002Fgithub.com\u002Fagentscope-ai\u002FPawBench\u002Fblob\u002Fmain\u002Fdata\u002Fpawbench-v1.0\u002Fassets\u002FT137_skillsbench_r2r-mpc-control\u002Fskills\u002Fintegral-action-design\u002FSKILL.md",[],[]]