fsolve stopped because the last step was ineffective
Mostrar comentarios más antiguos
Hello, I'm hoping someone can please help me with the below. I'm trying to generate some values for a1, a2 and a3, represented by 'angles'. However the solution is giving me some bizarre values. The code is definitely correct as it is provided from my course, and my values for VDC, V1, V3 and V5 are automatically generated from an external source. Though I don't understand a way to get around this as MATLAB is saying there is no solution.
%% SETTINGS (THE FOLLOWING VALUES SHOULD BE SET TO THE VALUES OBTAINED FROM THE EXCEL FILE)
% First Part
VDC=5.53; % DC-LINK VOLTAGE
V1=2.596; % THE FIRST HARMONIC OF THE OUTPUT VOLTAGE
V3=0; % THE THIRD HARMONIC OF THE OUTPUT VOLTAGE
V5=0.488; % THE FIFTH HARMONIC OF THE OUTPUT VOLTAGE
% Define the nonlinear equations for the angles
f = @(x) [
(4/(pi))*VDC*(sin(x(1))-sin(x(2))+sin(x(3)))-V1;
(4/(3*pi))*VDC*(sin(3*x(1))-sin(3*x(2))+sin(3*x(3)))-V3;
(4/(5*pi))*VDC*(sin(5*x(1))-sin(5*x(2))+sin(5*x(3)))-V5];
% Solve for angles using fsolve
angles = fsolve(f,[pi/6, pi/6, pi/6])
angles = rad2deg(angles)
Then the solution is returns is as follows:
>> finding_alpha_angles
No solution found.
fsolve stopped because the last step was ineffective. However, the vector of function
values is not near zero, as measured by the value of the function tolerance.
<stopping criteria details>
angles =
0.1707 0.1707 0.1707
angles =
9.7817 9.7817 9.7817
Any help is greatly appreciated. Thank you.
Respuesta aceptada
Más respuestas (1)
VBBV
el 23 de Abr. de 2024
Movida: Bruno Luong
el 23 de Abr. de 2024
The problem seems to occur if you have the same initial conditions for all the angles. Try giving different initial conditions/values instead of same value . E,g,
angles = fsolve(f,[pi, pi/6, pi/3])
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!