MATPOWER手册(中文版)

合集下载

matpover使用手册

matpover使用手册

matpover使用手册
MATPOWER是一个用于求解电力系统潮流、最优潮流和其他相关问题的Matlab工具包。

它提供了许多功能,包括潮流计算、最优潮流、稳定性分析等。

MATPOWER的使用手册可以在官方网站上找到,它包括了详细的文档、示例和说明,帮助用户了解如何使用MATPOWER来解决电力系统问题。

首先,使用手册会介绍MATPOWER的安装和配置。

它会指导用户如何在Matlab环境中安装MATPOWER,并进行必要的配置,以确保MATPOWER能够正常运行。

其次,使用手册会详细介绍MATPOWER的各种功能和命令。

这包括潮流计算的方法、最优潮流求解的算法、稳定性分析的工具等。

使用手册会提供示例代码,帮助用户快速上手并理解如何使用MATPOWER来解决实际的电力系统问题。

此外,使用手册还会介绍MATPOWER的输入输出格式。

它会解释MATPOWER所使用的数据格式,包括潮流数据、发电机数据、线路数据等。

同时,它还会介绍MATPOWER的输出结果格式,帮助用户理解如何解读MATPOWER的计算结果。

最后,使用手册还会包括一些高级主题,如MATPOWER的扩展功能、定制化选项、与其他工具的集成等。

这些内容可以帮助用户更
深入地理解MATPOWER,并发挥其最大的潜力来解决复杂的电力系统
问题。

总之,MATPOWER的使用手册是一个非常有价值的资源,它可以
帮助用户全面了解MATPOWER的功能和用法,从而更好地应用MATPOWER来解决实际的电力系统问题。

希望这个回答能够帮助到你。

matlab中文手册)

matlab中文手册)

Matlab中文手册第1章MA TLAB6.5环境 (6)1.1MA TLAB简介 (6)1.1.1MATLAB工具箱 (6)1.1.2MATLAB功能和特点 (6)1.2MA TLAB6.5环境设置 (7)1.2.1菜单栏 (7)1.2.2工具栏 (10)1.2.3通用操作界面窗口 (10)1.3MA TLAB6.5帮助 (19)1.4MA TLAB6.5其他管理 (20)1.4.1MATLAB用户文件格式 (20)21 (22)1.4.4退出MATLAB (23)1.5一个实例 (23)第2章MA TLAB数值计算 (26)2.1变量和数据 (26)2626272.2矩阵和数组 (28)28313741522.3稀疏矩阵 (55)2.3.1稀疏矩阵的建立 (55)2.3.2稀疏矩阵的存储空间 (58)2.3.3稀疏矩阵的运算 (59)2.4多项式 (59) (59) (61) (63)2.5元胞数组和结构数组 (65) (65) (68)2.6数据分析 (71) (71) (72) (74) (76)第3章MA TLAB符号计算 (77)3.1符号表达式的建立 (77)3.1.1创建符号常量 (77)3.1.2创建符号变量和表达式 (78)3.1.3符号矩阵 (80)3.2符号表达式的代数运算 (81) (81)3.2.2符号数值任意精度控制和运算 (83)3.2.3符号对象与数值对象的转换 (84)3.3符号表达式的操作和转换 (85) (85) (86) (89) (90)3.3.5符号表达式的转换 (92)3.4符号极限、微积分和级数求和 (93)3.4.1符号极限 (93)3.4.2符号微分 (94)3.4.3符号积分 (96)3.4.4符号级数 (97)3.5符号积分变换 (98)3.5.1傅里叶(Fourier)变换及其反变换 (98)3.5.2拉普拉斯(Laplace)变换及其反变换 (99)3.5.3Z变换及其反变换 (100)3.6符号方程的求解 (101) (101) (102)3.7符号函数的可视化 (103) (103) (105)3.8Maple函数的使用 (105) (105)3.8.2获得Maple的帮助 (106)第4章MA TLAB计算的可视化和GUI设计 (107)4.1二维曲线的绘制 (107)4.1.1基本绘图命令plot (107) (111) (112) (114) (115) (118)4.2MA TLAB的三维图形绘制 (119)4.2.1绘制三维线图命令plot3 (119)4.2.2绘制三维网线图和曲面图 (120) (123) (125)4.3MA TLAB的特殊图形绘制 (128) (128) (129) (130) (131) (132) (132) (133) (134)4.4图形窗口的功能 (135)4.5对话框 (136)4.6句柄图形 (138) (138) (139) (142)4.7图形用户界面(GUI)设计 (144)4.7.1可视化的界面环境 (144)4.7.2菜单 (146)4.7.3控件 (147) (149)4.7.6GUI应用举例 (149)4.8动画 (151)4.8.1以电影方式产生动画 (151) (152)第5章MA TLAB程序设计 (153)5.1脚本文件和函数文件 (153)5.1.1M文本编辑器 (153)5.1.2M文件的基本格式 (154)5.1.3M脚本文件 (155)5.1.4M函数文件 (156)5.2程序流程控制 (157)5.2.1for...end循环结构. (157)5.2.2while...end循环结构 .. (158)5.2.3If...else...end条件转移结构 . (158)5.2.4switch...case开关结构.. (159)5.2.5try...catch...end试探结构.. (160)5.2.6流程控制语句 (161)5.3函数调用和参数传递 (163) (163) (164)5.3.3函数的参数 (165) (168)5.4M文件性能的优化和加速 (170)5.4.1P码文件 (170)5.4.2M文件性能优化 (170)5.4.3JIT和加速器 (171)5.5内联函数 (174)5.6利用函数句柄执行函数 (175) (175) (176)5.7利用泛函命令进行数值分析 (177)5.7.1求极小值 (178)5.7.2求过零点 (179)5.7.3数值积分 (180) (180)第6章线性控制系统分析与设计 (182)6.1线性系统的描述 (182) (182) (183) (184) (184)6.2线性系统模型之间的转换 (187) (187) (190) (193)6.3结构框图的模型表示 (195)6.4线性系统的时域分析 (203) (203) (204) (205) (206) (208)6.5线性系统的频域分析 (209) (209) (210) (214) (214)6.6线性系统的根轨迹分析 (215) (215) (216)6.7线性系统的状态空间设计 (219) (219) (220)第7章Simulink仿真环境 (221)7.1演示一个Simulink的简单程序 (221)7.2Simulink的文件操作和模型窗口 (223)7.2.1Simulink的文件操作 (223)7.2.2Simulink的模型窗口 (223)7.3模型的创建 (225) (225) (227) (228)7.4Simulink的基本模块 (228) (228) (230)7.5复杂系统的仿真与分析 (233)7.5.1仿真的设置 (233) (234) (237) (239)7.6子系统与封装 (239) (239) (241) (242)7.7用MA TLAB命令创建和运行Simulink模型 (246) (246) (248)7.8以Simulink为基础的模块工具箱简介 (249)第8章MA TLAB高级应用 (250)8.1MA TLAB应用接口 (250)8.1.1MEX文件 (250)8.1.2使用MATLAB编译器生成MEX和EXE文件 (253)8.2低级文件的输入输出 (255) (255) (256) (258) (259)8.3图形文件的转储 (261)8.4Notebook (261)8.4.1Notebook的安装 (261)8.4.2Notebook的启动 (261)8.4.3Notebook的使用 (263)8.4.4Notebook中MA TLAB的使用 (266)第1章MATLAB6.5环境1.1M ATLAB简介●MATLAB(MatrixLaborator)是MathWorks公司开发科学与工程计算软件;●广泛应用于自动控制、数学运算、信号分析、计算机技术、图像信号处理、财务分析、航天工业、汽车工业、生物医学工程、语音处理和雷达工程等行业;●国内外高校和研究部门科学研究的重要工具;●MATLIB已成为数学计算工具方面事实上的标准,MATLIB6.5是最新版本。

matpower中文手册

matpower中文手册

matpower中文手册MATPOWER中文手册范本说明:本文档是MATPOWER的中文手册,旨在提供对MATPOWER 软件功能和使用方法的详细介绍。

本手册涉及的内容包括MATPOWER 的安装、基本功能、高级功能等方面的信息。

请您参考本手册以获取有关MATPOWER的详尽信息。

1、简介1.1 MATPOWER概述1.2 MATPOWER的优势1.3 MATPOWER的应用领域2、安装和配置2.1 安装MATPOWER2.2 配置MATPOWER环境2.3 安装和配置MATPOWER插件3、MATPOWER基本功能3.1 网络输入文件格式3.2 网络数据格式3.3 运行MATPOWER3.4 数据载入和保存3.5 单个电力系统的潮流计算 3.6 多个电力系统的潮流计算3.7 MATPOWER的输出结果4、MATPOWER高级功能4.1 潮流敏感性分析4.2 非线性潮流算法4.3 发电机调度4.4 负荷模型和负荷曲线4.5 控制设备模型4.6 稳定状态可行性分析4.7 非线性稳定状态分析4.8路径追踪和欠驱动问题4.9MATPOWER的扩展功能和插件附件:1、MATPOWER示例网络数据文件2、MATLAB代码示例3、MATPOWER使用案例简介法律名词及注释:- 电力系统:指供电设施、输电线路、变电设备等组成的电力供应和传输系统。

- 潮流计算:电力系统中求解各节点电压和功率的过程。

- 发电机调度:调整发电机的运行模式和功率输出,以满足电力系统需求的过程。

- 稳定状态:电力系统各元件的电压、功率等参数保持稳定的状态。

- 扩展功能和插件:可以添加到MATPOWER中以增强其功能或适应特定需求的额外模块。

----------------【注】以上文本仅为草稿,其准确性和完整性有待人工审核和修改。

matlab潮流计算工具箱使用手册

matlab潮流计算工具箱使用手册

