import math
import numpy
#initialisation of variables
load1=complex(10,15) #load per phase(MVA)
SCC=250.0/3
V=11/math.sqrt(3)
P=30
Q=45
Z=(11/math.sqrt(3))**2.0/(250.0/3) #Equivalent short circuit impedence
#Calculations
dsc=math.degrees(math.atan(5))
R=.0949
X=.4746
#Using equation: V**2= (Vcosd+PR/V)**2 + (Vsind+QX/V)**2, we get
y=numpy.polynomial.polynomial.polyval3d(51.7,0,-27.5,1)
X=numpy.roots(y)
V=5.046
print("V=%.3f" %V)
dV=6.35-V
Ssc=250
#using expression ,a=dV/v=1(Pcos(dsc)+Qsin(dsc))/Ssc +j(Psin(dsc)-Qcos(dsc))/Ssc
a=(P*math.cos(math.radians(dsc))+Q*math.sin(math.radians(dsc)))/Ssc +complex(P*math.sin(math.radians(dsc))-Q*math.cos(math.radians(dsc)))/Ssc
#Results
print("dV/V= %.2f " %abs(a))