You are on page 1of 1

Algorithm for switching angle calculation using Newton- Raphson method

Step1: start
Step 2: define harmonic equation functions
f1(S1,S2,S3,S4)=0
f2(S1,S2,S3,S4)=0
f3(S1,S2,S3,S4)=0
f4(S1,S2,S3,S4)=0
Step 3: assume initial guess for switching angles S10, S20, S30, S40
Step 4: define error e=1e-5
Harmonics metrix H=[0 0 0 0 ]T
Step 5: define switching angle matrix S=[ S1 S2 S3 S4]T
Step 6: assign S[1] =S1 , S[2] =S2 , S[3] =S3 S[4] =S4
Step 7: calculate and evaluate jacobian matrix at S0
J=Df(S0)
Step 8: evaluate harmonic equations at S0
A=f(S0)

Step 9: calculate correction angles ΔS=inv(J)*(H-A)

Step 10: assign S =S+ ΔS

Step 11: check if |f(s)|< e and S1 <S2 <S3 <S4< π/2


If true
goto step 12
Else
Step 6
Step 12: end

You might also like