MATPOWERA M ATLAB™ Power System Simulation PackageVersion 3.2September 21, 2007User’s ManualRay D. Zimmerman Carlos E. Murillo-Sánchez rz10@ carlos_murillo@ © 1997-2007 Power Systems Engineering Research Center (PS ERC)School of Electrical Engineering, Cornell University, Ithaca, NY 14853Table of ContentsTable of Contents (2)1Introduction (3)2Getting Started (4)2.1System Requirements (4)2.2Installation (4)2.3Running a Power Flow (4)2.4Running an Optimal Power Flow (4)2.5Getting Help (4)3Technical Reference (6)3.1Data File Format (6)3.2Modeling (8)3.3Power Flow (11)3.4Optimal Power Flow (12)3.4.1AC OPF Formulation (13)3.4.2DC OPF Formulation (21)3.5Unit Decommitment Algorithm (22)3.6MATPOWER Options (22)3.7Summary of the Files (28)4Acknowledgments (33)5References (33)Appendix A: Notes on LP-Solvers for M ATLAB (34)Appendix B: Additional Notes (34)Appendix C: Auction Code (35)1IntroductionWhat is MATPOWER?MATPOWER is a package of M ATLAB M-files for solving power flow and optimal power flow prob-lems. It is intended as a simulation tool for researchers and educators that is easy to use and modify. MATPOWER is designed to give the best performance possible while keeping the code simple to understand and modify. The MATPOWER home page can be found at:/matpower/Where did it come from?MATPOWER was developed by Ray D. Zimmerman, Carlos E. Murillo-Sánchez and Deqiang Gan of PSERC at Cornell University (/) under the direction of Robert Thomas. The initial need for M ATLAB based power flow and optimal power flow code was born out of the computational requirements of the PowerWeb project (see /powerweb/).Who can use it?•MATPOWER is free. Anyone may use it.•We make no warranties, express or implied. Specifically, we make no guarantees regarding the correctness MATPOWER’s code or its fitness for any particular purpose.•Any publications derived from the use of MATPOWER must cite MATPOWER /matpower/.•Anyone may modify MATPOWER for their own use as long as the original copyright notices remain in place.•MATPOWER may not be redistributed without written permission.•Modified versions of MATPOWER, or works derived from MATPOWER, may not be distrib-uted without written permission.2Getting Started2.1System RequirementsTo use MATPOWER you will need:•M ATLAB version 6 or later1•M ATLAB Optimization Toolbox (required only for some OPF algorithms)Both are available from The MathWorks (see /).2.2InstallationStep 1: Go to the MATPOWER home page (/matpower/) and follow the download instructions.Step 2: Unzip the downloaded file.Step 3: Place the files in a location in your M ATLAB path.2.3Running a Power FlowTo run a simple Newton power flow on the 9-bus system specified in the file case9.m, with the de-fault algorithm options, at the M ATLAB prompt, type:>> runpf('case9')2.4Running an Optimal Power FlowTo run an optimal power flow on the 30-bus system whose data is in case30.m, with the default algo-rithm options, at the M ATLAB prompt, type:>> runopf('case30')To run an optimal power flow on the same system, but with the option for MATPOWER to shut down (decommit) expensive generators, type:>> runuopf('case30')2.5Getting HelpAs with M ATLAB’s built-in functions and toolbox routines, you can type help followed by the name of a command or M-file to get help on that particular function. Nearly all of MATPOWER’s M-files have such documentation. For example, the help for runopf looks like:1Although it is likely that most things work fine in M ATLAB5, this is not supported due to limited testing resources. MATPOWER 3.0 required M ATLAB 5 and MATPOWER 2.0 and earlier required only M ATLAB 4.>> help runopfRUNOPF Runs an optimal power flow.[baseMVA, bus, gen, gencost, branch, f, success, et] = ...runopf(casename, mpopt, fname, solvedcase)Runs an optimal power flow and optionally returns the solved values in the data matrices, the objective function value, a flag which is true if the algorithm was successful in finding a solution, and the elapsed time in seconds. All input arguments are optional. If casename is provided it specifies the name of the input data file or struct (see also 'helpcaseformat' and 'help loadcase') containing the opf data. The defaultvalue is 'case9'. If the mpopt is provided it overrides the defaultMATPOWER options vector and can be used to specify the solutionalgorithm and output options among other things (see 'help mpoption' for details). If the 3rd argument is given the pretty printed output will be appended to the file whose name is given in fname. If solvedcase isspecified the solved case will be written to a case file in MATPOWERformat with the specified name. If solvedcase ends with '.mat' it saves the case as a MAT-file otherwise it saves it as an M-file. MATPOWER also has many options which control the algorithms and the output. Type:>> help mpoptionand see Section 3.6 for more information on MATPOWER's options.3Technical Reference3.1Data File FormatThe data files used by MATPOWER are simply M ATLAB M-files or MAT-files which define and re-turn the variables baseMVA, bus, branch, gen, areas, and gencost. The baseMVA variable is a scalar and the rest are matrices. Each row in the matrix corresponds to a single bus, branch, or generator. The columns are similar to the columns in the standard IEEE and PTI formats. The details of the specifica-tion of the MATPOWER case file can be found in the help for caseformat.m:>> help caseformatCASEFORMAT Defines the MATPOWER case file format.A MATPOWER case file is an M-file or MAT-file which defines the variablesbaseMVA, bus, gen, branch, areas, and gencost. With the exception ofbaseMVA, a scalar, each data variable is a matrix, where a row correspondsto a single bus, branch, gen, etc. The format of the data is similar tothe PTI format described in/research/pstca/formats/pti.txtexcept where noted. An item marked with (+) indicates that it is includedin this data but is not part of the PTI format. An item marked with (-) isone that is in the PTI format but is not included here. Those marked with(2) were added for version 2 of the case file format. The columns foreach data matrix are given below.MATPOWER Case Version Information:A version 1 case file defined the data matrices directly. The last two,areas and gencost, were optional since they were not needed for runninga simple power flow. In version 2, each of the data matrices are storedas fields in a struct. It is this struct, rather than the individualmatrices that is returned by a version 2 M-casefile. Likewise a version 2MAT-casefile stores a struct named 'mpc' (for MATPOWER case). The structalso contains a 'version' field so MATPOWER knows how to interpret thedata. Any case file which does not return a struct, or any struct whichdoes not have a 'version' field is considered to be in version 1 format.See also IDX_BUS, IDX_BRCH, IDX_GEN, IDX_AREA and IDX_COST regardingconstants which can be used as named column indices for the data matrices.Also described in the first three are additional columns that are addedto the bus, branch and gen matrices by the power flow and OPF solvers.Bus Data Format1 bus number (1 to 29997)2 bus typePQ bus = 1PV bus = 2reference bus = 3isolated bus = 43 Pd, real power demand (MW)4 Qd, reactive power demand (MVAr)5 Gs, shunt conductance (MW (demanded) at V = 1.0 p.u.)6 Bs, shunt susceptance (MVAr (injected) at V = 1.0 p.u.)7 area number, 1-1008 Vm, voltage magnitude (p.u.)9 Va, voltage angle (degrees)(-) (bus name)10 baseKV, base voltage (kV)11 zone, loss zone (1-999)(+) 12 maxVm, maximum voltage magnitude (p.u.)(+) 13 minVm, minimum voltage magnitude (p.u.)Generator Data Format1 bus number(-) (machine identifier, 0-9, A-Z)2 Pg, real power output (MW)3 Qg, reactive power output (MVAr)4 Qmax, maximum reactive power output (MVAr)5 Qmin, minimum reactive power output (MVAr)6 Vg, voltage magnitude setpoint (p.u.)(-) (remote controlled bus index)7 mBase, total MVA base of this machine, defaults to baseMVA(-) (machine impedance, p.u. on mBase)(-) (step up transformer impedance, p.u. on mBase)(-) (step up transformer off nominal turns ratio)8 status, > 0 - machine in service<= 0 - machine out of service(-) (% of total VAr's to come from this gen in order to hold V at remote bus controlled by several generators)9 Pmax, maximum real power output (MW)10 Pmin, minimum real power output (MW)(2) 11 Pc1, lower real power output of PQ capability curve (MW)(2) 12 Pc2, upper real power output of PQ capability curve (MW)(2) 13 Qc1min, minimum reactive power output at Pc1 (MVAr)(2) 14 Qc1max, maximum reactive power output at Pc1 (MVAr)(2) 15 Qc2min, minimum reactive power output at Pc2 (MVAr)(2) 16 Qc2max, maximum reactive power output at Pc2 (MVAr)(2) 17 ramp rate for load following/AGC (MW/min)(2) 18 ramp rate for 10 minute reserves (MW)(2) 19 ramp rate for 30 minute reserves (MW)(2) 20 ramp rate for reactive power (2 sec timescale) (MVAr/min)(2) 21 APF, area participation factorBranch Data Format1 f, from bus number2 t, to bus number(-) (circuit identifier)3 r, resistance (p.u.)4 x, reactance (p.u.)5 b, total line charging susceptance (p.u.)6 rateA, MVA rating A (long term rating)7 rateB, MVA rating B (short term rating)8 rateC, MVA rating C (emergency rating)9 ratio, transformer off nominal turns ratio ( = 0 for lines )(taps at 'from' bus, impedance at 'to' bus, i.e. ratio = Vf / Vt)10 angle, transformer phase shift angle (degrees), positive => delay(-) (Gf, shunt conductance at from bus p.u.)(-) (Bf, shunt susceptance at from bus p.u.)(-) (Gt, shunt conductance at to bus p.u.)(-) (Bt, shunt susceptance at to bus p.u.)11 initial branch status, 1 - in service, 0 - out of service(2) 12 minimum angle difference, angle(Vf) - angle(Vt) (degrees)(2) 13 maximum angle difference, angle(Vf) - angle(Vt) (degrees)(+) Area Data Format1 i, area number2 price_ref_bus, reference bus for that area(+) Generator Cost Data FormatNOTE: If gen has n rows, then the first n rows of gencost containthe cost for active power produced by the corresponding generators.If gencost has 2*n rows then rows n+1 to 2*n contain the reactivepower costs in the same format.1 model, 1 - piecewise linear,2 - polynomial2 startup, startup cost in US dollars3 shutdown, shutdown cost in US dollars4 n, number of cost coefficients to follow for polynomialcost function, or number of data points for piecewise linear5 and following, cost data defining total cost functionFor polynomial cost:c2, c1, c0where the polynomial is c0 + c1*P + c2*P^2For piecewise linear cost:x0, y0, x1, y1, x2, y2, ...where x0 < x1 < x2 < ... and the points (x0,y0), (x1,y1),(x2,y2), ... are the end- and break-points of the cost function. Some columns are added to the bus, branch and gen matrices by the solvers. See the help for idx_bus, idx_brch, and idx_gen for more details.3.2ModelingAC FormulationFixed loads are modeled as constant real and reactive power injections,!Pdand!Qdspecified in col-umns 3 and 4, respectively, of the bus matrix. The shunt admittance of any constant impedance shuntelements at a bus are specified by Gsh and Bshin columns 5 and 6, respectively, of the bus matrix!Ysh=Gsh+jBshbaseMVAEach branch, whether transmission line, transformer or phase shifter, is modeled as a standard π-model transmission line, with series resistance R and reactance X and total line charging capacitance!Bc, in series with an ideal transformer and phase shifter, at the from end, with tap ratio!" and phase shift angle!"shift. The parameters R, X,!Bc,!" and!"shift, are found in columns 3, 4, 5, 9 and 10 of the branch matrix, respectively. The branch voltages and currents at the from and to ends of the branch are related by the branch admittance matrix!Ybras follows!IfIt"#$%&'=Y brVfVt"#$%&'(1) where!Ybr=Ys+jBc2"#$%&'1(2)Ys1(e j*shift)Ys1(e)j*shiftYs+jBc2+,---./and!Ys=1R+jX.The elements of the individual branch admittance matrices and the bus shunt admittances are com-bined by MATPOWER to form a complex bus admittance matrix!Ybus, relating the vector of complex bus voltages!Vbuswith the vector of complex bus current injections!Ibus!Ibus=YbusVbusSimilarly, admittance matrices!Yfand!Yt, are formed to compute the vector of complex current injec-tions at the from and to ends of each line, given the bus voltages!Vbus.!If=YfVbusIt=YtVbusThe vectors of complex bus power injections, and branch power injections can be expressed as!Sbus=diag(Vbus)Ibus*Sf=diag(Vf)If*St=diag(Vt)It*where!Vfand!Vtare vectors of the complex bus voltages at the from and to ends, respectively, of all branches, and diag() converts a vector into a diagonal matrix with the specified vector on the diagonal.DC FormulationFor the DC formulation, the same parameters are used, with the exception that the following assump-tions are made:•Branch resistances R and charging capacitances!Bcare negligible (i.e. branches are lossless).•All bus voltage magnitudes are close to 1 p.u.•Voltage angle differences are small enough that!sin"ij#"ij.Combining these assumptions and equation (1) with the fact that!S=VI*, the relationship between thereal power flows and voltage angles for an individual branch can be written as!PfPt"#$%&'=B br(f(t"#$%&'+Pf,shiftPt,shift"#$%&'(2)where!Bbr=1X"1#1#11$%&'()(3)!Pf,shiftPt,shift"#$%&'=(shiftX)1*1"#$%&'.(4)The elements of the individual branch shift injections and!Bbrmatrices are combined by MATPOWERto form a bus!Bbusmatrix and!Pbus,shiftshift injection vector, which can be used to compute bus realpower injections from bus voltage angles!Pbus=Bbus"bus+Pbus,shiftSimilarly, MATPOWER builds the matrix!Bfand the vector!Pf,shiftwhich can be used to compute thevectors !Pfand!Ptof branch real power injections!Pf=Bf"bus+Pf,shiftPt=#Pf3.3Power FlowMATPOWER has five power flow solvers, which can be accessed via the runpf function. In addition to printing output to the screen, which it does by default, runpf optionally returns the solution in out-put arguments:>> [baseMVA, bus, gen, branch, success, et] = runpf(casename);The solution values are stored as follows:bus(:, VM)bus voltage magnitudesbus(:, VA)bus voltage anglesgen(:, PG)generator real power injectionsgen(:, QG)generator reactive power injectionsbranch(:, PF)real power injected into “from” end of branchbranch(:, PT)real power injected into “to” end of branchbranch(:, QF)reactive power injected into “from” end of branchbranch(:, QT)reactive power injected into “to” end of branchsuccess 1 = solved successfully, 0 = unable to solveet computation time required for solutionThe default power flow solver is based on a standard Newton’s method [10] using a full Jacobian, up-dated at each iteration. This method is described in detail in many textbooks. Algorithms 2 and 3 are variations of the fast-decoupled method [9]. MATPOWER implements the XB and BX variations as described in [1]. Algorithm 4 is the standard Gauss-Seidel method from Glimm and Stagg [3], based on code contributed by Alberto Borghetti, from the University of Bologna, Italy. To use one of the power flow solvers other than the default Newton method, the PF_ALG option must be set explicitly. For example, for the XB fast-decoupled method:>> mpopt = mpoption('PF_ALG', 2);>> runpf(casename, mpopt);The last method is a DC power flow [11], which is obtained by executing runpf with the PF_DC op-tion set to 1, or equivalently by executing rundcpf directly. The DC power flow is obtained by a di-rect, non-iterative solution of the bus voltage angles from the specified bus real power injections, based on equations (2), (3) and (4).For the AC power flow solvers, if the ENFORCE_Q_LIMS option is set to 1 (default is 0), then if any generator reactive power limit is violated after running the AC power flow, the corresponding bus is converted to a PQ bus, with the reactive output set to the limit, and the case is re-run. The voltage magnitude at the bus will deviate from the specified value in order to satisfy the reactive power limit. If the generator at the reference bus reaches a reactive power limit and the bus is converted to a PQ bus, the first remaining PV bus will be used as the slack bus for the next iteration. This may result in the real power output at this generator being slightly off from the specified values.Currently, none of MATPOWER’s power flow solvers include any transformer tap changing or han-dling of disconnected or de-energized sections of the network.Performance of the power flow solvers, with the exception of Gauss-Seidel, should be excellent even on very large-scale power systems, since the algorithms and implementation take advantage of M ATLAB’s built-in sparse matrix handling.3.4Optimal Power FlowMATPOWER includes several solvers for the optimal power flow (OPF) problem, which can be ac-cessed via the runopf function. In addition to printing output to the screen, which it does by default, runopf optionally returns the solution in output arguments:>> [baseMVA, bus, gen, gencost, branch, f, success, et] = runopf(casename);In addition to the values listed for the power flow solvers, the OPF solution also includes the follow-ing values:bus(:, LAM_P)Lagrange multiplier on bus real power mismatchbus(:, LAM_Q)Lagrange multiplier on bus reactive power mismatchbus(:, MU_VMAX)Kuhn-Tucker multiplier on upper bus voltage limitbus(:, MU_VMIN)Kuhn-Tucker multiplier on lower bus voltage limitgen(:, MU_PMAX)Kuhn-Tucker multiplier on upper generator real power limitgen(:, MU_PMIN)Kuhn-Tucker multiplier on lower generator real power limitgen(:, MU_QMAX)Kuhn-Tucker multiplier on upper generator reactive power limitgen(:, MU_QMIN)Kuhn-Tucker multiplier on lower generator reactive power limitbranch(:, MU_SF)Kuhn-Tucker multiplier on MVA limit at "from" end of branchbranch(:, MU_ST)Kuhn-Tucker multiplier on MVA limit at "to" end of branchf final objective function valueMATPOWER can make use of a number of different OPF solvers. There are two legacy solvers from early versions of MATPOWER, namely the constr and LP-based solvers, that have been deprecated and will be removed from future versions. The details of the problem formulation and solution algo-rithms used by these solvers can be found in the user's manual included with previous versions of MATPOWER.The current generation of solvers use the generalized AC OPF formulation described below. MATPOWER includes one based on fmincon from M ATLAB’s Optimization Toolbox and there are two optional packages, MINOPF2 and TSPOPF3, that implement higher performance OPF solvers us-ing MEX files. MINOPF, based on the MINOS [7] solver, has been available since mid-2004 and is distributed separately because it has a more restrictive license than MATPOWER. TSPOPF is a collec-tion of three solvers developed by Hongye Wang [11] and is currently distributed separately as well. The performance of MATPOWER’s OPF solvers depends on several factors. First, for problems of this general nature, fmincon does not exploit and preserve sparsity, so it is inherently limited to solving small power systems. The MEX based solvers, on the other hand, do exploit sparsity and are suitable for much larger problems. MINOPF is coded in FORTRAN and evaluates the required Jacobians us-ing an optimized structure that follows the order of evaluation imposed by the compressed-column sparse format which is employed by MINOS. In fact, the new generalized OPF formulation included in MATPOWER 3.0 and later is inspired by the data format used by MINOS. The solvers in the TSPOPF package are implemented in the C language.MATPOWER’s OPF implementation is not currently able to handle unconnected or de-energized sec-tions of the network.2 See /minopf/.3 See /tspopf/.Piecewise linear costs using constrained cost variables (CCV)The OPF formulations in MATPOWER allow for the specification of convex piecewise linear costfunctions for active or reactive generator output. An example of such a cost curve is shown below.This non-differentiable cost is modeled using an extra helper cost variable for each such cost curve and additional constraints on this variable and Pg , one for each segment of the curve. The constraints build a convex “basin” equivalent to requiring the cost variable to lie in the epigraph of the cost curve. When the cost is minimized, the cost variable will be pushed against this basin. If the helper cost vari-able is y , then the contribution of the generator’s cost to the total cost is exactly y . In the above case, the two additional required constraints are1) !y "m 1(P g #x 0)+c 0(y must lie above the first segment) 2) ! y "m 2(P g #x 1)+c 1 (y must lie above the second segment)where m 1 and m 2 are the slopes of the two segments. Also needed, of course, are the box restrictions on P g : P min ≤ P g ≤ P max . The additive part of the cost contributed by this generator is y .This constrained cost variable (CCV) formulation is used by all of the MATPOWER OPF solvers for handling piecewise linear cost functions, with the exception of two that are part of the optional TSPOPF package, namely the step-controlled primal/dual interior point method (SCPDIPM ) and the trust region based augmented Lagrangian method (TRALM ), both of which use a cost smoothing tech-nique instead.3.4.1 AC OPF FormulationThe AC optimal power flow problem solved by MATPOWER is a “smooth” OPF with no discrete variables or controls. The generalized AC OPF formulation, used by the current generation of MATPOWER ’s OPF solvers, offers a number of extra capabilities relative to the traditional formula-tion of minimizing the cost of generation subject to voltage, flow and generator limits, used by the first generation of MATPOWER OPF solvers:• mixed polynomial and piecewise linear costs• dispatchable loads• generator P-Q capability curves• branch angle difference limits • additional user supplied linear constraints• additional user supplied costsNew in MATPOWER 3.2 are the generalized user supplied cost formulation, the generator capability curves, the branch angle difference limits and a simplification of the general linear constraint specifi-cation used in version 3.0.The problem is formulated in terms of two groups of optimization variables, labeled x and z . The x variables are the OPF variables, consisting of the voltage angles ! " and magnitudes V at each bus, and real and reactive generator injections P g and Q g .! x ="V P g Q g # $ % % % % & '( ( ( ( Additional user defined variables are grouped in z .The optimization problem can be expressed as follows: ! min x ,y ,z f 1i (P gi )+f 2i (Q gi )()i"+12w T Hw +C w T wsubject to!g P (x )=P (",V )#P g +P d =0 (active power balance equations)!g Q (x )=Q (",V )#Q g +Q d =0 (reactive power balance equations) ! g S f (x )=S f (",V )#S max $0 (apparent power flow limit of lines, from end) ! g S t (x )=S t (",V )#S max $0 (apparent power flow limit of lines, to end) ! l "A x z # $ % & ' ( "u (general linear constraints)! x min "x "x max (voltage and generation variable limits)! z min "z "z max (limits on user defined variables) Here f 1i and f 2i are the costs of active and reactive power generation, respectively, for generator i at a given dispatch point. Both f 1i and f 2i are assumed to be polynomial or piecewise-linear functions.The most significant additions to the traditional, simple OPF formulation appear in the generalizedcost terms containing w and in the general linear constraints involving the matrix A, described in the next two sections. These two frameworks allow tremendous flexibility in customizing the problem formulation, making MATPOWER even more useful as a research tool.Note: In Optimization Toolbox versions 3.0 and earlier, fmincon seems to be providing inaccurate shadow prices on the constraints. This did not happen with constr and it may be a bug in these ver-sions of the Optimization Toolbox.General Linear ConstraintsIn addition to the standard non-linear equality constraints for nodal power balance and non-linear ine-quality constraints for line flow limits, this formulation includes a framework for additional linear constraints involving the full set of optimization variables.! l "A x z # $ % & '( "u (general linear constraints) Some portions of these linear constraints are supplied directly by the user, while others are generated automatically based on the case data. Automatically generated portions include:• rows for constraints that define generator P-Q capability curves• rows for constant power factor constraints for dispatchable or price-sensitive loads• rows for branch angle difference limits• rows and columns for the helper variables from the CCV implementation of piecewise linear gen-erator costs and their associated constraintsIn addition to these automatically generated constraints, the user can provide a matrix A u and vectors l u and u u to define further linear constraints. These user supplied constraints could be used, for example, to restrict voltage angle differences between specific buses. The matrix A u must have at least n x col-umns where n x is the number of x variables. If A u has more than n x columns, a corresponding z optimi-zation variable is created for each additional column. These z variables also enter into the generalized cost terms described below, so A u and N must have the same number of columns.!l u "A u x z # $ % & '( "u u (user supplied linear constraints) Change from MATPOWER 3.0: The A u matrix supplied by the user no longer includes the (all zero) columns corresponding to the helper variables for piecewise linear generator costs. This should sim-plify significantly the creation of the desired A u matrix. Generalized Cost FunctionThe cost function consists of two parts. The first is the polynomial or piecewise linear cost of genera-tion. A polynomial or piecewise linear cost is specified for each generator’s active output and, option-ally, reactive output in the appropriate row(s) of the gencost matrix. Any piecewise linear costs are implemented using the CCV formulation described above which introduces corresponding helper variables. The general formulation allows generator costs of mixed type (polynomial and piecewise linear) in the same problem.The second part of the cost function provides a general framework for imposing additional costs on the optimization variables, enabling things such as using penalty functions as soft limits on voltages, additional costs on variables involved in constraints handled by Langrangian relaxation, etc.。

