-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
fixed force sign #246
fixed force sign #246
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #246 +/- ##
===========================================
- Coverage 55.48% 17.01% -38.48%
===========================================
Files 48 48
Lines 1642 1646 +4
===========================================
- Hits 911 280 -631
- Misses 731 1366 +635 ☔ View full report in Codecov by Sentry. |
Even if this is a fix of the convention, it's obviously a massively breaking change for anyone that has implemented a model using the changed components and made it work with the opposite convention. If we merge this, we'd have to bump the major version |
Agreed. Is there a way to tag this for a major version change? |
Changing the version is done by modifying the version specification in |
I can't trigger the registration bot for MSL. While here, should we have a |
MTK is already master to v9. We can make master here be set for now the new major, and do the v9 update as part of that. |
@baggepinnen can you help me with the analysis points failure? This doesn't seem to be related to the change. |
The test passes locally for me. The analysis point code hasn't been touched in several months, it might be a change related to SymbolicIndexInterface that has broken the test? |
The latest integration test for MTKstdlib that is run as part of the test suite of MTK passed, so it's probably no related to the indexing |
It looks like there has been a small numerical change to some solver, the test passes if I change
to
|
Actually scratch that, if I call
so it might be that something has changed in how this array type is compared to normal arrays
|
Thanks @baggepinnen ! I'll integrate the change. |
Closing because this sign convention is actually not uniform across Electrical, Mechanical, etc. And is the opposite of the Modelica standard. Opening a new PR with the correct sign convention. |
The correct force sign convention was not implemented properly. The convention should be, using the mass component for example, to draw the port orientation and the component orientations, then variables that are in opposite direction should have a negative sign. For the mass component, if the movement is from left to right, then the force will push back from right to left, which is in opposite direction of the port orientation.
This convention is now applied throughout the Mechanical/Translational library.
As a quick proof, we can define a
ConstantForce
andMass
component. We would expect connecting the 2, if a positive force is given, the mass should increase in velocity, and vice versa. The output of the system below, implementing this sign convention, gives:As can be seen, a positive input force
force₊f
will result in a positive increase in velocitymass₊v
Proof System: