当前位置:文档之家› 节点电压法的MATLAB实现

节点电压法的MATLAB实现

n
i
k 1
k
0
(2.1)
式 2.1 中 n 为该节点有 n 条支路。 并且根据电压电流取参考方向(passive sign convention), 即 电流由高电势流向低电势,并且设流出节点的电流方向为正方向。如 Fig 2.1 中,在①节点 处,有 i1 i2 i6 0 .
2.2 元器件参数的线性化
1 Z13
U U n1

U n2

U nN

T
I 0
而由电源两端的电势差等于电源电动势这一条件,可得出类似 U node1 U node 2 的方 程 M 个。 由于在电源两端有非电场力对电子做功, 因此在这样的节点处有外部的能量输入, 因此 在这样的两个节点之间的权值不再只是消耗电能的阻抗,因此在这两个节点处就无法利用
5
3.1 MATLAB 源代码
%This Program's function is to compute the node-voltage at each node %assuming that the first node is the Ground Node.As the graphic theory %specificstwo arrays are used to record the parameter of the electrical %components which are confined to be the following three types: resistor, %capacitor, inductance and independent voltage source. And its outcome %is the voltage values at every node except the Ground node(node1). N=4; %the number of the nodes N=input('numbers of nodes: '); U=zeros(N,N);%This array is used to store the information of voltage difference% R=ones(N,N);%This array is used to store the information of impetance% for a=1:N %to initial the resistance between any nodes to be infinite, namely oc. for b=1:N R(a,b)=realmax; end end flag=1; bad_nodes=''; %Nodes at which no equations can be formulated while flag==1 type=menu('Select type of the component','Resistor','Capacitor','Inductance','Voltage Source','End'); switch type case 1 node1=input('Enter the first terminal of the component: '); node2=input('Enter the second terminal of the component: '); parameter=input('Enter its resistance/¦¸: '); R(node1,node2)=parameter; R(node2,node1)=parameter; case 2 node1=input('Enter the first terminal of the component: '); node2=input('Enter the second terminal of the component: '); parameter=input('Enter its capacitance/F: '); w=input('Enter its angular frequency/rads: '); R(node1,node2)=-j/(w*parameter); R(node2,node1)=-j/(w*parameter); case 3 node1=input('Enter the first terminal of the component: '); node2=input('Enter the second terminal of the component: ');
3
图中 R1、R2、R3、R4、R5、R6 均 为电阻,Us6、Us3 为电压源,Is5 为电流源。①、②、③为电路的 三个节点,0 为零点势的节点。
Fig 2.1
电路中各个节点都有导线连接,构成一个连通图。由于电压源和二极管(diode)这样的元 器件是有正负极之分的, 因此所构成的图也是一个有向图。 由于两个节点之间的边是带有权 值的,该权值即为元器件的阻抗(impedance)在集总电路中,每个节点均满足基尔霍夫电流 定律(Kirchhoff’s Current Laws, 简称 KCL):流出该节点的所有支路电流之和为零。
集总电路中的数学建模
数学建模课程论文
作者:唐殷 学院:山东大学电气工程学院 专业:电力工程与管理 2010 级 学号:201000192026
目录
1 问题与假设................................................................................................................................... 3 1.1 问题提出............................................................................................................................3 1.2 简化与假设........................................................................................................................3 2 建模过程........................................................................................................................................ 3 2.1 建模使用的定理................................................................................................................3 2.2 元器件参数的线性化........................................................................................................ 4 2.3 线性方程组的建立与求解................................................................................................4 3 算法实现....................................................................................................................................... 5 3.1 MATLAB 源代码 ..................................................................................................................6 4 实例演示....................................................................................................................................... 8 5 参考 ............................................................................................................................................ 10
U
n13 算法实现
利用邻接矩阵法, 将节点之间各支路的阻抗和电势差储存起来。 对于容性和感性无源二 端元件,两个方向的权值相同;对于电压源,两个方向的权值互为相反数。初始时阻抗值均 为无穷大,各点之间的电压差均为零。生成矩阵时,对图每个节点进行遍历,生成电导、电 流的增广矩阵,最后化简求解。
2.3 线性方程组的建立与求解
若电路中有 N 个节点,因此具有 N 个电势值,在假设一个节点接地作为零电势参考节 点之后,剩下 N-1 个未知的电势,需要有 N-1 个方程解出所有的未知量。除去 M 个电源的 端点(称为 bad nodes),根据 KCL 可以列出 N-2M 个节点方程。 对于节点 na ,与其余各个节点 nb 都相连(不相连的可以设其阻抗为 )可得:
对于电路中的非线性元件,如电容(Capacitor)和电感(Inductor),在电源为正弦稳定电压 源时,可以利用相量法(phasor Transform),可将其的阻抗在频域(frequency domain)表示。例 如纯电容阻抗为 j 均以线性化。
相关主题