m0n0wall Documentation Project 中文手册

m0n0wall Documentation Project 中文手册

m0n0wall中文手册作者:Chris BuechlerManuel Kasper译文:Ben Zengm0n0wall的作者是Manuel Kasper。

大部分文档由Chris Buechler编写。

其他贡献者在贡献者列表中。

m0nowall 版本1.2版权 2005m0n0wall Documentation Project版权所有允许以任何形式、任何用途再分发未经修改或经过修改的版本,只要满足以下的条件:z任何再分发形式必须不加修改地保留上述版权告示、本条件清单和下述弃权书。

z未经书面许可,依据本文派生的产品不得使用“m0n0wall Documentation Project”名称及其贡献者的名称。

本文档由m0n0wall Documentation Project及其贡献者“按现状条件”提供,并在此明示不提供任何明示或暗示的保障,包括但不限于对商业适销性、对特定目的的适用性的暗示保障。

任何情况下,m0n0wall Documentation Project及其贡献者均不对任何直接、间接、偶然、特殊、惩罚性的,或必然的损失(包括但不限于替代商品或服务的采购、使用、数据或利益的损失或营业中断)负责,无论是如何导致的并以任何有责任逻辑的,无论是否是在本文档使用以外以任何方式产生的契约、严格责任或是民事侵权行为(包括疏忽或其它)中的,即使已被告知发生该损失的可能性。

