I am having a state-space model and I want to simulate it in order to get the "steady-state" values for my model. I am using rootfinder of CasADi, as my system is nonlinear. I have the following code:
ue = 1;
Xdt = 0.000105;
de = 1;
dt = 1;
Mde = -0.027419;
Uvel = SX.sym('Uvel');
Wvel = SX.sym('Wvel');
q = SX.sym('q');
theta = SX.sym('theta');
de = SX.sym('de');
dt = SX.sym('dt');
x = [Uvel; Wvel; q; theta];
u = [de; dt];
xdot = [((Xu)* (Uvel^3) + (Xw)*(Wvel^3) -(g)*theta + (Xdt)*dt);
((Zu)* (Uvel^3) + (Zw)*(Wvel^3) + ue*q);
((Mu)* (Uvel^3)+ (Mw)*(Wvel^3) + (Mq)*q *(Uvel^2) + (Mde)*de);
q];
f=Function ('f', {x, u}, {xdot});
s=rootfinder('s', 'newton', f);
s([10, 1, 0, 0], [10, 1])
The other parameters you see there are some constants.
So what I understood is that on the last line, I am giving some initial guess, and I am waiting as outputs the values which are the solution for the equation xdot=0.
But as a result, I get some 4 valued vector (which I suppose is the x vector solution) and I am expecting to get some values also for my second input vector, u.
Am I getting this the wrong way?
Thank you in advance. Any help is appreciated!
Regards,
Andreea Oltean