-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmodel.src
64 lines (25 loc) · 1.27 KB
/
model.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
model:=proc(X)
global n_gen,m_pv,s_pq,f1,f2;
n_gen:=1:
m_pv:=2:
s_pq:=2:
f1:=array(1..5,1..1):
f2:=array(1..2,1..1):
f1[1,1]:=((((e[1]*(e[1]*g[1,1]))+(((b[1,2]*e[1])*(e[2]*sin((0-th[1]))))+((cos((0-th[1]))*e[2])*
(e[1]*g[1,2]))))+(((b[1,5]*e[1])*(e[5]*sin((0-th[4]))))+((cos((0-th[4]))*e[5])*(e[1]*
g[1,5]))))-p[1]):
f1[2,1]:=((((((b[2,1]*e[2])*(e[1]*sin(th[1])))+((cos(th[1])*e[1])*(e[2]*g[2,1])))+(e[2]*(e[2]*g[2,2])))+
(((b[2,3]*e[2])*(e[3]*sin((th[1]-th[2]))))+((cos((th[1]-th[2]))*e[3])*(e[2]*g[2,3]))))-p[2]):
f1[3,1]:=((((((b[3,2]*e[3])*(e[2]*sin((th[2]-th[1]))))+((cos((th[2]-th[1]))*e[2])*(e[3]*g[3,2])))+(e[3]*
(e[3]*g[3,3])))+(((b[3,4]*e[3])*(e[4]*sin((th[2]-th[3]))))+((cos((th[2]-th[3]))*e[4])*(e[3]*
g[3,4]))))-p[3]):
f1[4,1]:=(((((b[4,3]*e[4])*(e[3]*sin((th[3]-th[2]))))+((cos((th[3]-th[2]))*e[3])*(e[4]*g[4,3])))+(e[4]*
(e[4]*g[4,4])))-p[4]):
f2[1,1]:=(((((g[4,3]*e[4])*(e[3]*sin((th[3]-th[2]))))-((cos((th[3]-th[2]))*e[3])*(e[4]*b[4,3])))+(0-
(e[4]*(e[4]*b[4,4]))))-q[4]):
f1[5,1]:=(((((b[5,1]*e[5])*(e[1]*sin(th[4])))+((cos(th[4])*e[1])*(e[5]*g[5,1])))+(e[5]*(e[5]*g[5,5])))-
p[5]):
f2[2,1]:=(((((g[5,1]*e[5])*(e[1]*sin(th[4])))-((cos(th[4])*e[1])*(e[5]*b[5,1])))+(0-(e[5]*(e[5]*
b[5,5]))))-q[5]):
RETURN(1)
end: