Skip to content
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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

HuaweiWang
Copy link

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.

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
@moorepants
Copy link
Member

@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?

@tvdbogert
Copy link
Member

@moorepants: is it a good idea to test this with the vyasarayani2011.py in the examples folder?

@HuaweiWang
Copy link
Author

I only know a little bit unit test stuff. Yes I just thinking about use vyasarayani's example too

@HuaweiWang
Copy link
Author

I would like to learn and have a try in unit tests, how about we use vyasarayani's example ? @moorepants

@moorepants
Copy link
Member

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
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.
Copy link
Member

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
@@ -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,
Copy link
Member

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!
@HuaweiWang
Copy link
Author

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.
@moorepants
Copy link
Member

@HuaweiWang What's the status on this? Have you gotten the method to work?

@HuaweiWang
Copy link
Author

Hi,

I am still in Unit Testing right now. As I will take Qualify Exam in August
8th, I have few time working with the codes.

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]
wrote:

@HuaweiWang https://github.com/HuaweiWang What's the status on this?
Have you gotten the method to work?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#40 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AQIxaQKrxRhDwtGB6RsUkRbm95-ny6aJks5qVRFlgaJpZM4Iic_U
.

@moorepants
Copy link
Member

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.
Actually go back to previous codes, which were not changed by me.
Same to direct_collocation.py. Go back
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants