Filter löschen
Filter löschen

How can I solve the error "unable to convert to matrix form because the system does not seem to be linear"

16 Ansichten (letzte 30 Tage)
I have 19 equations and 19 variables. I am trying to use equations to matrix to solve it, yet I get the error:
Unable to convert to matrix form because the system does not seem to be linear.
T = eng.feval_internal('symobj::equationsToMatrix',eqns,vars);
Some of the variables in my equations are squared, for example:
eqn15=(ayAB)+((0.275.*sind(th)).*((OAP).^2))-((0.15.*cosd(th2)).*(al_AB))-((0.15.*sind(th2)).*((AB).^2))==0;
Are those squares the mistake? How could I solve a system of non-linear equations if necessary?

Antworten (1)

I CHUN LIN
I CHUN LIN am 8 Mai 2023
Verschoben: Matt J am 9 Mai 2023
You can not use matrix if the system is non-linear, maybe try fsolve or vpasolve.
The two-variables system example:
fun = @root2d;
x0 = [0,0];
x = fsolve(fun,x0)
function F = root2d(x)
F(1) = exp(-exp(-(x(1)+x(2)))) - x(2)*(1+x(1)^2);
F(2) = x(1)*cos(x(2)) + x(2)*sin(x(1)) - 0.5;
end

Kategorien

Mehr zu Systems of Nonlinear Equations finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by