I am not supposed to get complex values but unfortunatley something is wrong in my eigenvalue caclultions. When plotting I get the error: (which I shouldn't be getting technically)
Warning: Imaginary parts of complex X and/or Y arguments ignored.
The part where the complex value show is in this specific line. However, everything above is a +ve number or value so I don't see how it turns complex:
Bx = q(4,:)./r; By = q(5,:)./r;
CA1 = sqrt((Bx.^2+By.^2)./(r*mu0));
CAx1 = sqrt((Bx.^2)./(r*mu0));
I posted the entire code as well, main code is "MUSCLEULER_Test"