电气课程设计时做的程序:
以下为报告的局部截图
整个项目代码: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
}
}
}
最终效果图: