-
Notifications
You must be signed in to change notification settings - Fork 20
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
Huawei wang homotopy direct collocation #40
base: master
Are you sure you want to change the base?
Huawei wang homotopy direct collocation #40
Conversation
Add the of extra term of homotopy method into direct collocation codes. Only added into midpoint integration method right now.
Added extra term of homotopy method into codes but only added into "midpoint" method right now.
Some tinny error adjust
@HuaweiWang Do you know what unit tests are? It will be good to write some unit tests first for the code additions. The unit tests will codify the expected behavior. You can see some examples of the tests I've already written for basic examples in the tests directory. Do you have a simple problem we could use for a test, like solving the pendulum parameter id problem with homotopy? |
@moorepants: is it a good idea to test this with the vyasarayani2011.py in the examples folder? |
I only know a little bit unit test stuff. Yes I just thinking about use vyasarayani's example too |
I would like to learn and have a try in unit tests, how about we use vyasarayani's example ? @moorepants |
Yes, we can use that example to build out a test. That's basically what I've already done for the current tests. |
1. Changed Lambda Typing error. 2. Added parameter K to adjust the dynamic of extra term
opty/direct_collocation.py
Outdated
the equations of motion not provided in this dictionary will | ||
become free trajectories optimization variables. | ||
Lamda: float | ||
A parameter in homotopy method that controls the change of motion equations. |
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.
We should be careful with the name of this. lambda
is a reserved word in python, it is a built in function. And sympy has Lambda
which is a symbolic version of the Python lambda
and creates a symbolic function. Maybe a variable name like homotopy_control
or something similar is better.
Make the homotopy method more general in direct collocation.py Adjust some error according Jason's comments
opty/direct_collocation.py
Outdated
@@ -137,6 +137,7 @@ class ConstraintCollocator(object): | |||
def __init__(self, equations_of_motion, state_symbols, | |||
num_collocation_nodes, node_time_interval, | |||
known_parameter_map={}, known_trajectory_map={}, | |||
homotopy_control, tracing_dynamic_control, |
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.
Please make these as keyword arguments with defaults settings: homotopy=0
, tracing=1
.
1. reverse homotopy in direct collocation according Jason's comments: make homotopy_control and tracing_dynamic_control the keyword arguments, but didn't set the default value yet. 2. reverse the definition of k_matrix to make it a diagram matrix with k in the diagram line. 3. added the homotopy test cases in unit test. Only changed a few test case at the beginning. Update to see the correctness of the codes
1. Make homotopy_control and tracing_dynamic_control the keyword arguments. But the default values are not defined yet. 2. Changed definition of k_matrix. 3. Added and changed some test cases in unit test. This update is only to see whether the codes and methods are correct or not, changes in unit test are not complete yet.
1. reverse homotopy in direct collocation according Jason's comments: make homotopy_control and tracing_dynamic_control the keyword arguments, but didn't set the default value yet. 2. reverse the definition of k_matrix to make it a diagram matrix with k in the diagram line.
1. Added and changed some test cases in unit test. This file is updating to see whether the added test cases' methods are correct. Not all the test cases are changed completely.
Wrong update before, delete it now!
Wrong update before, delete it now!
This pull request is only for methods testing added in unit tests. It is not a final version. So there is no need to look at it @moorepants @tvdbogert |
Correct errors in previous unit testing codes according to test faults information. Still testing codes, not the final version.
@HuaweiWang What's the status on this? Have you gotten the method to work? |
Hi, I am still in Unit Testing right now. As I will take Qualify Exam in August Hopefully I could pass the Qualify Exam and put more effort into the codes. Will let you know If I have some progression. Bests, Huawei On Wed, Jul 13, 2016 at 12:25 PM, Jason K. Moore [email protected]
|
Ok, sounds good. Good luck on your quals! |
This file add tracking part into original model's dynamic equations to form homotopy dynamics, which could use in continuation method optimization. The functions in this file were tested in Human Standing Control Identification problem, results showed that these functions work well.
Added the extra term of homotopy method into direct collocation codes.
But only added into "midpoint" integration method right now, as I am not very clear about the codes of "back euler" integration method.
Please check whether I am doing wrong, and give me some comments if possible.