2005 年9 月摘要一个可自由再分发的、完整的、嵌入式的防火墙软件包。

目录第一章.介绍 (11)1.1 M0N0WALL 是什么 (11)1.2 M0N0WALL 不是什么 (12)1.3历史 (12)1.4功能 (13)1.4.1 组件 (15)1.4.2 规格 (15)1.5软件版本和分发(许可) (15)1.5.1 其它软件包 (16)1.6贡献者列表 (17)1.6.1 代码 (17)第二章.硬件兼容性 (19)2.1支持的硬件架构 (19)2.2支持基于PC的硬件 (20)2.2.1最低要求 (20)2.2.2 建议的BIOS修改 (20)2.2.3 存储介质 (21)2.3支持的嵌入式设备 (22)2.3.1. Soekris Engineering (22)2.3.2. PC Engines WRAP (22)2.3.3. Nokia IPxxx boxes (22)2.3.4. NexCom NexGate Appliances (23)2.4虚拟机 (24)2.5硬件选择 (24)2.5.1 嵌入式设备 (24)2.5.1.1. Soekris 45xx (25)2.5.1.2. Soekris 48xx (25)2.5.1.3. WRAP (25)2.5.2 网卡 (26)2.5.3 CPU (26)2.5.4 内存 (27)2.5.5 存储介质 (27)2.5.6 高吞吐量环境 (27)2.6无线网卡 (28)2.6.1 不支持的卡 (28)2.6.2 常用的卡 (28)2.7以太网卡 (30)2.7.1 支持的卡 (31)2.7.2 ISA网卡 (31)第三章. 安装 (32)3.1系统需求 (32)3.2获得软件 (32)3.3安装软件 (33)3.3.1 制作引导CD (33)3.3.2 制作CF卡或IDE 硬盘 (34)3.3.3 其它安装方式 (36)第四章.配置 (37)4.1控制台菜单 (37)4.2WEB GUI (38)4.3系统屏幕 (38)4.3.1 常规设置 (38)4.3.2 静态路由 (40)4.3.3 固件(升级) (41)4.3.4 高级 (42)4.4接口屏幕 (42)4.4.2LAN (44)4.4.3 WAN (45)4.4.4 可选的网络接口 (48)4.5服务菜单 (49)4.5.1 DNS转发 (49)4.5.2 动态域名 (51)4.5.3 DHCP (53)4.5.3.1 DHCP中继 (57)4.5.4 SNMP (58)4.5.5 ARP代理 (59)4.5.6 Captive Portal (61)4.5.7 LAN唤醒 (64)4.6VPN配置页面 (65)4.6.1 IPsec (66)4.6.2 PPTP (66)4.6.3 PPTP 用户 (66)4.7系统状态页面 (67)4.7.1 系统 (67)4.7.2 网络接口 (68)4.7.3 流量图 (68)4.7.4 无线 (69)4.8诊断页面 (70)4.8.1 系统日志 (70)4.8.2 DHCP租约 (70)4.8.3 IPsec (71)4.8.4 SIP代理 (72)4.8.5 ping/traceroute (72)4.8.6 状态复位 (73)4.8.8 工厂设置 (75)4.8.9 重启系统 (75)第五章. 防火墙页面 (76)5.1规则 (76)5.1.1 操作(Action) (76)5.1.2 禁用 (77)5.1.3 接口 (77)5.1.4 协议 (77)5.1.5 ICMP类型 (77)5.1.6 源(source) (78)5.1.7 源端口范围 (78)5.1.8 目的(Destination) (78)5.1.9 目的端口范围 (79)5.1.10 碎片 (79)5.1.11 日志 (79)5.1.12 说明 (80)5.2转入NAT(端口映射) (82)5.2.1 接口 (83)5.2.2 外部地址 (83)5.2.3 协议 (83)5.2.4 外部端口范围 (84)5.2.5 NAT IP (84)5.2.6 本地端口 (84)5.2.7 说明 (84)5.2.8 在防火墙中自动添加一条允许NAT规则通过的过滤规则 (84)5.2.9 编辑转入(端口映射)的防火墙规则 (85)5.3服务器NAT (85)5.3.1 增加服务器NAT记录 (85)5.3.2 使用服务器NAT记录 (86)5.3.3 启动代理ARP (86)5.4.1:1NAT (87)5.4.1 添加1:1NAT记录 (88)5.4.1.1 接口 (88)5.4.1.2 外部子网 (88)5.4.1.3 内部子网 (89)5.4.1.4 说明 (89)5.5转出NAT (89)5.5.1 添加转出NAT规则 (91)5.6流量整形 (91)5.6.1 添加管道 (92)5.6.2 添加队列 (93)5.6.3 添加规则 (95)5.6.4 整形向导 (97)5.7别名 (97)5.7.1.1 名称 (99)5.7.1.2 类型 (99)5.7.1.3 地址 (99)5.7.1.4 说明 (99)5.7.2 使用别名 (99)第六章关于NAT(略) (100)NAT的分类 (101)第七章关于流量整形(略) (103)第八章 IPSEC (105)8.1IP SEC结构简介 (106)8.2IP SEC 阶段1和阶段2 (107)8.3IKE KEY的交换 (108)8.4加密算法 (110)8.5HASH算法 (110)8.6预共享密钥 (110)8.7数字签名 (111)8.8证书管理 (113)8.9D IFFIE-H ELLMAN G ROUPS (113)8.9IKE主模式(M AIN M ODE) (115)8.10IKE主动模式(A GGRESSIVE M ODE) (115)8.12完美向前加密(PFS:P ERFECT F ORWARD S ECRECY) (120)8.13IP SEC OVER NAT-T (120)8.13.1 NAT-T协议包 (121)8.14IP SEC使用动态域名 (125)8.15配置IP SEC VPN隧道 (126)第九章 PPTP (132)9.1前言 (132)9.2读者 (132)9.3前提条件 (133)9.4子网和VLAN路由 (133)9.5设置PPTP (134)9.6设置PPTP用户 (136)9.7PPTP防火墙规则 (137)9.7.1 PPTP过滤规则的例子 (139)9.8设置WINDOWS XP的PPTP客户端 (140)9.9通过PPTP连接不能工作的情况 (146)第十章 OPENVPN (147)第十一章无线接入 (147)第十二章 CAPTIVE PORTAL (147)第十三章参考 (147)第十四章配置例子 (148)14.1配置DMZ接口使用NAT (148)14.1.1 网络拓扑图 (149)14.1.2 添加可选接口 (149)14.1.3 配置可选接口 (150)14.1.4 配置DMZ接口的防火墙规则 (150)14.1.5 允许服务经DMZ进入LAN (153)14.1.6 配置NAT (154)14.1.6.1 使用1:1NAT (154)14.1.6.2 测试1:1NAT配置 (155)14.1.6.3 使用转入NAT(端口映射) (155)14.2限制DMZ出站访问 (157)14.3配置过滤桥接 (158)14.3.1 常规配置 (159)14.3.2 WAN接口配置 (159)14.3.3 OPT接口配置 (159)14.3.4 启用过滤桥接功能 (160)14.3.5 配置防火墙规则 (160)1.4.3.5.1 OPT接口规则 (160)14.3.5.2 WAN接口规则 (161)14.3.5.3 LAN接口规则 (161)14.3.5.4 完成配置的规则 (161)14.3.6 完成配置工作 (162)第十五章SITE TO SITE VPN配置的例子 (162)15.1C ISCO PIX F IREWALL (162)15.1.1 PIX的配置 (163)15.1.2 m0n0wall的配置 (167)15.2S MOOTHWALL (169)15.3F REE S/WAN(O PEN S WAN) (169)15.4S ONICWALL (169)15.5N ORTEL (169)第十六章常见问题问答(FAQ) (170)第一章.介绍1.1 m0n0wall 是什么m0n0wall 是一项针对建立一个完整的、嵌入式的防火墙软件包的计划,该软件包可以安装于嵌入式PC里,提供所有商业防火墙的重要特性(包括易用性),而且价格只有商业防火墙几分之一(自由软件)。

