matlab 应求PQ分解法进行潮流计算
- 格式:pdf
- 大小:1.52 MB
- 文档页数:19
基于MATLAB软件的P-Q分解法潮流计算摘要电力系统潮流计算是研究电力系统稳态运行情况的一种重要的分析计算,它根据给定的运行条件及系统接线情况确定整个电力系统各部分的运行状态:各母线的电压,各元件中流过的功率,系统的功率损耗。
在电力系统规划的设计和现有电力系统运行方式的研究中,都需要利用潮流计算来定量地分析比较供电方案或运行方式的合理性,可靠性和经济性。
所以,电力系统潮流计算是进行电力系统故障计算,继电保护整定,安全分析的必要工具。
随着电力系统网络的急剧扩大和不断复杂,运用手算进行潮流计算已经不现实。
但是,伴随着计算机技术的飞速发展,基于计算机的潮流计算也就应运而生了。
这样,通过潮流计算,实现对系统的分析成为可能。
本文结合潮流计算的三个基本要求,紧跟该领域的发展,介绍了基于MATLAB软件P-Q分解法潮流计算的程序,该程序用于粗略的计算中小型电力网络的潮流,实现对其的分析。
本文所设计的程序,在计算中,所用的算法通俗易懂并对以往的主流算法做了一些改进,提高了计算速度。
同时,该程序采用了GUI人机对话,将Excel表格、TXT文档与MATLAB程序紧密联系起来,使输入输出界面更加人性化。
关键词:电力系统潮流计算;P-Q分解法;MATLAB软件Power flow calculation of P-Q mode basedon MATLAB softwareAbstractPower flow calculation is one of the important calculations which are to study the operation of power system steady state analysis. It is based on the given operating conditions and system wiring to identify the various parts of the power system operating state: the buses voltage, the stream components power, system power loss. both power system planning design and operation of existing power system mode of study are need to use the power flow calculation to quantitatively compare the program or run mode power supply reasonable, reliability and economy. Therefore, the power flow calculation is an essential tool for a calculation of power system faults, protection setting, security analysis. with the rapid expansion of power system network and continuing to be more complex, using hand calculation for flow calculation has been unrealistic. But ,with the celerity development in computer technology, computer-based power flow calculation has also emerged. In this way, It is possible to analysis power system through the power flow calculation.Based on the three basic requirements of power flow calculation and followed by the development of the field, This paper introduces the PQ mode power flow calculation procedure based on MATLAB software .It is used for a rough calculation of the small and medium power network to achieve its analysis. The algorithm used in the procedure mentioned in this paper is more easy to understand and made some improvements to enhance the computingspeed rather than the past. At the same time, the program uses the GUI man-machine dialogue. So Excel table, TXT documents is closely linked with the MATLAB program to make the input and output interfaces more humanity.Keywords:power flow calculation;P-Q decomposition mode;MA TLAB software目录摘要 (I)Abstract (II)第1章绪论 (6)1.1课题背景 (6)1.2电力系统潮流计算 (6)1.2.1电力系统潮流计算简介 (6)1.2.2电力系统潮流计算的基本要求 (7)1.3潮流计算的意义及其发展 (8)1.4本次毕业设计主要工作 (9)第2章潮流计算的原理及具体算法过程 (11)2.1电力网络的数学模型 (11)2.1.1电力网络的基本方程 (11)2.1.2导纳矩阵的形成 (12)2.1.3电力网络中几种特殊的数学模型 (13)2.2电力系统潮流计算 (16)2.2.1电力系统潮流计算数学模型 (16)2.2.2电力系统节点分类 (17)2.2.3潮流计算的约束条件 (18)2.3牛顿-拉夫逊法求解潮流计算 (18)2.3.1牛顿-拉夫逊法原理 (18)2.3.2 P-Q分解法潮流计算 (20)第3章基于MATLAB软件 P-Q法潮流计算 (25)3.1 P-Q分解法程序框图 (25)3.2计算步骤及实现各部分功能的程序 (26)3.2.1原始数据的输入 (26)3.2.2导纳矩阵及B',B''形成 (28)3.2.3计算不平衡功率ΔP i及修正相角Δθi (30)3.2.4计算不平衡功率ΔQ i及修正相电压ΔV i (31)3.2.5程序运行结果的输出 (32)第4章算例验证与分析 (33)4.1算例说明及分析 (33)4.1.1算例说明 (33)4.1.2算例分析 (33)4.3算例运行结果 (34)结论 (37)致谢 (38)参考文献 (39)附录A (41)附录B (51)附录C (68)第1章绪论1.1课题背景电力是衡量一个国家经济发展的主要指标,也是反映人民生活水平的重要标志,它已成为现代工农业生产、交通运输以及城乡生活等许多方面不可或缺的能源和动力。
基于MATLAB软件的PQ分化法潮流计算摘要电力系统潮流计算是研究电力系统稳态运行情况的一种重要的阐发计算,它根据给定的运行条件及系统接线情况确定整个电力系统各部分的运行状态:各母线的电压,各元件中流过的功率,系统的功率损耗。
在电力系统规划的设计和现有电力系统运行方法的研究中,都需要利用潮流计算来定量地阐发比较供电计划或运行方法的合理性,可靠性和经济性。
所以,电力系统潮流计算是进行电力系统故障计算,继电呵护整定,平安阐发的需要工具。
随着电力系统网络的急剧扩年夜和不竭庞杂,运用手算进行潮流计算已经不现实。
可是,陪伴着计算机技术的飞速成长,基于计算机的潮流计算也就应运而生了。
这样,通过潮流计算,实现对系统的阐发成为可能。
欧阳美创编2021.01.01 欧阳美创编本文结合潮流计算的三个基本要求,紧跟该领域的成长,介绍了基于MATLAB软件PQ分化法潮流计算的法度,该法度用于粗略的计算中小型电力网络的潮流,实现对其的阐发。
本文所设计的法度,在计算中,所用的算法通俗易懂并对以往的主流算法做了一些改进,提高了计算速度。
同时,该法度采取了GUI人机对话,将Excel表格、TXT文档与MATLAB法度紧密联系起来,使输入输出界面更加人性化。
关键词:电力系统潮流计算;PQ分化法;MATLAB 软件欧阳美创编2021.01.01 欧阳美创编Power flow calculation of PQ mode basedonMATLAB softwareAbstractPower flow calculation is one of the important calculations which are to study the operation of power system steady state analysis.It isbased on the given operating conditions and system wiring to identify the various parts of the power system operating state: the buses voltage, the stream components power, system power loss. both power system planning design and operation of existing power system mode of study are need to use the power flow calculation to quantitatively compare the program or run mode power supply reasonable, reliability and economy. Therefore, the power flow 欧阳美创编2021.01.01 欧阳美创编calculation is an essential tool for a calculation of power system faults, protection setting, security analysis. with the rapid expansion of power system network and continuing to be more complex, using hand calculation for flow calculation has been unrealistic.But ,with the celerity development in computer technology, computerbased power flow calculation has also emerged. In this way, It is possible to analysis power system through the power flow calculation.Based on the three basic requirements of power flow calculation and followed by the development of the field, This paper introduces the PQ mode power flow calculationprocedure based on MATLAB software .It is used for a rough calculation of the small and medium power network to欧阳美创编2021.01.01 欧阳美创编achieve its analysis. The algorithm used in the procedure mentioned in this paper is more easy to understand and made some improvements to enhance the computing speed rather than the past. At the same time, the program uses the GUI manmachine dialogue.So Excel table, TXT documents is closely linked with the MATLAB program to make the input and output interfaces morehumanity. Keywords:power flow calculation;PQ decomposition mode;MATLAB software欧阳美创编2021.01.01 欧阳美创编2021.01.01目录摘要IAbstractII第1章绪论81.1 课题布景81.2 电力系统潮流计算91.2.1 电力系统潮流计算简介91.2.2 电力系统潮流计算的基本要求91.3 潮流计算的意义及其成长111.4 本次结业设计主要工作12第2章潮流计算的原理及具体算法过程142.1 电力网络的数学模型142.1.1 电力网络的基本方程142.1.2 导纳矩阵的形成152.1.3 电力网络中几种特殊的数学模型162.2 电力系统潮流计算192.2.1 电力系统潮流计算数学模型192.2.2 电力系统节点分类202.2.3 潮流计算的约束条件212.3 牛顿拉夫逊法求解潮流计算222.3.1 牛顿拉夫逊法原理222.3.2 PQ分化法潮流计算23第3章基于MATLAB软件 PQ法潮流计算293.1 PQ分化法法度框图293.2 计算步调及实现各部分功能的法度303.2.1 原始数据的输入303.2.2 导纳矩阵及B',B''形成333.2.3 计算不服衡功率ΔPi及修正相角Δθi353.2.4 计算不服衡功率ΔQi及修正相电压ΔVi363.2.5 法度运行结果的输出37第4章算例验证与阐发384.1 算例说明及阐发384.1.1 算例说明38欧阳美创编2021.01.01 欧阳美创编2021.01.014.1.2 算例阐发384.2 根据算例输入相应节点线路参数384.3 算例运行结果39结论42致谢43参考文献44附录A46附录B57附录C76欧阳美创编2021.01.01 欧阳美创编第1章绪论1.1课题布景电力是衡量一个国家经济成长的主要指标,也是反应人民生活水平的重要标记,它已成为现代工农业生产、交通运输以及城乡生活等许多方面不成或缺的能源和动力。
基于MATLAB软件的PQ 分化法潮流计算欧阳引擎(2021.01.01)摘要电力系统潮流计算是研究电力系统稳态运行情况的一种重要的阐发计算,它根据给定的运行条件及系统接线情况确定整个电力系统各部分的运行状态:各母线的电压,各元件中流过的功率,系统的功率损耗。
在电力系统规划的设计和现有电力系统运行方法的研究中,都需要利用潮流计算来定量地阐发比较供电计划或运行方法的合理性,可靠性和经济性。
所以,电力系统潮流计算是进行电力系统故障计算,继电呵护整定,平安阐发的需要工具。
随着电力系统网络的急剧扩年夜和不竭庞杂,运用手算进行潮流计算已经不现实。
可是,陪伴着计算机技术的飞速成长,基于计算机的潮流计算也就应运而生了。
这样,通过潮流计算,实现对系统的阐发成为可能。
本文结合潮流计算的三个基本要求,紧跟该领欧阳引擎创编域的成长,介绍了基于MATLAB软件PQ分化法潮流计算的法度,该法度用于粗略的计算中小型电力网络的潮流,实现对其的阐发。
本文所设计的法度,在计算中,所用的算法通俗易懂并对以往的主流算法做了一些改进,提高了计算速度。
同时,该法度采取了GUI人机对话,将Excel表格、TXT文档与MATLAB法度紧密联系起来,使输入输出界面更加人性化。
关键词:电力系统潮流计算;PQ分化法;MATLAB软件欧阳引擎创编Power flow calculation of PQ mode basedonMATLAB softwareAbstractPower flow calculation is one of the important calculations which are to study the operation of power system steady state analysis.It isbased on the given operating conditions and system wiring to identify the various parts of the power system operating state: the buses voltage, the stream components power, system power loss. both power system planning design and operation of existing power system mode of study are need to use the power flow calculation to quantitatively compare the program or run mode power supply reasonable, reliability and economy. Therefore, the power flow calculation is an essential tool for a calculation of power system faults, protection setting, security analysis. with the rapid expansion of power system network and continuing to be more complex, using hand calculation for flow calculation has been unrealistic.But ,with the celerity development in欧阳引擎创编computer technology, computerbased power flow calculation has also emerged. In this way, It is possible to analysis power system through the power flow calculation.Based on the three basic requirements of power flow calculation and followed by the development of the field, This paper introduces the PQ mode power flow calculationprocedure based on MATLAB software .It is used for a rough calculation of the small and medium power network to achieve its analysis. The algorithm used in the procedure mentioned in this paper is more easy to understand and made some improvements to enhance the computing speed rather than the past. At the same time, the program uses the GUI manmachine dialogue.So Excel table, TXT documents is closely linked with the MATLAB program to make the input and output interfaces morehumanity.Keywords:power flow calculation;PQ decomposition mode;MATLAB software欧阳引擎创编2021.01.01目录摘要IAbstractII第1章绪论71.1 课题布景71.2 电力系统潮流计算81.2.1 电力系统潮流计算简介81.2.2 电力系统潮流计算的基本要求81.3 潮流计算的意义及其成长101.4 本次结业设计主要工作11第2章潮流计算的原理及具体算法过程132.1 电力网络的数学模型132.1.1 电力网络的基本方程132.1.2 导纳矩阵的形成142.1.3 电力网络中几种特殊的数学模型152.2 电力系统潮流计算192.2.1 电力系统潮流计算数学模型192.2.2 电力系统节点分类192.2.3 潮流计算的约束条件202.3 牛顿拉夫逊法求解潮流计算212.3.1 牛顿拉夫逊法原理212.3.2 PQ分化法潮流计算23第3章基于MATLAB软件 PQ法潮流计算283.1 PQ分化法法度框图283.2 计算步调及实现各部分功能的法度293.2.1 原始数据的输入293.2.2 导纳矩阵及B',B''形成323.2.3 计算不服衡功率ΔPi及修正相角Δθi343.2.4 计算不服衡功率ΔQi及修正相电压ΔVi353.2.5 法度运行结果的输出36第4章算例验证与阐发374.1 算例说明及阐发374.1.1 算例说明37欧阳引擎创编2021.01.014.1.2 算例阐发374.2 根据算例输入相应节点线路参数37 4.3 算例运行结果38结论41致谢42参考文献43附录A45附录B56附录C75欧阳引擎创编第1章绪论1.1课题布景电力是衡量一个国家经济成长的主要指标,也是反应人民生活水平的重要标记,它已成为现代工农业生产、交通运输以及城乡生活等许多方面不成或缺的能源和动力。
基于MATLAB软件的PQ分化法潮流计算摘要电力系统潮流计算是研究电力系统稳态运行情况的一种重要的阐发计算,它根据给定的运行条件及系统接线情况确定整个电力系统各部分的运行状态:各母线的电压,各元件中流过的功率,系统的功率损耗。
在电力系统规划的设计和现有电力系统运行方法的研究中,都需要利用潮流计算来定量地阐发比较供电计划或运行方法的合理性,可靠性和经济性。
所以,电力系统潮流计算是2021.03.09 欧阳法创编进行电力系统故障计算,继电呵护整定,平安阐发的需要工具。
随着电力系统网络的急剧扩年夜和不竭庞杂,运用手算进行潮流计算已经不现实。
可是,陪伴着计算机技术的飞速成长,基于计算机的潮流计算也就应运而生了。
这样,通过潮流计算,实现对系统的阐发成为可能。
本文结合潮流计算的三个基本要求,紧跟该领域的成长,介绍了基于MATLAB软件PQ分化法潮流计算的法度,该法度用于粗略的计算中小型电力网络的潮流,实现对其的阐发。
本文所设计的法度,在计算中,所用的算法通俗易懂并对以往的主流算法做了一些改进,提高了计算速度。
同时,该法度采取了GUI人机对话,将Excel表格、TXT文档与MATLAB法度紧密联系起来,使输入输出界面更加人性化。
关键词:电力系统潮流计算;PQ分化法;MATLAB软件2021.03.09 欧阳法创编Power flow calculation of PQ mode basedonMATLAB softwareAbstractPower flow calculation is one of the important calculations which are to study the operation of power system steady state analysis.It isbased on the given operating conditions and system wiring to identify the various parts of the power system operating state: the buses voltage, the stream components power, system power loss. both power system planning design and operation of existing power system mode of study are need to use the power flow calculation to2021.03.09 欧阳法创编quantitatively compare the program or run mode power supply reasonable, reliability and economy. Therefore, the power flow calculation is an essential tool for a calculation of power system faults, protection setting, security analysis. with the rapid expansion of power system network and continuing to be more complex, using hand calculation for flow calculation has been unrealistic.But ,with the celerity development in computer technology, computerbased power flow calculation has also emerged. In this way, It is possible to analysis power system through the power flow calculation.Based on the three basic requirements of power flow calculation and followed by the2021.03.09 欧阳法创编development of the field, This paper introduces the PQ mode power flow calculationprocedure based on MATLAB software .It is used for a rough calculation of the small and medium power network to achieve its analysis. The algorithm used in the procedure mentioned in this paper is more easy to understand and made some improvements to enhance the computing speed rather than the past. At the same time, the program uses the GUI manmachine dialogue.So Excel table, TXT documents is closely linked with the MATLAB program to make the input and output interfaces morehumanity.Keywords:power flow calculation;PQ 2021.03.09 欧阳法创编decomposition mode;MATLAB software 2021.03.09 欧阳法创编2021.03.09目录摘要IAbstractII第1章绪论91.1 课题布景91.2 电力系统潮流计算101.2.1 电力系统潮流计算简介101.2.2 电力系统潮流计算的基本要求101.3 潮流计算的意义及其成长121.4 本次结业设计主要工作14第2章潮流计算的原理及具体算法过程162.1 电力网络的数学模型162.1.1 电力网络的基本方程162.1.2 导纳矩阵的形成182.1.3 电力网络中几种特殊的数学模型192.2 电力系统潮流计算232.2.1 电力系统潮流计算数学模型232.2.2 电力系统节点分类242.2.3 潮流计算的约束条件252.3 牛顿拉夫逊法求解潮流计算262.3.1 牛顿拉夫逊法原理262.3.2 PQ分化法潮流计算28第3章基于MATLAB软件 PQ法潮流计算343.1 PQ分化法法度框图343.2 计算步调及实现各部分功能的法度363.2.1 原始数据的输入363.2.2 导纳矩阵及B',B''形成383.2.3 计算不服衡功率ΔPi及修正相角Δθi413.2.4 计算不服衡功率ΔQi及修正相电压ΔVi423.2.5 法度运行结果的输出432021.03.09 欧阳法创编2021.03.09第4章算例验证与阐发454.1 算例说明及阐发454.1.1 算例说明454.1.2 算例阐发454.2 根据算例输入相应节点线路参数454.3 算例运行结果46结论50致谢51参考文献53附录A55附录B68附录C912021.03.09 欧阳法创编第1章绪论1.1课题布景电力是衡量一个国家经济成长的主要指标,也是反应人民生活水平的重要标记,它已成为现代工农业生产、交通运输以及城乡生活等许多方面不成或缺的能源和动力。
MATLAB电力系统PQ潮流计算程序设计1 绪论1.1潮流计算1.1.1 潮流计算概述电力系统潮流计算是研究电力系统稳态运行情况的一种计算,它根据给定的运行条件及系统接线情况确定整个电力系统各部分的运行状态:各母线的电压,各元件中流过的功率,系统的功率损耗等等。
在电力系统规划的设计和现有电力系统运行方式的研究中,都需要利用潮流计算来定量地分析比较供电方案或运行方式的合理性、可靠性和经济性。
此外,电力系统潮流计算也是计算系统动态稳定和静态稳定的基础。
所以潮流计算是研究电力系统的一种很重要也很基础的计算。
电力系统潮流计算也分为离线计算和在线计算两种,前者主要用于系统规划设计和安排系统的运行方式,后者则用于正在运行系统的随时监视及实时控制。
利用计算机进行电力系统潮流计算从50年代中期就已经开始。
在这20年内,潮流计算曾采用了各种不同的方法,这些方法的发展主要围绕着对潮流计算的一些基本要求进行的。
对潮流计算的要求可以归纳为下面几点:(1)计算方法的可靠性或收敛性;(2)对计算机内存量的要求;(3)计算速度;(4)计算的方便性和灵活性。
电力系统潮流计算问题在数学上是一组多元非线性方程式求解问题,其解法都离不开迭代。
因此,对潮流计算方法,首先要求它能可靠地收敛,并给出正确答案。
由于电力系统结构及参数的一些特点,并且随着电力系统不断扩大,潮流计算方程式的阶数也越来越高,对这样的方程式并不是任何数学方法都能保证给出正确答案的。
这种情况成为促使电力系统计算人员不断寻求新的更可靠方法的重要因素。
在用数字计算机解电力系统潮流问题的开始阶段,普遍采取以节点导纳矩阵为基础的逐次代入法。
这个方法的原理比较简单,要求的数字计算机内存量比较低,适应50年代电子计算机制造水平和当时电力系统理论水平。
但它的收敛性较差,当系统规模变大时,迭代次数急剧上升,在计算中往往出现迭代不收敛的情况。
这就迫使电力系统计算人员转向以阻抗矩阵为基础的逐次代入法。
此程序经40余同学使用检验,无误。
这是一个电气狗熬两个礼拜图书馆的成果,根据华中科技大学《电力系统分析》中原理编写,可用牛顿-拉夫逊和PQ分解法计算给定标幺值条件的潮流。
本人水平有限,仅供参考,欢迎一起找Bug。
2018/07/06 说明:由于本人变压器建模与PSASP不同,本人使用模型如下图,参数输入时请按该模型计算。
2018/06/18 主程序更新:增加补偿电容参数主程序% file name:chaoliu_lj.m% auther: 山东科技大学罗江% function:使用牛顿-拉夫逊法、PQ分解法计算潮流% updata:2018/6/18 13:22 增加补偿电容参数%节点类型标号%PQ节点 1%PV节点 2%slack节点 3%能计算给定标幺值网络,有且仅有一个平衡节点的潮流%注意:母线标号顺序要求:PQ节点-PV节点-平衡节点%若某元件不存在,其导纳为0,阻抗为infclear %清除工作空间变量clc %清屏%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%数据输入(标幺值)SB=100; %基准容量,单位MVA%母线基准电压Bus=[115 10.5 115 115];%交流线参数:I侧母线J侧母线阻抗1/2接地导纳Line=[4 1 0.06125+0.09527i 0;4 3 0.08469+0.12703i 0;1 3 0.13989+0.15501i 0];%变压器参数:I侧母线J侧母线阻抗变比%变压器阻抗归算到I侧Trans=[2 3 0.0137+0.2881i 0.9504];%加接地电容器补偿: 母线导纳Cap=[2 0.5i];%发电机参数:母线节点类型P V/U θGen=[4 3 1 0];%负荷参数:母线节点类型P Q%按参考方向,发电机发出功率(正值),负荷消耗功率(负值)Load=[1 1 -0.18 -0.06;2 1 -0.32 -0.12];mode=1; %1-极坐标下牛拉法,2-PQ分解法Tmax=50; %最大迭代次数limit=1.0e-4; %要求精度%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%变压器π型等效阻抗参数Zt=zeros(size(Trans,1),3);Zt(:,1)=Trans(:,3)./Trans(:,4);Zt(:,2)=Trans(:,3)./(1-Trans(:,4));Zt(:,3)=Trans(:,3)./(Trans(:,4).^2-Trans(:,4));Trans_pi=[Trans(:,1:2) Zt(:,1) 1./Zt(:,2) 1./Zt(:,3)];n=numel(Bus); %总节点数m=n-1; %PQ节点数for i=1:size(Gen,1)%数组行数if Gen(i,2)==2 %除去PV节点就是PQ节点m=m-1;endendfor i=1:size(Load,1)if Load(i,2)==2m=m-1;endend%PQ节点包含浮游节点,其PQ=0%提取P,Q,U向量P=zeros(1,n); %P,Q为原始数据,Pi,Qi为计算结果Q=zeros(1,n);U=ones(1,n); %电压初始值由此确定cita=zeros(1,n); %此处未知节点皆设为1.0∠0 %注意:此处角度单位为度,提取后再转换成弧度,后面计算使用弧度for i=1:size(Gen,1)if Gen(i,2)==1 %PQ节点P(Gen(i,1))=Gen(i,3);Q(Gen(i,1))=Gen(i,4);endif Gen(i,2)==2 %PV节点P(Gen(i,1))=Gen(i,3);U(Gen(i,1))=Gen(i,4);endif Gen(i,2)==3 %slack节点U(Gen(i,1))=Gen(i,3);cita(Gen(i,1))=Gen(i,4);endendfor i=1:size(Load,1)if Load(i,2)==1 %PQ节点P(Load(i,1))=Load(i,3);Q(Load(i,1))=Load(i,4);endif Load(i,2)==2 %PV节点P(Load(i,1))=Load(i,3);U(Load(i,1))=Load(i,4);endif Load(i,2)==3 %slack节点U(Load(i,1))=Load(i,3);cita(Load(i,1))=Load(i,4);endenddisp('初始条件:')disp('各节点有功:')disp(P);disp('各节点无功:')disp(Q);disp('各节点电压幅值:')disp(U);cita=(deg2rad(cita)); %角度转换成弧度disp('各节点电压相角(度):')disp(rad2deg(cita)); %显示依然使用角度%节点导纳矩阵的计算Y=zeros(n); %新建节点导纳矩阵y=zeros(n); %网络中的真实导纳%计算y(i,j)for i=1:size(Line,1) %与交流线联结的真实导纳ii=Line(i,1); jj=Line(i,2);y(ii,jj)=1/Line(i,3);y(jj,ii)=y(ii,jj);endfor i=1:size(Trans_pi,1) %与变压器联结的真实导纳ii=Trans_pi(i,1); jj=Trans_pi(i,2);y(ii,jj)=1/Trans_pi(i,3);y(jj,ii)=y(ii,jj);end%计算y(i,i)for i=1:size(Line,1) %与交流线联结的对地导纳ii=Line(i,1); jj=Line(i,2);y(ii,ii)=y(ii,ii)+Line(i,4);y(jj,jj)=y(jj,jj)+Line(i,4);endfor i=1:size(Trans_pi,1) %与变压器联结的对地导纳ii=Trans_pi(i,1); jj=Trans_pi(i,2);y(ii,ii)=y(ii,ii)+Trans_pi(i,4);y(jj,jj)=y(jj,jj)+Trans_pi(i,5);end%算上补偿电容for i=1:size(Cap,1)ii=Cap(i,1);y(ii,ii)=y(ii,ii)+Cap(i,2);end%由y计算Yysum=sum(y,1); %每一行求和for i=1:nfor j=1:nif i==jY(i,j)=ysum(i);elseY(i,j)=-y(i,j);endendenddisp('节点导纳矩阵:');disp(Y);G=real(Y); %电导矩阵B=imag(Y); %电纳矩阵%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%以上为基础数据整理%接下来是牛拉法的大循环%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%计算功率不平衡量[dP,dQ,Pi,Qi]=Unbalanced( n,m,P,Q,U,G,B,cita );disp('有功不平衡量:');disp(dP);disp('无功不平衡量:');disp(dQ);for i=1:Tmaxfprintf('第%d次迭代\n',i);%雅可比矩阵的计算if(mode==1)J=Jacobi( n,m,U,cita,B,G,Pi,Qi );disp('雅可比矩阵');disp(J);end%求解节点电压修正量if(mode==1)[dU,dcita]=Correct( n,m,U,dP,dQ,J );else[dU,dcita]=PQ_LJ( n,m,dP,dQ,U,B );enddisp('电压、相角修正量:');disp(dU);disp(rad2deg(dcita));%修正节点电压U=U+dU;cita=cita+dcita;disp('节点电压幅值:');disp(U);disp('节点电压相角:');disp(rad2deg(cita));%计算功率不平衡量[dP,dQ,Pi,Qi]=Unbalanced( n,m,P,Q,U,G,B,cita );disp('有功不平衡量:');disp(dP);disp('无功不平衡量:');disp(dQ);if (max(abs(dP))<limit && max(abs(dQ))<limit )break;end%ifend%for%迭代结束,判断收敛if (max(abs(dP))<limit && max(abs(dQ))<limit )disp('计算收敛');elsedisp('计算不收敛或未达到要求精度');end%打印功率fprintf('迭代总次数:%d\n', i);disp('节点电压幅值:');disp(U);disp('节点电压相角:');disp(rad2deg(cita));disp('有功计算结果:');disp(Pi);disp('无功计算结果:');disp(Qi);子程序一% filename:Unbalanced.m% author: 山东科技大学罗江% function: 计算功率不平衡量function [ dP,dQ,Pi,Qi ] = Unbalanced( n,m,P,Q,U,G,B,cita )%计算ΔPi有功的不平衡量for i=1:nfor j=1:nPn(j)=U(i)*U(j)*(G(i,j)*cos(cita(i)-cita(j))+B(i,j)*sin(cita(i)-cita(j)));endPi(i)=sum(Pn);enddP=P(1:n-1)-Pi(1:n-1); %dP有n-1个%计算ΔQi无功的不平衡量for i=1:nfor j=1:nQn(j)=U(i)*U(j)*(G(i,j)*sin(cita(i)-cita(j))-B(i,j)*cos(cita(i)-cita(j)));endQi(i)=sum(Qn);enddQ=Q(1:m)-Qi(1:m); %dQ有m个end%func子程序二% filename:Jacobi.m% author:山东科技大学罗江% function: 计算雅可比矩阵function [ J ] = Jacobi( n,m,U,cita,B,G,Pi,Qi )%雅可比矩阵的计算%分块H N K L%i!=j时for i=1:n-1for j=1:n-1H(i,j)=-U(i)*U(j)*(G(i,j)*sin(cita(i)-cita(j))-B(i,j)*cos(cita(i)-cita(j)));endendfor i=1:n-1for j=1:mN(i,j)=-U(i)*U(j)*(G(i,j)*cos(cita(i)-cita(j))+B(i,j)*sin(cita(i)-cita(j)));endendfor i=1:mfor j=1:n-1K(i,j)=U(i)*U(j)*(G(i,j)*cos(cita(i)-cita(j))+B(i,j)*sin(cita(i)-cita(j)));endendfor i=1:mfor j=1:mL(i,j)=-U(i)*U(j)*(G(i,j)*sin(cita(i)-cita(j))-B(i,j)*cos(cita(i)-cita(j)));endend%i==j时for i=1:n-1H(i,i)=U(i).^2*B(i,i)+Qi(i);endfor i=1:mN(i,i)=-U(i).^2*G(i,i)-Pi(i);endfor i=1:mK(i,i)=U(i).^2*G(i,i)-Pi(i);endfor i=1:mL(i,i)=U(i).^2*B(i,i)-Qi(i);end%合成雅可比矩阵J=[H N;K L];end子程序三% filename:Correct.m% author:山东科技大学罗江% function:修正节点电压function [ dU,dcita ] = Correct( n,m,U,dP,dQ,J )%求解节点电压修正量for i=1:mUd2(i,i)=U(i);enddPQ=[dP dQ]';dUcita=(-inv(J)*dPQ)';dcita=dUcita(1:n-1);dcita=[dcita 0];dU=(Ud2*dUcita(n:n+m-1)')';dU=[dU zeros(1,n-m)];end子程序四% filename:PQ_LJ.m% author:山东科技大学罗江% function:使用PQ分解法计算电压修正量function [ dU,dcita ] = PQ_LJ( n,m,dP,dQ,U,B )dP_U=dP./U(1:n-1);dQ_U=dQ./U(1:m);dUdcita=(-inv(B(1:n-1,1:n-1))*dP_U')';dcita=dUdcita./U(1:n-1);dU=(-inv(B(1:m,1:m))*dQ_U')';dU=[dU zeros(1,n-m)];dcita=[dcita 0];%补零end (使用时此括号删去。
基于MATLAB软件的PQ分化法潮流计算摘要电力系统潮流计算是研究电力系统稳态运行情况的一种重要的阐发计算,它根据给定的运行条件及系统接线情况确定整个电力系统各部分的运行状态:各母线的电压,各元件中流过的功率,系统的功率损耗。
在电力系统规划的设计和现有电力系统运行方法的研究中,都需要利用潮流计算来定量地阐发比较供电计划或运行方法的合理性,可靠性和经济性。
所以,电力系统潮流计算是进行电力系统故障计算,继电呵护整定,平安阐发的需要工具。
随着电力系统网络的急剧扩年夜和不竭庞杂,运用手算进行潮流计算已经不现实。
可是,陪伴着计算机技术的飞速成长,基于计算机的潮流计算也就应运而生了。
这样,通过潮流计算,实现对系统的阐发成为可能。
本文结合潮流计算的三个基本要求,紧跟该领域的成长,介绍了基于MATLAB软件PQ分化法潮流计算的法度,该法度用于粗略的计算中小型电力网络的潮流,实现对其的阐发。
本文所设计的法度,在计算中,所用的算法通俗易懂并对以往的主流算法做了一些改进,提高了计算速度。
同时,该法度采取了GUI人机对话,将Excel表格、TXT文档与MATLAB法度紧密联系起来,使输入输出界面更加人性化。
关键词:电力系统潮流计算;PQ分化法;MATLAB软件Power flow calculation of PQ mode basedonMATLAB softwareAbstractPower flow calculation is one of the important calculations which are to study the operation of power system steady state analysis.It isbased on the given operating conditions and system wiring to identify the various parts of the power system operating state: the buses voltage, the stream components power, system power loss. both power system planning design and operation of existing power system mode of study are need to use the power flow calculation to quantitatively compare the program or run mode power supply reasonable,reliability and economy. Therefore, the power flow calculation is an essential tool for a calculation of power system faults, protection setting, security analysis. with the rapid expansion of power system network and continuing to be more complex, using hand calculation for flow calculation has been unrealistic.But ,with the celerity development in computer technology, computerbased power flow calculation has also emerged. In this way, It is possible to analysis power system through the power flow calculation.Based on the three basic requirements of power flow calculation and followed by the development of the field, This paper introduces the PQ mode power flow calculationprocedurebased on MATLAB software .It is used for a rough calculation of the small and medium power network to achieve its analysis. The algorithm used in the procedure mentioned in this paper is more easy to understand and made some improvements to enhance the computing speed rather than the past. At the same time, the program uses the GUI manmachine dialogue.So Excel table, TXT documents is closely linked with the MATLAB program to make the input and output interfaces morehumanity. Keywords:power flow calculation;PQ decomposition mode;MATLAB software目录摘要IAbstractII第1章绪论81.1 课题布景81.2 电力系统潮流计算91.2.1 电力系统潮流计算简介91.2.2 电力系统潮流计算的基本要求91.3 潮流计算的意义及其成长111.4 本次结业设计主要工作13第2章潮流计算的原理及具体算法过程142.1 电力网络的数学模型142.1.1 电力网络的基本方程142.1.2 导纳矩阵的形成152.1.3 电力网络中几种特殊的数学模型172.2 电力系统潮流计算202.2.1 电力系统潮流计算数学模型202.2.2 电力系统节点分类212.2.3 潮流计算的约束条件222.3 牛顿拉夫逊法求解潮流计算232.3.1 牛顿拉夫逊法原理232.3.2 PQ分化法潮流计算25第3章基于MATLAB软件 PQ法潮流计算303.1 PQ分化法法度框图303.2 计算步调及实现各部分功能的法度313.2.1 原始数据的输入313.2.2 导纳矩阵及B',B''形成343.2.3 计算不服衡功率ΔPi及修正相角Δθi363.2.4 计算不服衡功率ΔQi及修正相电压ΔVi373.2.5 法度运行结果的输出38第4章算例验证与阐发404.1 算例说明及阐发404.1.1 算例说明404.1.2 算例阐发404.2 根据算例输入相应节点线路参数40 4.3 算例运行结果41结论44致谢45参考文献46附录A48附录B60附录C81第1章绪论1.1课题布景电力是衡量一个国家经济成长的主要指标,也是反应人民生活水平的重要标记,它已成为现代工农业生产、交通运输以及城乡生活等许多方面不成或缺的能源和动力。
pq分解法matlab程序,matlab应求PQ分解法进⾏潮流计算%本程序的功能是利⽤PQ分解法进⾏潮流计算clearclcn=input('请输⼊节点数:n=');nl=input('请输⼊⽀路数:nl=');isb=input('请输⼊平衡母线节点号:isb=');pr=input('请输⼊误差精度:pr=');disp('请输⼊由⽀路参数形成的矩阵:B1=');%输⼊B1[fname, pname]= uigetfile('*.xls');file=[pname fname];x=xlsread(file);B1=[x(:,1),x(:,2),(x(:,3)+x(:,4)*i),x(:,5)*i,x(:,6),x(:,7)];disp('请输⼊由节点参数形成的矩阵:B2=');%输⼊B2[fname, pname]= uigetfile('*.xls');file=[pname fname];y=xlsread(file);B2=[(y(:,1)+y(:,2)*i),(y(:,3)+y(:,4)*i),y(:,5),y(:,6),y(:,7),y(:,8)];disp('请输⼊由节点号及其对地阻抗形成的矩阵:X=');%输⼊X[fname, pname]= uigetfile('*.xls');file=[pname fname];z=xlsread(file);X=z;na=input('请输⼊PQ节点数na=');Y=zeros(n);YI=zeros(n);e=zeros(1,n);f=zeros(1,n);V=zeros(1,n);O=zeros(1,n);for i=1:nif X(i,2)~=0;p=X(i,1);Y(p,p)=1./X(i,2);for i=1:nlif B1(i,6)==0p=B1(i,1);q=B1(i,2);else p=B1(i,2);q=B1(i,1);endY(p,q)=Y(p,q)-1./(B1(i,3)*B1(i,5));YI(p,q)=YI(p,q)-1./B1(i,3);Y(q,p)=Y(p,q);YI(q,p)=YI(p,q);Y(q,q)=Y(q,q)+1./(B1(i,3)*B1(i,5)^2)+B1(i,4)./2; YI(q,q)=YI(q,q)+1./B1(i,3);Y(p,p)=Y(p,p)+1./B1(i,3)+B1(i,4)./2;YI(p,p)=YI(p,p)+1./B1(i,3);end %求导纳矩阵G=real(Y);B=imag(YI);BI=imag(Y);for i=1:nS(i)=B2(i,1)-B2(i,2);BI(i,i)=BI(i,i)+B2(i,5);endP=real(S);Q=imag(S);for i=1:ne(i)=real(B2(i,3));f(i)=imag(B2(i,3));V(i)=B2(i,4);endfor i=1:nif B2(i,6)==2V(i)=sqrt(e(i)^2+f(i)^2);O(i)=atan(f(i)./e(i));endendfor i=2:nelse IC1=i+1;for j1=IC1:nB(i,j1)=B(i,j1)./B(i,i);endB(i,i)=1./B(i,i);for k=i+1:nfor j1=i+1:nB(k,j1)=B(k,j1)-B(k,i)*B(i,j1); endendendendp=0;q=0;for i=1:nif B2(i,6)==2p=p+1;k=0;for j1=1:nif B2(j1,6)==2k=k+1;A(p,k)=BI(i,j1);endendendendfor i=1:naif i==naA(i,i)=1./A(i,i);else k=i+1;for j1=k:naA(i,j1)=A(i,j1)./A(i,i);endA(i,i)=1./A(i,i);A(k,j1)=A(k,j1)-A(k,i)*A(i,j1);endendendendICT2=1;ICT1=0;kp=1;kq=1;K=1;DET=0;ICT3=1;while ICT2~=0|ICT3~=0ICT2=0;ICT3=0;for i=1:nif i~=isbC(i)=0;for k=1:nC(i)=C(i)+V(k)*(G(i,k)*cos(O(i)-O(k))+BI(i,k)*sin(O(i)-O(k))); endDP1(i)=P(i)-V(i)*C(i);DP(i)=DP1(i)./V(i);DET=abs(DP1(i));if DET>=prICT2=ICT2+1;endendendNp(K)=ICT2;if ICT2~=0for i=2:nDP(i)=B(i,i)*DP(i);if i~=nIC1=i+1;for k=IC1:nDP(k)=DP(k)-B(k,i)*DP(i);endelseIC4=L-1;for MZ=2:IC4I=IC4+2-MZ;DP(I)=DP(I)-B(I,L)*DP(L);endendendendfor i=2:nO(i)=O(i)-DP(i);endkq=1;L=0;for i=1:nif B2(i,6)==2C(i)=0;L=L+1;for k=1:nC(i)=C(i)+V(k)*(G(i,k)*sin(O(i)-O(k))-BI(i,k)*cos(O(i)-O(k))); endDQ1(i)=Q(i)-V(i)*C(i);DQ(L)=DQ1(i)./V(i);DET=abs(DQ1(i));if DET >=prICT3=ICT3+1;endendendelse kp=0;if kq~=0;L=0;for i=1:nif B2(i,6)==2C(i)=0;L=L+1;DQ1(i)=Q(i)-V(i)*C(i);DQ(L)=DQ1(i)./V(i);DET=abs(DQ1(i));endendendendNq(K)=ICT3;if ICT3~=0L=0;for i=1:naDQ(i)=A(i,i)*DQ(i);if i==nafor LZ=2:iL=i+2-LZ;IC4=L-1;for MZ=1:IC4I=IC4+1-MZ;DQ(I)=DQ(I)-A(I,L)*DQ(L); endendelseIC1=i+1;for k=IC1:naDQ(k)=DQ(k)-A(k,i)*DQ(i); endendendL=0;for i=1:nif B2(i,6)==2endkp=1;K=K+1;elsekq=0;if kp~=0K=K+1;endendfor i=1:nDy(K-1,i)=V(i);endenddisp('迭代次数');disp(K);disp('每次没有达到精度要求的有功功率个数为');disp(Np);disp('每次没有达到精度要求的⽆功功率个数为');disp(Nq);for k=1:nE(k)=V(k)*cos(O(k))+V(k)*sin(O(k))*j;O(k)=O(k)*180./pi;enddisp('各节点的电压标⼳值E为(节点号从⼩到⼤排):'); disp(E);disp('各节点的电压V⼤⼩(节点号从⼩到⼤排)为:'); disp(V);disp('各节点的电压相⾓O(节点号从⼩到⼤排)为:'); disp(O);for p=1:nC(p)=0;S(p)=E(p)*C(p);enddisp('各节点的功率S(节点号从⼩到⼤排)为:');disp(S);disp('各条⽀路的⾸端功率Sj(顺序同您输⼊B1时⼀样)为:');for i=1:nlif B1(i,6)==0p=B1(i,1);q=B1(i,2);else p=B1(i,2);q=B1(i,1);endSi(p,q)=E(p)*(conj(E(p))*conj(B1(i,4)./2)+(conj(E(p)*B1(i,5))-conj(E(q)))*conj(1./(B1(i,3)*B1(i,5)))); disp(Si(p,q));enddisp('各条⽀路的末端功率Sj(顺序同您输⼊B1时⼀样)为:');for i=1:nlif B1(i,6)==0p=B1(i,1);q=B1(i,2);else p=B1(i,2);q=B1(i,1);endSj(q,p)=E(q)*(conj(E(q))*conj(B1(i,4)./2)+(conj(E(q)./B1(i,5))-conj(E(p)))*conj(1./(B1(i,3)*B1(i,5)))); disp(Sj(q,p));enddisp('各条⽀路的功率损耗DS(顺序同您输⼊B1时⼀样)为:');for i=1:nlif B1(i,6)==0p=B1(i,1);q=B1(i,2);else p=B1(i,2);q=B1(i,1);endDS(i)=Si(p,q)+Sj(q,p);disp(DS(i));endfor j=1:nDy(K,j)=Dy(K-1,j);endenddisp('以下是每次迭代后各节点的电压值(如图所⽰)');plot(Cs,Dy),xlabel('迭代次数'),ylabel('电压'),title('电压迭代次数曲线');。
程序代码如下:111111.%读入数据clcclearfilename='123.txt';a=textread(filename)n=a(1,1);pinghengjd=a(1,2);phjddianya=a(1,3);jingdu=a(1,4);b=zeros(1,9);j1=0;[m1,n1]=size(a);for i1=1:m1if a(i1,1)==0j1=j1+1;b(j1)=i1;endendb;%矩阵分块a1=a(b(1)+1:b(2)-b(1)+1,1:n1);a2=a(b(2)+1:b(3)-1,1:n1);a3=a(b(3)+1:b(4)-1,1:n1);a4=a(b(4)+1:b(5)-1,1:n1);a5=a(b(5)+1:b(6)-1,1:n1);%设置初值vcz=1;dcz=0;kmax=20;k1=0;%求节点导纳矩阵a11=zeros(4,6);for i0=1:3for j0=1:6a11(i0,j0)=a1(i0,j0);a11(4,j0)=a2(1,j0);endenda11;linei=a11(1:4,2);linej=a11(1:4,3);liner=a11(1:4,4);linex=a11(1:4,5);lineb=a11(1:4,6);branchi=0;branchj=0;branchb=0;G=zeros(4,4);B=zeros(4,4);for k=1:4i2=linei(k,1);j2=linej(k,1);r=liner(k,1);x=linex(k,1);b=0;GIJ=r/(r*r+x*x);BIJ=-x/(r*r+x*x);if k>=4 & lineb(k)~=0k0=lineb(k);G(i2,j2)=-GIJ/k0;G(j2,i2)=G(i2,j2);B(i2,j2)=-BIJ/k0;B(j2,i2)=B(i2,j2);G(i2,i2)=G(i2,i2)+GIJ/k0/k0; B(i2,i2)=B(i2,i2)+BIJ/k0/k0;elseG(j2,i2)=-GIJ;G(i2,j2)=G(j2,i2);B(j2,i2)=-BIJ;B(i2,j2)=B(j2,i2);G(i2,i2)=G(i2,i2)+GIJ;b=lineb(k);B(i2,i2)=B(i2,i2)+BIJ+b;endG(j2,j2)=G(j2,j2)+GIJ;B(j2,j2)=B(j2,j2)+BIJ+b;endG;B;B=B.*i;Yf=G+BY=abs(Yf);alf=angle(Yf);%赋Jacobian矩阵参数P=zeros(n,1);Q=zeros(n,1);Pd=zeros(1,n);Qd=zeros(1,n);dP=zeros(1,n);dQ=zeros(1,n);PG=a4(:,3);PD=a4(:,5);QG=a4(:,4);QD=a4(:,6);i8=a4(:,2);for j8=1:length(i8)P(i8(j8))=PG(i8(j8))-PD(i8(j8));Q(i8(j8))=QG(i8(j8))-QD(i8(j8));enddelt=zeros(n,1);V=ones(n,1);V(3)=1.10;V(4)=1.05;ddelt=zeros(n,1);dV=zeros(n,1);A=zeros(2*n,2*n);B=zeros(2*n,1);Jacobian=Jaco(V,delt,n,Y,alf)%求取矩阵功率for j5=1:kmaxdisp(['第' int2str(j5) '次计算结果'])if k>=kmaxbreakendfor i10=1:4Pd(i10)=0;Qd(i10)=0;for j10=1:nPd(i10)=Pd(i10)+V(i10)*Y(i10,j10)*V(j10)*cos(d elt(i10)-delt(j10)-alf(i10,j10));Qd(i10)=Qd(i10)+V(i10)*Y(i10,j10)*V(j10)*sin(d elt(i10)-delt(j10)-alf(i10,j10));endendfor i4=1:3dP(i4)=P(i4)-Pd(i4);endfor j4=1:2dQ(j4)=Q(j4)-Qd(j4);endA=Jaco(V,delt,n,Y,alf)for i14=1:nB(i14*2-1)=-dP(i14);B(i14*2)=-dQ(i14);endif max(abs(B))>jingduX=A\B;for i16=1:nddelt(i16)=X(2*i16-1);dV(i16)=X(2*i16)*V(i16);endV=V+dVdelt=delt+ddeltelsebreakenddisp('----------------')end%流氓算法% for ii=1:2% V(ii)=V(ii)+dV(ii);% end% V222222.function A=Jaco(V,delt,n,Y,alf)%计算Jacobian矩阵for i7=1:nHd1(i7)=0;Jd1(i7)=0;for j7=1:nHd1(i7)=Hd1(i7)+V(i7)*Y(i7,j7)*V(j7)*sin(delt(i7)-delt(j7)-alf(i7,j7));Jd1(i7)=Jd1(i7)+V(i7)*Y(i7,j7)*V(j7)*cos(delt(i7)-delt(j7)-alf(i7,j7));endendfor i6=1:nfor j6=1:nif i6~=j6H(i6,j6)=-V(i6)*Y(i6,j6)*V(j6)*sin(delt(i6)-delt(j6)-alf(i6,j6));N(i6,j6)=-V(i6)*Y(i6,j6)*V(j6)*cos(delt(i6)-delt(j6)-alf(i6,j6));J(i6,j6)=-N(i6,j6);L(i6,j6)=H(i6,j6);elseH(i6,i6)=Hd1(i6)-V(i6)*Y(i6,i6)*V(i6)*sin(delt(i6)-delt(j6)-alf(i6,j6));J(i6,j6)=-Jd1(i6)+V(i6)*Y(i6,j6)*V(j6)*cos(delt(i6)-delt(j6)-alf(i6,j6));N(i6,j6)=-Jd1(i6)-V(i6)*Y(i6,i6)*V(i6)*cos(alf(i6,i6));L(i6,i6)=-Hd1(i6)+V(i6)*Y(i6,i6)*V(i6)*sin(alf(i6,i6));endendend%修正Jacobian矩阵for j9=3for i9=1:nN(i9,j9)=0;L(i9,j9)=0;J(j9,i9)=0;L(j9,i9)=0;endendL(j9,j9)=1;for j9=4for i9=1:nH(i9,j9)=0;N(i9,j9)=0;J(i9,j9)=0;L(i9,j9)=0;H(j9,i9)=0;N(j9,i9)=0;J(j9,i9)=0;L(j9,i9)=0;endendH(j9,j9)=1;L(j9,j9)=1;%Jaco=[H N;J L];%Jaco=zeros(2*n,2*n);for i11=1:nfor j11=1:nJaco(2*i11-1,2*j11-1)=H(i11,j11); Jaco(2*i11-1,2*j11)=N(i11,j11); Jaco(2*i11,2*j11-1)=J(i11,j11);Jaco(2*i11,2*j11)=L(i11,j11);endendA=Jaco;33333.数据:4 4 1.05 0.000011 12 0.1 0.40 0.015282 1 4 0.12 0.50 0.019203 24 0.08 0.40 0.014131 1 3 0 0.3 0.909090911 1 0 0 0.30 0.182 2 0 0 0.55 0.133 3 0.5 0 0 01 3 1.10 0 0。
基于MATLAB软件的P-Q分解法潮流计算摘要电力系统潮流计算是研究电力系统稳态运行情况的一种重要的分析计算,它根据给定的运行条件及系统接线情况确定整个电力系统各部分的运行状态:各母线的电压,各元件中流过的功率,系统的功率损耗。
在电力系统规划的设计和现有电力系统运行方式的研究中,都需要利用潮流计算来定量地分析比较供电方案或运行方式的合理性,可靠性和经济性。
所以,电力系统潮流计算是进行电力系统故障计算,继电保护整定,安全分析的必要工具。
随着电力系统网络的急剧扩大和不断复杂,运用手算进行潮流计算已经不现实。
但是,伴随着计算机技术的飞速发展,基于计算机的潮流计算也就应运而生了。
这样,通过潮流计算,实现对系统的分析成为可能。
本文结合潮流计算的三个基本要求,紧跟该领域的发展,介绍了基于MATLAB软件P-Q分解法潮流计算的程序,该程序用于粗略的计算中小型电力网络的潮流,实现对其的分析。
本文所设计的程序,在计算中,所用的算法通俗易懂并对以往的主流算法做了一些改进,提高了计算速度。
同时,该程序采用了GUI人机对话,将Excel表格、TXT文档与MATLAB程序紧密联系起来,使输入输出界面更加人性化。
关键词:电力系统潮流计算;P-Q分解法;MATLAB软件Power flow calculation of P-Q mode basedon MATLAB softwareAbstractPower flow calculation is one of the important calculations which are to study the operation of power system steady state analysis. It is based on the given operating conditions and system wiring to identify the various parts of the power system operating state: the buses voltage, the stream components power, system power loss. both power system planning design and operation of existing power system mode of study are need to use the power flow calculation to quantitatively compare the program or run mode power supply reasonable, reliability and economy. Therefore, the power flow calculation is an essential tool for a calculation of power system faults, protection setting, security analysis. with the rapid expansion of power system network and continuing to bemore complex, using hand calculation for flow calculation has been unrealistic. But ,with the celerity development in computer technology, computer-based power flow calculation has also emerged. In this way, It is possible to analysis power system through the power flow calculation.Based on the three basic requirements of power flow calculation and followed by the development of the field, This paper introduces the PQ mode power flow calculation procedure based on MATLAB software .It is used for a rough calculation of the small and medium power network to achieve its analysis. The algorithm used in the procedure mentioned in this paper is more easy to understand and made some improvements to enhance the computing speed rather than the past. At the same time, the program uses the GUI man-machine dialogue. So Excel table, TXT documents is closely linked with the MATLAB program to make the input and output interfaces more humanity.Keywords:power flow calculation;P-Q decomposition mode;MATLAB software目录摘要 (I)Abstract................................................................................................................. I I第1章绪论 (1)1.1 课题背景 (1)1.2 电力系统潮流计算 (1)1.2.1 电力系统潮流计算简介 (1)1.2.2 电力系统潮流计算的基本要求 (2)1.3 潮流计算的意义及其发展 (3)1.4 本次毕业设计主要工作 (4)第2章潮流计算的原理及具体算法过程 (6)2.1 电力网络的数学模型 (6)2.1.1 电力网络的基本方程 (6)2.1.2 导纳矩阵的形成 (7)2.1.3 电力网络中几种特殊的数学模型 (8)2.2 电力系统潮流计算 (11)2.2.1 电力系统潮流计算数学模型 (11)2.2.2 电力系统节点分类 (12)2.2.3 潮流计算的约束条件 (13)2.3 牛顿-拉夫逊法求解潮流计算 (13)2.3.1 牛顿-拉夫逊法原理 (13)2.3.2 P-Q分解法潮流计算 (15)第3章基于MATLAB软件P-Q法潮流计算 (20)3.1 P-Q分解法程序框图 (20)3.2 计算步骤及实现各部分功能的程序 (21)3.2.1 原始数据的输入 (21)3.2.2 导纳矩阵及B',B''形成 (23)3.2.3 计算不平衡功率ΔP i及修正相角Δθi (25)3.2.4 计算不平衡功率ΔQ i及修正相电压ΔV i (26)3.2.5 程序运行结果的输出 (27)第4章算例验证与分析 (28)4.1 算例说明及分析 (28)4.1.1 算例说明 (28)4.1.2 算例分析 (28)4.2 根据算例输入相应节点线路参数 (28)4.3 算例运行结果 (29)结论 (32)致谢 (33)参考文献 (34)附录A (36)附录B (46)附录C (63)第1章绪论1.1课题背景电力是衡量一个国家经济发展的主要指标,也是反映人民生活水平的重要标志,它已成为现代工农业生产、交通运输以及城乡生活等许多方面不可或缺的能源和动力。