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

If the equations of motion are large finding symbols can be slow #4

Open
moorepants opened this issue Aug 29, 2024 · 1 comment
Open

Comments

@moorepants
Copy link
Member

These lines:

https://github.com/pydy/pydy/blob/master/pydy/codegen/matrix_generator.py#L53

        for matrix in matrices:
            # TODO : SymPy 0.7.4 does not have Matrix.free_symbols so we
            # manually compute them instead of calling:
            # required_args |= matrix.free_symbols
            required_args |= set().union(*[i.free_symbols for i in matrix])
            required_args |= find_dynamicsymbols(matrix)

can be very slow.

If you symbolically solve the equations of motion for a large system and then pass those equations to the matrix generator it can sit on these lines for extremely long times.

Hit this with this model: https://github.com/csu-hmc/gait2d

@moorepants
Copy link
Member Author

See: 3d1cedd

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

No branches or pull requests

1 participant