matpower中文手册

matpower中文手册

MATPOWER一种基于matlab的电力系统仿真组件版本3.1b22006-9-15手册Ray D. Zimmerman ,Carlos E. Murillo-Sánchez,甘德强@1997-2006卡奈尔大学电气学院电力系统工程研究中心(PSERC)中文翻译制作:中国电力市场论坛()一切版权属于原作者。

目录1 绪论 (3)什么是MA TPOWER? (3)它从哪里来? (3)2 开始 (3)2.1 系统要求 (3)2.2 安装 (4)2.3 执行电力常规潮流运算 (4)2.4 执行最优潮流程序 (4)2.5 获得帮助 (4)3 技术规则 (5)3.1 数据文件格式 (5)3.2 模型 (8)交流模型(AC) (8)直流公式(DC) (9)3.3 电力潮流 (10)3.4 最优潮流 (10)传统的交流OPF方程 (12)基于最优化工具箱的OPF解法(constr) (13)基于线性规划的OPF解法(LPconstr) (14)3.4.2 广义交流最优潮流解法 (16)通用线性约束(一般线性约束) (17)通用成本函数 (18)通用P-Q容量曲线 (19)可调度负荷 (20)支路相角差限制 (22)问题数据转换 (22)附加线性约束的例子 (23)3.4.3 直流OPF方法 (23)机组组合算法 (24)3.6 MA TPOWER选项 (24)3.7 文件汇总 (27)4 致谢 (31)5 参考文献 (31)译者的话:在做项目和实验的过程中,偶然使用到MA TPOWER软件,发现该软件功能强大,但是操作还是比较的复杂,而MA TPOWER本身的说明文档还没有中文版本,因此,译者产生了翻译用户手册的想法,促使了这个文档的诞生。

由于翻译时间仓促,这个版本几乎没有任何校正,还有大量的错误,随后会对原始版本进行修正,恳请各位网友将错误发送到wolflove941@或者直接登陆中国电力市场论坛()提出宝贵的意见。

Matrix 中文手册

Matrix 中文手册

重要的安全指导!请阅读这本手册!它提供了很重要的安全、安装和操作指导,使您的设备发挥最高的性能,并且能够延长设备的使用寿命。

请保存这本手册!它包含了安全使用UPS 的重要指导,而且还告诉您,如何在需要时获得厂家提供的服务。

在以后对UPS的维修和存放中,以及遇到问题时,都需要参看这本手册以获得正确的指导。

射频干扰重要的安全指导!警告:我们只对遵守规则的用户负责,千万不要自行更改或拆卸,否则用户将失去使用这个设备的权力。

注意:此设备被检测通过,并且符合FCC第15部分A规则,由于该设备会产生和发出射频干扰,这些限制使得设备在商用环境下运行时产生的有害干扰保持在一定限度内,使其它通讯设备得到有效的保护。

如果没有根据指导安装或使用,可能会对无线电通讯产生有害的干扰。

总而言之,我们并不保证在特殊情况下安装时不会出现干扰。

如果该设备的关闭和打开对无线电设备产生干扰和影响,我们建议用户用以下方法中的一种或几种去尝试消除干扰。

■重置天线的方向。

■加大设备和接收器的距离。

■使设备连接在与接收器不在同一电路的插座上。

■向销售商、经验丰富的无线电调试人员咨询求助。

■该产品必须使用屏蔽通讯电缆接口。

目录1.0简介(1)2.0安全(3)3.0外观(4)隔离模块(4)电子模块(6)电池组(8)4.0安装(10)开箱检查,保护措施,移动UPS,放置(10)输入电压要求(11)安装步骤(12)输入线安装(13)输入电压插头选择(15)输出线安装过程(16)模块连接(18)紧急断电接口(Emergency Power Off Interface)(20)5.0操作(21)显示与控制操作(22)6.0UPS监控(29)计算机接口(29)7.0问题(30)故障查找(31)故障信息(33)重装电子模块(33)重装或增加了电池组(35)获得服务(36)8.0UPS存放(37)9.0指标(38)1.0简介1.1概述Matrix-UPS是一种高性能在线互动式的不间断电源。

mastership中文操作手册【word版】p

mastership中文操作手册【word版】p

MasterShip要求用户把PLINETYPE的值设置为“0”,代表用户在AutoCAD中打开已有的图时,图中的polyline不会被自动转换成2Dpolyline。用“PLINE”命令创建的polyline是普通polyline。
背景知识:
在AutoCAD中,PLINETYPE的值是一个整数,备选值为0、1和2,定义Polyline的类型。这个设置定义AutoCAD是否使用最优化的2DPolyline。PLINETYPE的控制范围包括用“PLINE”命令创建新的polyline以及对图中已有的老版本的polyline进行转换。3种备选值所代表的意义如下:
第七章MasterShip数据管理器(Organiser)89
一、第一个Organiser:主程序数据管理模块89
二、第二个Organiser:项目以及数据报表管理器90
前言
使用MasterShip软件辅助生设计流程简介:
Mastership软件是一套CAD/CAM工具,其功能处在设计阶段和实际生产之间的船舶准备阶段,也就是通常所说的生产设计阶段,可以帮助用户为各类船舶生成各种各样的生产信息。它应用于AutoCAD环境,从而有很强的适应性和可交换性。因此可以允许从不同种类的设计软件例如Maxsurt,Autoship或者Rhinocers等进行输入。输出也几乎适用于每个数控切割机系统。Mastership也使用和AutoCAD一样的图形用户界面(GUI),使得每个熟悉AutoCAD的用户都能很容易地理解和适应Mastership图形用户界面。
3)“2”:打开已有的图时,图中的polyline会被自动转换成优化格式的polyline。用“PLINE”命令创建的polyline是优化格式的polyline,即2Dpolyline。在AutoCAD2004以前的版本中,普通polyline和2Dpolyline所含的信息量是相同的,但2004版之后2Dpolyline的信息量明显增多,这一点可以在点选一条polyline后用“list”命令看到。在MasterShip中,很多情况下要求多段线的形态是普通Polyline,否则会导致功能失效。因此要求用户把POLYLINE设置为“0”。

MATPOWER潮流计算使用说明

MATPOWER潮流计算使用说明

