-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solving a feedback controller for a dynamical system with 16 states and 4 inputs. #21
Comments
Hi @MKamyab1991, there are a few issues here:
|
|
Thanks Ben for your response and happy new year. the full code is given in: I tried your method and again it take forever to derive the inverse By the way, you said you had solved the problem using Matlab |
Hi @MKamyab1991 I saw your post a few days ago and didn't have the chance to respond and it looks like the hastebin may have expired? From what I remember, you wrote a class method for the state equation (helicoptor model) and for the controller equation. You could put them in blocks something along the lines helicoptor_block = simupy.systems.DynamicalSystem(state_equation_function=your_model.helicoptor_state_equation, dim_state=16, dim_input=4)
controller_block = simupy.systems.DynamicalSystem(output_equation_function=your_model.controller_function, dim_state=0, dim_output=4, dim_input=16) where I can write some draft documentation and examples for the codegen and post it here for you to try before closing this. Until then, the functions you wrote in matlab (without any symbolic equation) should be pretty directly translateable to python using numpy and scipy. |
https://hastebin.com/akakususug.yaml |
I have already solved it in Matlab, But I cannot do it using simupy.
It is a 16 states dynamical system, and the controller is a sliding mode.
I tried just the system (without controller) and it worked out in simupy but I cannot add controller to it.
this is the code, the full code is given in the file:
it gives the error:
the whole part of the code is given in the link
https://hastebin.com/monoculihe.makefile
, the only part that might be the issue is the
ctrl = sp.UnevaluatedExpr(b_flapping)**-1*(-f + sdotr - kmod)
also I used sympy.Matrix for defining the terms.
does simupy works with UnevaluatedExpr? because the inverse is too hard it takes forever to calculate the inverse so I changed it to unevaluated. other than that I think the problem is with the given part of the code that I have given in the comment section. I did not quite fully understand how to work with simupy Although I saw all of your examples and documents
please help :(
The text was updated successfully, but these errors were encountered: