C#编写的短路计算程序

电气课程设计时做的程序:
以下为报告的局部截图
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
整个项目代码:https://download.csdn.net/download/qq_41596891/13092356
部分代码展示

using Short_circuit_calculation.Math;
using System;
using System.Collections.Generic;
using System.Text;

namespace Short_circuit_calculation.Method
{
    /// <summary>
    /// 短路计算合集
    /// </summary>
    public class Short_circuit
    {
        /// <summary>
        /// 短路计算
        /// </summary>
        /// <param name="f"> 短路点</param>
        /// <param name="Zf"> 短路接地阻抗</param>
        /// <param name="data"> 数据</param>
        public Short_circuit(int f,double Zf, Table.Table data)
        {

            #region Y矩阵模块

            YMatrix yMatrix = new YMatrix(data);
            int nodes;//总结点数
            Matrix Y = yMatrix.Result(out nodes);
            Y.Name = "Y矩阵";
            Y.line_feed();//分割线
            Y.ShowMatrix_i();

            #endregion

            #region 节点电压向量模块Znf

            Matrix_triangulation matrix_Triangulation =
                new Matrix_triangulation(Y);//三角分解法
          
            Matrix I = new Matrix(nodes,1);
            I.Mat_i[f-1,0] =new Complex(1,0);//向量短路电流
    
            Voltage_calculation voltage_Calculation =
                new Voltage_calculation(matrix_Triangulation.result,I);
            Matrix nodesU = voltage_Calculation.Result();
            nodesU.Name = "节点电压向量 Znf";
            nodesU.ShowMatrix_i();
            #endregion

            #region 短路电流模块
            Complex If = new Complex(1,0) / (nodesU.Mat_i[f-1,0] +new Complex(Zf,0));
            Console.WriteLine(" 短路点电流 If:\n"+If.ToString()+"\n");
            nodesU.line_feed();
            #endregion

            #region 节点电压模块
            Nodes_voltage nodes_Voltage = new Nodes_voltage(voltage_Calculation.Result(),nodes,If,f,Zf);
            Matrix U = nodes_Voltage.Result();
            U.Name = "节点电压 U";
            U.ShowMatrix_i();
            #endregion

            #region 支路电流模块
            Nodes_electric_current nodes_Electric_Current = 
                new Nodes_electric_current(data,nodes_Voltage.Result(), nodes);
            Matrix In= nodes_Electric_Current.Result();
            In.Name = "支路电流 I";
            In.ShowMatrix_i();
            #endregion

            #region 冲击电流以及全电流有效值模块
            Complex im = If*new Complex( 1.8,0);
            Console.WriteLine(" 冲击电流 im:\n" + im.ToString() + "\n");
            nodesU.line_feed();//分割线

            Complex Im = If * new Complex(1.51, 0);
            Console.WriteLine(" 全电流有效值 Im:\n" + Im.ToString() + "\n");
            nodesU.line_feed();//分割线
            #endregion
        }
    }
}

最终效果图:
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值