-
Notifications
You must be signed in to change notification settings - Fork 11
Linearization #37
Comments
Hello, |
what if we couldalso include the system to be linearized? I agree that maybe the system making more sense is euler flat Earth, but think about quaternions flat Earth for example. If we could choose a system it would be linked to the states and inputs. Maybe we can create some useful structs. These structs would also be useful for integration. We should also be able to choose a different system model in the simulation part. What do you think? I imagine something like:
It could return a |
Can you elaborate on systems? And dynamic_system? I Mena what kind of inputs that it will have |
Are you talking about matlab ss like function. That contains whole system in state space form |
For me, the output of the linearization could be like state-space matrix given by ss. This one would take the continuous-time nonlinear model (such as Euler flat Earth) with the aircraft and linearize the whole system around state0, controls0 |
The other day I didn't have much time to elaborate this. I don't know if I answer your question clearly enough. Thinking about it from the outside, I imagine something like this (I missed some arguments the other day) # Initialize aircraft
ac = F16()
# Initialize controls
fcs = F16FCS()
# Initialize state
pos = PositionEarth(0.0, 0.0, 0.0)
att = Attitude(0.0, 0.0, 0.0)
vel = [100.0, 0.0, 0.0]
ang_vel = [0.0, 0.0, 0.0]
accel = [0.0, 0.0, 0.0]
ang_accel = [0.0, 0.0, 0.0]
state0 = State(pos, att, vel, ang_vel, accel, ang_accel)
# Initilize environment
atm = AtmosphereISA(pos)
wind = ConstantWind(0.0, 0.0, 0.0)
grav = EarthConstantGravity()
env = Environment(atm, wind, grav)
linear_system = linearize(ac, :six_dof_euler_fixed_mass, state0, fcs, env)
# Or maybe we need a struct for the dynamic system with some information about it
linear_system = linearize(ac, SixDofEulerFixedMass, state0, fcs, env)
# Then we could do things like
get_A(linear_system)
get_B(linear_system)
get_transition_matrix(linear_system, dt) I will post now something about the internals of linearize if you need it but the main thing you have to keep in mind is that the interface to calculate aircraft forces and moments, implies FCS, AeroState, State, ... and then the interface to the dynamic system uses system (vector), forces (vector), moments (vector) .... I guess some interfaces will seem inadequate or unnatural for this purpose. Let's try to identify and improve them |
Sorry for the late reply. It was a busy day. There is another way we can define linearization using stability coefficient. This method is used in most books. What do you think about it? It would be easier to define it. |
Don't worry! I know six_dof model has forces and moments as parameters, but it is not a problem if aircraft is recalculated for each perturbation. That would be the forces and moments that need to be used as a parameter in six_dof function It would be something like: perturbate state or controls
We could also implement other linearization options of course |
Hi Alex, |
Hi @parthp08 I dind't have much time today to have a detailed look at it. I think it is a good starting point. My proposal is the following:
Do you agree on this strategy? Perhaps, it easier to review if you open a pull request with these changes. I noticed you have more changes in your master joining several files into one and so on as we talked at some point before. Maybe it is better to review those changes before / after in a separate PR. Is it ok for you? |
i made a test for coordinated turn case (page 205 in stevens book) but in book data is given in states vt, alpha and beta and we have u, v, w and i dont know how to convert in matrix. can you help with it ?
yes, that is a good approach.
i didnt open pull request because linearization is not fully tested. |
answer is matching for most other states such as p, q, r, theta and psi. just need some help with u, v and w. |
There are two options:
I think the second one may be suitable. |
can you do this? i tried but i dont think that is working. |
Sorry. I didn't have much time during the week. I will try to have a look next week. I didn't have a look yet, but I guess you are trying to introduce that inside A matrix. I think it's easier to use A to calculate a perturbed state and then convert from tas, alpha, beta to u, v, w. Do you have information to make a test like that? |
that ok, i 've been busy myself.
i think to do that we need to change use vt, alpha, beta for whole system. we can check using x_dot = A * x + B * u and then converting u_dot, v_dot, w_dot to vt_dot, alpha_dot, beta_dot. check out files i mentioned above i did that but in our case results didnt match. |
No description provided.
The text was updated successfully, but these errors were encountered: