- 7
- 0
- 约1.27万字
- 约 39页
- 2017-07-24 发布于河南
- 举报
c编写潮流上机程序(Cwritingflowprogram)
c++编写潮流上机程序(C++ writing flow program)
# includes stdio.h
# includes math.h
# includes stdlib.h
# define m 矩阵阶数 100 / * * /
# define n 100 迭代次数 / * * /
int i, j, k, a, b, c; / * 循环控制变量 * /
int t, l, g 中间变量; / * * /
int n; / * 节点数 * /
m, 支路数 / * * /
fp, pq节点数 / * * /
minutes, pv节点数 / * * /
duidi 对地支路数; / * * /
double 精度 eps; / * * /
double aa [m], bb [m], cc [m], dd [m], max, time, rr, 中间变量); / * * /
double mo, c1, d1, c2, d2, 复数运算函数的返回值 jiao; / * * /
double g [m] [m], b [m] [m], y [m] [m]; / * 节点导纳矩阵中的实部、虚部及其模方值 * /
double ykb [m] [m], d [m], du [m]; / * 雅克比矩阵、不平衡量矩阵 * /
struct 节点结构体 jd / * * /
(int num, d; / * num为节点号, s为节点类型 * /
double p, q, s, e, f, u, zkj, dp, dq, du, de, df; / * 节点有功、无功功率, 功率模值, 电压纵、横分量, 电压模值, 阻抗角
牛顿 - 拉夫逊中功率不平衡量、电压不平衡量 * /
} jd [m].
struct 支路结构体 zhl / * * /
{int numb numb为支路号; / * * /
int p1, p2 支路的两个节点; / * * /
double r, x; / * 支路的电阻与电抗 * /
} zhl [m].
fp1 file *, * fp2;
void date (读取数据) / * * /
{
int h, number;
fp1 = fopen (input.txt, r); if (fp1 = = null)
{
printf (can not open file! \ n );
exit (0);
}
fscanf (fp1, % d% d% d% d% d% lf \ n, n m, fp minutes, duidi, eps); / * 输入节点数, 支路数, pq节点数, pv节点数和精度 * /
j = 1; k = pq + 1;
for (i = 1, the = n; i + +) / * 输入节点编号、类型、输入功率和电压初值 * /
{
fscanf (fp1, % d% d number h).
if (a = = 1 = 1是pq节点 类型h) / * * /
{
fscanf (fp1, %%%, if, if, if, if i% n, jd jd.p [j], [j].q, jd. jd [j], [j].f);
jd = [j].num number;
jd [j].s = h;
j + +;
}
if (a = = 2) = 2是pv节点 类型h / * * /
{
fscanf (fp1, %% lf, lf i n, jd jd.p [k], [k].u);
jd = [k].num number;
jd.s [k] = h;
jd.q [k] = 0;
c + +;
}
if (a = = 3) = 3是平衡节点 类型h / * * /
{
fscanf (fp1, %% lf, lf i n, jd. jd [n], [n].f);
jd = [n].num number;
jd.s [n] = h;
}
}
for (i = 1; i = m; i + +) 输入支路阻抗 / * * /
fscanf (fp1 % d% d% d%,%, lf, lf i n [i], zhl.numb, zhl [i] [i].p1, zhl.p2, zhl [i] [i].r, zhl.x);
fclose (fp1);
if ((fp2 = fopen (output.txt, w)) = = null)
{
printf (can not open file! i n );
exit (0);
}
fprintf (fp2 潮流上机实习 on n, n );
fprintf (fp2, 班
您可能关注的文档
- fpga ddr2读写控制器时序代码(FPGA DDR2 read and write controller timing code).doc
- fp机械轴承hhe(FP mechanical bearing HHE).doc
- from 天涯 今天在食堂遇到了高手...(From Tianya meets a superior in the cafeteria today...).doc
- frontpage网页制作作业题目(Frontpage web page production exercises).doc
- frontpage 新增14道题(Frontpage added 14 questions).doc
- fttb+lan宽带小区的几种布线设计方法(Several routing design methods for fttb+lan broadband cell).doc
- frountpage(frountpage).doc
- ft社评普京的赌博(FT editorial Putin gamble).doc
- freeglut安装(freeglut安装).doc
- fttblan宽带小区的几种布线设计方法(Several routing design methods for fttblan broadband cell).doc
- c++读取文件(C++ reads the file).doc
- cad2004快捷键(CAD2004 shortcut key).doc
- cad制造特效字体(CAD makes special effects fonts).doc
- cad必看安装说明(CAD must see the installation instructions).doc
- cad自学网笔记(CAD self-study network notes).doc
- cad牛人的经验(CAD's experience).doc
- cad设置样板的步骤(CAD steps for setting templates).doc
- can-bus控制器局域网络总线技术,汽车光纤代替普通金属导线(CAN-bus controller, local area network bus technology, automobile optical fiber instead of ordinary metal wire).doc
- can、i2s、i2c、spi、ssp总线简介(Brief introduction of can, I2S, I2C, SPI and SSP bus).doc
- cad技术在高职市政工程技术专业毕业设计中的应用(Application of CAD technology in graduation design of Municipal Engineering Specialty in Higher Vocational Education).doc
最近下载
- 第一单元 分类与整理 单元过关试题(含答案)小学数学人教版(2024)二年级上册.docx VIP
- 舰艇官兵常见疾病.pptx
- 商丘职业技术学院地下水源热泵空调项目水资源论证报告书(可编辑).doc VIP
- 康力电梯D10D626电气原理图(扫描件).pdf VIP
- 最新REACH-SVHC清单205最新REACH清单包括CAS号.pdf VIP
- GB50174-2008电子信息系统机房设计规范.docx VIP
- 万科龙华二线拓展区5号地块研判报告.pdf VIP
- (正式版)DB31∕T 1660-2025 《数据中心基础设施建设指南》.pdf VIP
- 自身免疫病的相关抗体检测.ppt VIP
- 合资合同备忘录范本.docx VIP
原创力文档

文档评论(0)