MATPOWER潮流计算使用说明MATPOWER潮流计算(具体参见使用手册)以case5.m为例:结构体mpc的不同字段的简要说明如下:1.字段baseMVA是一个标量,用来设置基准容量,如100MVA;2.字段bus是一个矩阵,用来设置电网中各母线参数。

矩阵的每一行都对应于一个单一的母线,列的数据格式为bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin.1)bus_i 用来设置母线编号(正整数)2)type 用来设置母线类型,1为PQ节点母线,2为PV节点母线,3为平衡(参考)节点母线,4为孤立节点母线3)Pd和Qd用来设置母线注入负荷的有功功率和无功功率4)Gs和Bs用来设置与母线并联电导和电纳5)baseKV用来这是该母线基准电压6)Vm和Va用来设置母线电压的幅值、相位初值7)Vmax和Vmin用来设置工作时母线最高、最低电压幅值8)area和zone用来设置电网断面号和分区号,一般都设置为1,前者可设置范围为1-100,后者为1-9993.字段gen为一个矩阵,用来设置接入电网中的发电机(电源)参数矩阵的每一行都对应于一个单一的发电机,列的数据格式为bus Pg Qg Qmax Qmin Vg mBase status Pmax Pmin1)bus:发电机母线编号2)Pg和Qg:发电机有功功率和无功功率3)Pmax和Pmin:发电机有功功率最大、最小允许值4)Qmax和Qmin:发电机无功功率最大、最小允许值5)Vg:发电机工作电压6)mBase:发电机的功率基准,默认值就是baseMVA7)status:发电机的工作状态,1表示投入运行,0表示退出运行4.字段branch为一个矩阵,用来设置电网中各支路参数矩阵的每一行都对应于一个单一的支路,列的数据格式为fbus tbus r x b rateA rateB rateC ratio angle status angmin angmax1)fbus和tbus:该支路由起始节点(母线)编号和终止节点(母线)编号2)r x b :该支路的电阻电抗充电电纳3)rateA rateB rateC :该支路长期、短期和紧急紧急允许功率4)ratio:该支路的变比,如果支路元件是导线,那么ratio为0,如果支路元件为变压器,则该变比为fbus侧母线的基准电压与tbus侧母线的基准电压之比5)angle:支路的相位角度,如果支路元件为变压器(或移相器),就是变压器(或移相器)的转角;如果支路元件是导线,相位角度为06)status:支路工作状态,1表示投入,0表示退出7)angmin angmax :支路相位角度最小和最大差值控制选项mpoption表1.MATPWOER中选项变量mpoption的功能描述表2.潮流计算结果输出的选项功能描述选项变量使用方式举例:首先取得默认的选项变量,即>>mpopt = mpoption;如果要使用快速解耦算法来对数据文件“case57”进行潮流计算,则需在MATLAB的命令窗口中通过输入一下两行命令即可:>>mpopt = mpoption(mpopt,’PF_ALG’,2);>>runpf(’case57’,mpopt);如果只输出系统概要信息和机组信息,则可进行如下设置:>>mpopt = mpoption(mpopt,’OUT_BUS’,0,’OUT_BRANCH’,0,’OUT_GEN’,1)。

matpower使用总结

matpower使用总结

孟成林电气工程 20161800260Matpower总结1.(1)matpowe默认运行的是9节点系统。

在matlab的命令窗口输入“runpf(case_5_01')”即可运行已建立的的五节点的系统潮流。

“Case_5_01”是已建立的五节点的系统数据矩阵,是一个m文件。

如下:function mpc=case5_01% MATPOWER Case Format:Version 2mpc.version='2';%%-----Power Flow Data-----%%%% system MVA basempc.baseMVA=100;%% bus data% bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vminmpc.bus =[1 1 160 80 0 0 1 1 0 100 1 1.1 0.94;2 1 200 100 0 0 1 1 0 100 1 1.1 0.94;3 1 370 130 0 0 1 1 0 100 1 1.1 0.94;4 2 0 0 0 0 1 1.05 0 100 1 1.1 0.94;5 3 0 0 0 0 1 1.05 0 100 1 1.1 0.94;];%% generator data% bus Pg Qg Qmax Qmin Vg mBase status Pmax Pminmpc.gen=[4 500 0 99990 -9999 1.050 100 1 600 0;5 0 0 99990 -9999 1.050 100 1 600 0;];%% branch data% fbus tbus r x b rateA rateB rateC ratio angle status angmin angmax mpc.branch=[2 1 0.04 0.25 0.5 0 0 0 0 0 1 -360 360;3 1 0.1 0.35 0 0 0 0 0 0 1 -360 360;3 2 0.08 0.3 0.5 0 0 0 0 0 1 -360 360;3 5 0 0.03 0 0 0 0 1.05 0 1 -360 360;2 4 0 0.015 0 0 0 0 1.05 0 1 -360 360;];return;其中,1)baseMVA 是一个基准容量,为100MVA;2)bus是一个矩阵,用来设置电网中的各母线参数。

magmasoft中文教程

magmasoft中文教程

MAGMASOFT 4.4Manual Part one1.介紹(Introduction) ………………………………1.1MAGMASOFT® 可以提供你什麼?………………1.2如何成功的使用MAGMASOFT®………………1.3MAGMASOFT®的文件結構………………………1.4拼字跟用法………………………………………1.5疑問………………………………………………2.安裝(Installation)……………………………2.1 系統需求2.2 MAGMA安裝………………………………2.3 啟動MAGMASOFT® 執照………………2.3.1 擷取系統資訊………………………………2.3.2 從Email讀取系統和執照檔………………2.3.3 手動輸入系統鑰匙………………………………2.3.4 手動輸入執照鑰匙………………………………2.3.5 從檔案讀取系統鑰匙……………………………2.3.6 從檔案讀取執照鑰匙……………………………2.4 管理浮動執照………………………………2.4.1 顯示連結………………………………2.5 MAGMASOFT® 的專案………………………………2.6 MAGMASOFT® 的畫面………………………………2.7滑鼠鍵盤的用法………………………………3.專案管理(Project Administration)3.1開啟專案(Open project)………………………………3.2 產生新的專案(Create project)………………………3.3 產生新的版本(Create Version)…………………………3.4 刪除結果(Delete Result)…………………………3.5 刪除版本(Delete Version)……………………………3.6 刪除專案(Delete project)……………………………3.7專案資訊(Project info)………………………………4.前處理器(Preprocessor)4.1 開始幾何建構………………………………………4.2 管理幾何資料(Sheets)………………………………4.3 幾何資料庫(Geometry database)………………………4.4 輸入CAD資料(Importing CAD Data)…………………4.5 定義角度及精度(Definition of Angles & Accuracy)………4.6 選擇畫面(View options)………………………………4.7建構指令(Construction commands)……………………4.8操作指令(Manipulation commands)……………………4.9控制點(Control Point)………………………………4.10支援幾何功能(Support functions)………………………5.網格化(Mesh Generation)5.1 概論(Overview)………………………………5.1.1格子大小/ …wallthickness‟………………………5.1.2格子再細化/ …accuracy‟, …element size‟……………5.1.3格子的修飾/ …smoothing‟………………………5.1.4格子的外觀/ …aspect ratio‟………………………5.2材料群的選用與網格化的改善………………………5.3產生網格(Generate mesh)……………………………5.4檢查網格(Check enmeshment)………………………5.4.1觀看網格(view mesh)…………………………5.4.2觀看網格品質(view mesh quality)………………6.模擬計算(Simulation)6.1 概論(Overview)………………………………6.1.1 充填(Moldfilling)………………………………6.1.2 凝固(Solidification)…………………………6.1.3 充填和凝固………………………………6.1.4 批次生產(Batch production)……………………6.2 模擬參數定義(Defining simulation parameters)…………6.2.1 材料/ …Material definition‟………………………6.2.2 熱傳導係數/ …Heat transfer definition‟…………6.2.3 MAGMAshakeout選項…………………………6.2.4 充填/ …filling‟………………………………6.2.5 注湯速率/ …pouring rate‟………………………6.2.6 凝固/…solidification‟……………………………6.2.7 批次生產/ …batch production‟……………………6.3 模擬的開始與控制(Simulation control)…………………6.4 錯誤訊息(Error and Warning messages)…………………7. 選項與模組7.1模組………………………………7.2 選項………………………………1介紹(Introduction)鑄造就是將金屬液倒入模穴中成形的一種生產技術,也是一種從設計到成品最快速的方法之一。

matpower中文说明

matpower中文说明
MATPOWER
一种基于 matlab 的电力系统仿真组件 版本 3.1b2 2006-9-15


Ray D. Zimmerman ,Carlos E. Murillo-Sánchez,甘德强 @1997-2006 卡奈尔大学电气学院电力系统工程研究中心(P) 一切版权属于原作者。
PDF 文件使用 "pdfFactory Pro" 试用版本创建
MATPOWER 手册(中文版)
版本 3.1b2
1
2
3
4 5
目录 绪论 .............................................................................................................................................. 3 什么是 MATPOWER? ................................................................................................... 3 它从哪里来?................................................................................................................... 3 开始 .............................................................................................................................................. 3 2.1 系统要求 .

MATpower潮流计算软件的使用

MATpower潮流计算软件的使用

MATpower软件的使用一、MATpower软件的使用方法在MATLAB软件中的命令窗口输入runpf(‘程序名’)就可以通过MATpower已经编好的程序计算潮流,而函数runpf的参数是相应需计算潮流的数据文件。

数据文件主要用来定义和返回一下四个变量。

1、baseMVA baseMVA是一个标量,用来设置基准容量。

