@Amay Jain. yes i am aware of it, but problem is, i have to write a program every time i need to calculate. it a bit tricky to make it generalized for N number of steps and Switching angles and N harmonics.
The program need not to be written every time, taking n (order of harmonics)from user, the already written code (once) may be executed and returning the firing angle for eliminating the particular harmonic..
Implementing Selective Harmonic Elimination for n angles in Matlab should not be a problem. You can use fsolve as the solver and relations between the number of levels and angles and the symmetry to generalize it. However, the problem with SHE is that sometimes the solution does not exist.
The solution to this issue is the relatively newer Selective Harmonic Mitigation technique in which the harmonics are forced to get below the limits set by the grid codes. You can almost always find a solution using genetic or gradient-based optimization algorithms. All these algos are already implemented in Matlab. You just have to adapt and define your objective and constraints functions.
i have tried fsolve, problem is when it comes to generalize it. when there is increase in the number of equations, for example i have only 3 equations for some requirement. but next time i need 10 equations all these new 10 equations has to to defined.
is there any way that i just enter the number of equations i have and number of switching angles to be generated, MI and harmonics. i get the angles.