-
Notifications
You must be signed in to change notification settings - Fork 70
Conversation
Created main function and constrain functions. Minimizer is still to be implemented.
The evaluation of forces and moments suggests a change in the aircraft model.
* A new function was introduced in cessna_310 to get total forces & moments. * Minor corrections in cessna_310. * Only trimming main function is still to be implemented. TESTS ARE PENDING.
…RIGHT SOLUTION * Added example: trim_example_001.py. * Another minimization algorithm should be tried... this one in converginf to another solution. Maybe is a good idea to choose one that accepts constrains (ie. delta_t <= 1).
Parece que en este primer intento estoy teniendo algunos problemas para converger a la solución buena. De momento sé que no es la buena porque no consigo hacer las derivadas d(u, v, w, p, q, r) / dt = 0. Voy a explorar dos vías diferentes (creo que ambas necesarias):
|
…nal perturbations
Bueno, os cuento el estado de esto. He añadido el trimador que parece que funciona razonablemente bien y varios ejemplos que incluyen el uso del trimador y la integración a lo largo del tiempo de varias situaciones de vuelo. Por el camino he tocado varias cosas...:
Me falta además terminar la documentación del trimador. La termino y cambio la etiqueta a 3 - Needs Review. Si corréis los ejemplos veréis que hay resultados que aún habrá que revisar, pero que "grosso modo" se puede ver que esto empieza a funcionar. Son también un ejemplo de cómo se usa el simulador ahora mismo. Intentad correr casos vosotros también porque además de encontrar fallos (yo ya me he encontrado problemas cuando psi pasa a valores negativos) podremos encontrar la manera de hacer el uso más fácil. |
En cuanto a los tests quitando un par de funciones dentro del trimador que ahora testearé, el resto es difícilmente testeable: incluye dependencias de un montón de cosas... ecuaciones, avión. Básicamente hay un par de condiciones para que el trimado esté bien hecho:
|
results[0, 0:6] = u, v, w, p, q, r | ||
results[0, 6:9] = theta, phi, psi | ||
results[0, 9:12] = x, y, z | ||
results[0, 0:3] = lin_vel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I find this unpacking a bit cumbersome, but I admit that we can improve it when we use a more object oriented approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was one of the things I wanted you to see just in case you had any other suggestion before the OO approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative would be to return a too large number of variables I guess, so I have no other suggestion.
lin_vel = wind2body((TAS, 0, 0), alpha, beta) | ||
|
||
print('') | ||
print('Results:') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps summarize this with a long, triple-quoted string
I reviewed this from an style point of view, perhaps @JuanMatSa wants to study the algorithm itself. Some documentation issues can be sorted out when I finish #46. |
Ups, he hecho toda la review en inglés 😅 |
Gracias @Juanlu001! voy a echar un ojo |
from pyfme.models.euler_flat_earth import linear_and_angular_momentum_eqs | ||
dynamic_eqs = linear_and_angular_momentum_eqs | ||
|
||
# TODO: try to look for a good inizialization method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuanMatSa This is one of the things that is still pending: a good initialization. Maybe there is some kind of simplified analytical approach to the problem
Marchandoooooooooo |
Estoy en proceso... leyendo un poco sobre el asunto y pensando en la mejor manera de hacerlo. Por ejemplo, ya hemos visto varias veces que el vector de estado dependerá del sistema que estemos utilizando. Hacer algo que funcione para esto es asequible. Pero estoy dándole una vuelta a cómo habría que dejarlo más adelante.
De momento he incluido alguna función auxiliar que va a ir haciendo falta. El punto clave de esto es el algoritmo que minimiza la función. Voy a intentar tirar de SciPy para hacerlo (mejor que andar implementando un algoritmo propio). Me estoy guiando por: Stevens, BL and Lewis, FL, "Aircraft Control and Simulation", Wiley-lnterscience. Section 3.4. Hay también información en el Anexo B.
En el libro vienen datos con los que validar el timmer, pero es para un F-16. El modelo de avión está hecho en subrutinas de Fortran 70 en el Anexo A y la descripción del modelo aerodinámico en la sección 2.3. La verdad es que estaría chulo implementarlo pero es una tarea gorda que igual requiere de un par de personas trabajando en ello. ¿Qué os parece, @AeroPython/pyfme ? Si nadie se pone, con el tiempo me pondré a ello.