对于计算中采用有名值,可以根据实际情况设置,如设置100MV A;对于计算中采用标幺值,一般设置为12、bus bus变量是一个矩阵,用来设置电网中各节点参数,该矩阵内的参数如下:%% bus data%bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin其中,第1列参数即bus_i用来设置母线编号,范围为1~29997;第2列参数type用来设置母线类型,1为PQ节点,2为PV节点,3为平衡节点;第3列参数Pd用来设置母线注入负荷的有功功率;第4列参数Qd用来设置母线注入负荷的无功功率;第5列参数Gs用来设置与母线并联的电导;第6列参数Bs用来设置与母线并联的电纳;第7列参数area用来设置电网断面号,可设置范围为1~100,一般设置为1;第8列参数Vm用来设置母线电压的幅值初值;第9列参数Va用来设置母线电压的相角初值;第10列参数baseKV用来设置该母线的基准电压;第11列参数zone用来设置省耗分区号,可设置范围为1~999,一般设置为1;第12列参数Vmax用来设置工作时母线电压最高幅值;第13列参数Vmin用来设置工作时母线电压最低幅值。

3、gen gen变量是一个矩阵,用来设置接入电网的发电机参数,该矩阵的参数如下:%% generator data%bus Pg Qg Qmax Qmin Vg mBase status Pmax Pmin 其中,第1列参数bus用来设置接入发电机的母线编号;第2列参数Pg用来设置接入发电机的有功功率,注意功率输入的是有名值;第3列参数Qg用来设置接入发电机的无功功率;第4列参数Qmax用来设置接入发电机的无功功率的最大允许值;第5列参数Qmin用来设置接入发电机的无功功率的最小允许值;第6列Vg用来设置接入发电机的工作电压,注意输入的是标幺值;第7列mBase用来设置接入发电机的功率基准;第8列status用来设置发电机的工作状态,1表示投入运行,2表示投出运行;第9列Pmax用来设置接入发电机的无功功率的最大允许值;第10列参数Pmin用来设置接入发电机的无功功率的最小允许值。

MATpower潮流计算使用总结

MATpower潮流计算使用总结

Matpower学习总结和优化本人所编写的程序一、Matpower用法总结(潮流计算)应用Matpower计算潮流技巧的核心在于输入好三个矩阵和部分参数,清晰的知道输入参数、矩阵中每一个元素的含义。

下列以case(‘5’)为例子说明:↓参数一%% MATPOWER Case Format : Version 2mpc.version = '2';解释:目前普遍采用2 形式的算法。

↓参数二%% system MVA basempc.baseMVA = 100;解释:采用有铭值mpc.baseMVA = 100;(Matpower只能计算有铭值得网络)↓矩阵一%% bus data% bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin 解释:bus data母线参数也就是我们所说的节点参数,下面逐条注释:1 bus number (positive integer) :第一列表示节点的编号(括号里面注释正整数);2 bus type :第二列表示节点的类型,一般只用得到1、2、3三种节点类型,4类型的节点目前没有接触到;PQ bus = 1PV bus = 2reference bus = 3isolated bus = 43 Pd, real power demand (MW):表示负荷所需要的有功功率(所有数据都是正数);(有铭值)4 Qd, reactive power dema nd (MV Ar):表示负荷所需要的无功功率(所有数据都是正数);(有铭值)5 Gs, shunt conductance:表示和节点并联的电导,非线路上的电导,一般该列为0;6 Bs, shunt susceptance:表示和节点并联的电纳,非线路上的电纳,一般该列为0;7 area number, (positive integer) :表示母线的断面号,一般设置为1;8 Vm, voltage magnitude (p.u.) :表示该节点电压的初始幅值(设置成标幺值);9 Va, voltage angle (degrees) :表示该节点电压的初始相位角度;10 baseKV, base voltage (kV) :表示该节点的基准电压;(有铭值)11 zone, loss zone (positive integer) :表示母线的省损耗区域,一般设置为1;12 maxVm, maximum voltage magnitude (p.u.) :该节点所能接受的最大电压;(标幺值)13 minVm, minimum voltage magnitude (p.u.) :该节点所能接受的最小电压;(标幺值)↓矩阵二%% generator data% bus Pg Qg Qmax Qmin Vg mBase status Pmax Pmin Pc1 Pc2Qc1min Qc1max Qc2min Qc2max ramp_agc ramp_10 ramp_30 ramp_q apf解释:表示发电机参数,下面逐条解释:1 bus number :发电机节点的编号;2 Pg, real power output (MW) :发电机节点输出的有功,如果为平衡节点则设置为0;(有铭值)3 Qg, reactive power output (MVAr):发电机节点输出无功,如果为平衡节点则设置为0;(有铭值)4 Qmax, maximum reactive power output (MVAr):该节点能接受输出最大无功功率;(有铭值)5 Qmin, minimum reactive power output (MVAr) :该节点能接受输出最大有功功率;(有铭值)6 Vg, voltage magnitude setpoint (p.u.):该节点电压的标幺值;7 mBase, total MVA base of this machine, defaults to baseMVA:该发电机的容量(有铭值);8 status, > 0 - machine in service<= 0 - machine out of service :表示发电机的运行状态,1表示投入,0表示否9 Pmax, maximum real power output (MW) :允许输出的最大有功功率;(有铭值)10 Pmin, minimum real power output (MW) :允许输出的最大无功功率;(有铭值)11 Pc1, lower real power output of PQ capability curve (MW)12 Pc2, upper real power output of PQ capability curve (MW)13 Qc1min, minimum reactive power output at Pc1 (MVAr)14 Qc1max, maximum reactive power output at Pc1 (MVAr)15 Qc2min, minimum reactive power output at Pc2 (MVAr)16 Qc2max, maximum reactive power output at Pc2 (MVAr)17 ramp rate for load following/AGC (MW/min)18 ramp rate for 10 minute reserves (MW)19 ramp rate for 30 minute reserves (MW)20 ramp rate for reactive power (2 sec timescale) (MVAr/min)21 APF, area participation factor注释:红色区域参数均设置为0;矩阵%% branch data% fbus tbus r x b rateA rateB rateC ratio angle status angmin angmax解释支路参数,下面逐条解释:1 f, from bus number:支路首端号;;2 t, to bus number:支路末端号;3 r, resistance (p.u.) :支路电阻的标幺值;4 x, reactance (p.u.) :支路电抗的标幺值;5 b, total line charging susceptance (p.u.) :支路电纳的标幺值(注意:是整条支路的电纳值);6 rateA, MV A rating A (long term rating) :长距离输电支路所允许的容量(有铭值);7 rateB, MV A rating B (short term rating) :短距离输电支路所允许的容量(有铭值);8 rateC, MV A rating C (emergency rating):紧急输电支路所允许的容量(有铭值);9 ratio, transformer off nominal turns ratio ( = 0 for lines )(taps at 'from' bus, impedance at 'to' bus, i.e. if r = x = 0, then ratio = Vf / Vt) :支路变比,不含变压器设置为0;含有变压器变比为支路首端电压和末端电压之比:Matpower中变压器的模型,如下图所示:K*:1Z首端末端10 angle, transformer phase shift angle (degrees), positive => delay:该参数设置为0;11 initial branch status, 1 - in service, 0 - out of service :该支路是否投入运行;12 minimum angle difference, angle(Vf) - angle(Vt) (degrees):该支路所允许最小相位角度13 maximum angle difference, angle(Vf) - angle(Vt) (degrees):该支路所允许最大相位角度二、Matpower潮流计算结果和本人编写程序计算结果对比展示↓各节点电压和相角图一matpower计算得出的结果图二本人程序计算得出的结果对比图一和图二可知,两种计算方法得出的节点电压和相位角度一致。

(完整)MATpower潮流计算使用总结,推荐文档

(完整)MATpower潮流计算使用总结,推荐文档

Matpower学习总结和优化本人所编写的程序一、Matpower用法总结(潮流计算)应用Matpower计算潮流技巧的核心在于输入好三个矩阵和部分参数,清晰的知道输入参数、矩阵中每一个元素的含义。

下列以case(‘5’)为例子说明:↓参数一%% MATPOWER Case Format : Version 2mpc.version = '2';解释:目前普遍采用2 形式的算法。

