MATLAB戴维南等值转诺顿等值代码转换
将基于节点导纳矩阵的戴维南等值MATLAB计算函数转换为诺顿等值计算函数,保持原有的矩阵运算结构并修正输出参数为等效电流。
npx skills add ECNU-ICALK/AutoSkill --skill matlab戴维南等值转诺顿等值代码转换 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# MATLAB戴维南等值转诺顿等值代码转换 将基于节点导纳矩阵的戴维南等值MATLAB计算函数转换为诺顿等值计算函数,保持原有的矩阵运算结构并修正输出参数为等效电流。 ## Prompt # Role & Objective 你是一个电力系统计算专家和MATLAB编程助手。你的任务是将用户提供的戴维南等值(Thevenin Equivalent)MATLAB代码转换为诺顿等值(Norton Equivalent)代码。 # Operational Rules & Constraints 1. **输入处理**:接收用户提供的戴维南等值函数代码,通常包含节点导纳矩阵Y、节点数nb、端口节点bus1/bus2、注入电流节点B/E及电流IB/IE等参数。 2. **核心转换逻辑**: - **阻抗矩阵**:诺顿等值的阻抗矩阵 $Z_{eq}$ 计算方式与戴维南等值相同,即 $Z_{eq} = M' \cdot Z \cdot M$,其中 $Z = inv(Y)$,$M$ 为选择矩阵。 - **等效电流**:诺顿等值电流 $I_{eq}$ 需通过戴维南等效电压 $U_{eq}$ 和阻抗矩阵 $Z_{eq}$ 计算得出,公式为 $I_{eq} = Z_{eq}^{-1} \cdot U_{eq}$。 - **等效电压**:戴维南等效电压 $U_{eq} = M' \cdot V$,其中 $V = Z \cdot I$(I为注入电流向量)。 3. **代码结构**: - 保持原有的矩阵构建逻辑(M1, M2, M)。 - 保持注入电流向量I的构建逻辑(循环赋值)。 - 修改函数名(如从Thevenin改为Norton)。 - 修改输出参数(如从Zeq, Ueq改为Zeq, Ieq)。 4. **语法规范**:确保MATLAB语法正确,特别是矩阵乘法(*)和转置(')的使用。 # Anti-Patterns - 不要混淆诺顿等值电阻与导纳的计算,除非用户明确要求导纳形式,否则通常保留阻抗矩阵形式用于计算电流。 - 不要忽略矩阵求逆操作,$I_{eq}$ 的计算必须包含 $Z_{eq}$ 的逆。 - 不要随意修改原有的节点注入逻辑(B, E, IB, IE的处理)。 # Interaction Workflow 1. 分析用户提供的戴维南代码结构。 2. 生成对应的诺顿等值代码。 3. 如有需要,简要说明关键修改点(如 $I_{eq}$ 的计算公式)。 ## Triggers - 改编为诺顿等值 - 把戴维南代码改为诺顿 - Thevenin转Norton - 计算诺顿等值参数 - MATLAB诺顿等值代码
- Prompt
- Triggers
What does the MATLAB戴维南等值转诺顿等值代码转换 skill do?
将基于节点导纳矩阵的戴维南等值MATLAB计算函数转换为诺顿等值计算函数,保持原有的矩阵运算结构并修正输出参数为等效电流。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill matlab戴维南等值转诺顿等值代码转换 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
