I am trying to implement Harmonic Balance on a simple diode circuit in Matlab from scratch. I am facing issues with the matrix formation and calculation the Jacobian. Is there anyone who has implemented this before? Is there any resource online for this?