↓参数二%% system MVA basempc.baseMVA = 100;解释:采用有铭值mpc.baseMVA = 100;(Matpower只能计算有铭值得网络)↓矩阵一%% bus data% bus_i type Pd Qd Gs Bs area Vm Va baseKV zone Vmax Vmin 解释:bus data母线参数也就是我们所说的节点参数,下面逐条注释:1 bus number (positive integer) :第一列表示节点的编号(括号里面注释正整数);2 bus type :第二列表示节点的类型,一般只用得到1、2、3三种节点类型,4类型的节点目前没有接触到;PQ bus = 1PV bus = 2reference bus = 3isolated bus = 43 Pd, real power demand (MW):表示负荷所需要的有功功率(所有数据都是正数);(有铭值)4 Qd, reactive power dema nd (MV Ar):表示负荷所需要的无功功率(所有数据都是正数);(有铭值)5 Gs, shunt conductance:表示和节点并联的电导,非线路上的电导,一般该列为0;6 Bs, shunt susceptance:表示和节点并联的电纳,非线路上的电纳,一般该列为0;7 area number, (positive integer) :表示母线的断面号,一般设置为1;8 Vm, voltage magnitude (p.u.) :表示该节点电压的初始幅值(设置成标幺值);9 Va, voltage angle (degrees) :表示该节点电压的初始相位角度;10 baseKV, base voltage (kV) :表示该节点的基准电压;(有铭值)11 zone, loss zone (positive integer) :表示母线的省损耗区域,一般设置为1;12 maxVm, maximum voltage magnitude (p.u.) :该节点所能接受的最大电压;(标幺值)13 minVm, minimum voltage magnitude (p.u.) :该节点所能接受的最小电压;(标幺值)↓矩阵二%% generator data% bus Pg Qg Qmax Qmin Vg mBase status Pmax Pmin Pc1 Pc2Qc1min Qc1max Qc2min Qc2max ramp_agc ramp_10 ramp_30 ramp_q apf解释:表示发电机参数,下面逐条解释:1 bus number :发电机节点的编号;2 Pg, real power output (MW) :发电机节点输出的有功,如果为平衡节点则设置为0;(有铭值)3 Qg, reactive power output (MVAr):发电机节点输出无功,如果为平衡节点则设置为0;(有铭值)4 Qmax, maximum reactive power output (MVAr):该节点能接受输出最大无功功率;(有铭值)5 Qmin, minimum reactive power output (MVAr) :该节点能接受输出最大有功功率;(有铭值)6 Vg, voltage magnitude setpoint (p.u.):该节点电压的标幺值;7 mBase, total MVA base of this machine, defaults to baseMVA:该发电机的容量(有铭值);8 status, > 0 - machine in service<= 0 - machine out of service :表示发电机的运行状态,1表示投入,0表示否9 Pmax, maximum real power output (MW) :允许输出的最大有功功率;(有铭值)10 Pmin, minimum real power output (MW) :允许输出的最大无功功率;(有铭值)11 Pc1, lower real power output of PQ capability curve (MW)12 Pc2, upper real power output of PQ capability curve (MW)13 Qc1min, minimum reactive power output at Pc1 (MVAr)14 Qc1max, maximum reactive power output at Pc1 (MVAr)15 Qc2min, minimum reactive power output at Pc2 (MVAr)16 Qc2max, maximum reactive power output at Pc2 (MVAr)17 ramp rate for load following/AGC (MW/min)18 ramp rate for 10 minute reserves (MW)19 ramp rate for 30 minute reserves (MW)20 ramp rate for reactive power (2 sec timescale) (MVAr/min)21 APF, area participation factor注释:红色区域参数均设置为0;矩阵%% branch data% fbus tbus r x b rateA rateB rateC ratio angle status angmin angmax解释支路参数,下面逐条解释:1 f, from bus number:支路首端号;;2 t, to bus number:支路末端号;3 r, resistance (p.u.) :支路电阻的标幺值;4 x, reactance (p.u.) :支路电抗的标幺值;5 b, total line charging susceptance (p.u.) :支路电纳的标幺值(注意:是整条支路的电纳值);6 rateA, MV A rating A (long term rating) :长距离输电支路所允许的容量(有铭值);7 rateB, MV A rating B (short term rating) :短距离输电支路所允许的容量(有铭值);8 rateC, MV A rating C (emergency rating):紧急输电支路所允许的容量(有铭值);9 ratio, transformer off nominal turns ratio ( = 0 for lines )(taps at 'from' bus, impedance at 'to' bus, i.e. if r = x = 0, then ratio = Vf / Vt) :支路变比,不含变压器设置为0;含有变压器变比为支路首端电压和末端电压之比:Matpower中变压器的模型,如下图所示:K*:1Z首端末端10 angle, transformer phase shift angle (degrees), positive => delay:该参数设置为0;11 initial branch status, 1 - in service, 0 - out of service :该支路是否投入运行;12 minimum angle difference, angle(Vf) - angle(Vt) (degrees):该支路所允许最小相位角度13 maximum angle difference, angle(Vf) - angle(Vt) (degrees):该支路所允许最大相位角度二、Matpower潮流计算结果和本人编写程序计算结果对比展示↓各节点电压和相角图一matpower计算得出的结果图二本人程序计算得出的结果对比图一和图二可知,两种计算方法得出的节点电压和相位角度一致。

电力系统潮流计算软件MatPower

电力系统潮流计算软件MatPower
12东南大学成贤学院毕业论文各种opf算法的通用文件opfformm返回提供opf算法规则的代码opfslvrm返回提供opf算法解法的代码opfm高层算法opf解的程序poly2pwlm生成用对多项式成本的分段线性逼近的函数pqcostm将机组成本矩阵gencost分为用功和无功成本totcostm对指定的调度情况计算所有的成本仅由直流opf使用的文件dcopfm执行直流最优潮流计算仅由传统opf所使用的文件基于constr和lp的opffgnamesm返回函数的名字和给定算法的斜率funccvm对ccv规则计算目标函数和约束funstdm对标准规则计算目标函数和约束gradccvm计算ccv规则下目标函数和约束的斜率gradstdm计算标准规则下目标函数和约束的斜率opfsolnm用opf的解来根新数据矩阵tauctionm测试extrassmartmarket中的auctionmtautioncasemtauction的测试案例tautionfmincopfm基于fmincon的对extrassmartmarket中的auctionm的测试tbeginm开始一个测试集合tcase9opfmopf测试的案例文件版本1的格式tcase9opfv2mopf测试的案例文件版本2的格式tcase9pfm潮流计算测试的案例文件版本1的格式tcase9pfv2m潮流计算测试的案例文件版本2的格式tendm停止一个测试集合并且输出数值thaspqcapm测试haspqcapmtism测试两个矩阵是否在一定的范围内是一样的tjacobianm对偏导进行数值测试tloadcasem测试loadcasemtmakeptdfm测试makeptdfmtoff2casem测试off2casemtokm测试一个表达式是否为真topfm测试opf解法tpfm测试潮流计算解法truntestsm运行一系列测试的框架trunmarketm测试runmarketmtskipm跳过指定的测试testmatpowerm运行所有的可运行的matpower测试13东南大学成贤学院毕业论文第三章电力系统潮流计算31潮流计算的定义和应用作为研究电力系统稳态运行情况的一种基本电气计算潮流计算的任务是根据给定的运行条件和网路结构来确定整个系统的运行状态比如各母线上的电压幅值及相角网络中的功率分布以及功率损耗等

matpover使用手册

matpover使用手册

matpover使用手册摘要:1.Matplotlib 介绍2.Matplotlib 安装与使用3.Matplotlib 的基本绘图函数4.Matplotlib 的进阶功能5.Matplotlib 的常见问题与解决方案正文:Matplotlib 是一个用于创建高质量图形的Python 绘图库。

它可以生成各种硬拷贝图形,如折线图、散点图、柱状图、直方图等,也可以生成多种软拷贝图形,如SVG、PDF 等。

Matplotlib 具有丰富的自定义选项,可以满足各种绘图需求。

首先,我们需要安装Matplotlib。

可以使用pip 进行安装,命令为:pip install matplotlib。

安装完成后,可以在Python 代码中使用Matplotlib。

Matplotlib 的基本绘图函数包括plot、scatter、bar 等。

以plot 函数为例,其基本语法为:plot(x, y, format_string, **kwargs)。

其中,x 和y 是必需参数,分别表示x 轴和y 轴的数据;format_string 是可选参数,用于指定线条样式、颜色和标记;**kwargs 是可选参数,用于指定其他属性。

例如,我们可以使用以下代码绘制一条折线图:```pythonimport matplotlib.pyplot as pltx = [1, 2, 3, 4, 5]y = [2, 4, 6, 8, 10]plt.plot(x, y, "r-", label="Line 1")plt.xlabel("X-axis")plt.ylabel("Y-axis")plt.title("Line chart")plt.legend()plt.show()```Matplotlib 还具有进阶功能,如绘制多子图、使用颜色映射、添加注解等。

相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
MATPOWER
一种基于 matlab 的电力系统仿真组件 版本 3.1b2 2006-9-15


Ray D. Zimmerman ,Carlos E. Murillo-Sánchez,甘德强 @1997-2006 卡奈尔大学电气学院电力系统工程研究中心(PSERC)
中文翻译制作:中国电力市场论坛() 一切版权属于原作者。
它从哪里来?
MATPOWER 是 由 卡 奈 尔 大 学 电 气 学 院 电 力 系 统 工 程 研 究 中 心 的 RAY D. ZIMMENRman,CARLOS E.Murillo 和甘德强在 ROBERT THOMAS 的指导下开发出来的。 最初的基于 MATLAB 的电力潮流和最优潮流代码是为 POWERWEB 项目的需要而编写的。 谁能够使用它? ·MATPOWER 是完全免费的,任何人都可以使用。 ·我们对 MATPOWER 的代码和作为特殊用途的可行性不作任何保障,授权与暗示。 · 任 何 使 用 MATPOWER 的 出 版 物 都 必 须 标 注 MATPOWER /matpower/。 ·任何出于某种需要而对 MATLAB 进行的修改必须在适当的位置保留初始版权标志。 ·MATPOWER 在没有书面许可的情况下不宜私自发布与转让。 · MATPOWER 改进版或源于 MATPOWER 的成果在没有书面许可的情况下不能私自转让或 发布。
PDF 文件使用 "pdfFactory Pro" 试用版本创建
MATPOWER 手册(中文版)
版本 3.1b2
1
2
3
4 5
目录 绪论 .............................................................................................................................................. 3 什么是 MATPOWER? ................................................................................................... 3 它从哪里来?................................................................................................................... 3 开始 .............................................................................................................................................. 3 2.1 系统要求 ........................................................................................................................... 3 2.2 安装 ................................................................................................................................... 4 2.3 执行电力常规潮流运算.................................................................................................... 4 2.4 执行最优潮流程序............................................................................................................ 4 2.5 获得帮助 ........................................................................................................................... 4 技术规则 ...................................................................................................................................... 5 3.1 数据文件格式.................................................................................................................... 5 3.2 模型 ................................................................................................................................... 8 交流模型(AC) ............................................................................................................. 8 直流公式(DC) ............................................................................................................. 9 3.3 电力潮流 ......................................................................................................................... 10 3.4 最优潮流 ......................................................................................................................... 10 传统的交流 OPF 方程 ................................................................................................... 12 基于最优化工具箱的 OPF 解法(constr) .................................................................. 13 基于线性规划的 OPF 解法(LPconstr) ..................................................................... 14 3.4.2 广义交流最优潮流解法............................................................................................... 16 通用线性约束(一般线性约束) ................................................................................. 17 通用成本函数................................................................................................................. 18 通用 P-Q 容量曲线...................................................................................................... 19 可调度负荷..................................................................................................................... 20 支路相角差限制............................................................................................................. 22 问题数据转换................................................................................................................. 22 附加线性约束的例子..................................................................................................... 23 3.4.3 直流 OPF 方法 ............................................................................................................. 23 机组组合算法................................................................................................................. 24 3.6 MATPOWER 选项 ........................................................................................................... 24 3.7 文件汇总 ......................................................................................................................... 27 致谢 ............................................................................................................................................ 31 参考文献 .................................................................................................................................... 31
相关文档
最新文档