235 integrate velocity and acceleration analyses#307
Merged
mwalsh001 merged 27 commits intoApr 14, 2026
Conversation
Fixed the logic error in calculating the slope of the linear function of the slider. Before the fix, the code was incorrectly using the slider's initial Y coordinate stored in the Joint object, instead of its Y coordinate from the previous frame. The fix was to consistently use both prevJointPosition.x and prevJointPosition.y when calculating n.
Adding more logic to allow users to enter value in degrees/radians. The function will also check and display correct values when the users switch between degree and radians in Settings.
…s (vertical) Before the fix, when the slider became vertical (angle = 90 degrees), the slider didn't move, and the coupler link was strangely animated by stretching out and in. After the fix, everything became normal as it should be. The issue was in the old code, which mistakenly used the old point coordinates instead of the current ones. In other words, when the crank moves an angle theta to a new position, we should use this new position to draw a circle analysis instead of the last position.
…tton at some position on the grid When solving for the slider's position, a quadratic equation provides two possible solutions (x1, x2). The correct solution is the one physically closest to the slider's previous position. The old code always picked x1, which caused errors when x2 was the correct solution for some position on the grid. This commit updates the logic to choose the solution (x1 or x2) nearest to the previous position.
The slider's blue path is generated from a series of connected points. A previous optimization attempted to draw this path by only using two endpoints. However, the logic to find these points was incorrectly reused from a function designed for linkages. This bug caused the slider path to render incorrectly, appearing as a "double closed loop" like the outline of a linkage instead of a single, continuous line. This commit removes the faulty optimization. The path is now drawn by connecting all of its points in sequence, which resolves the rendering bug.
…isplays in analysis graph. Only displays one link velocity at a time that is hard-coded, needs to include the velocities of the selected link.
…ntly selected link on the grid.
…a selected link. Graph only has X data and function previously checked for X and Y data being present. Error found in Velocity calculations - sign of velocities are not consistent so that needs to be fixed."
…lection is implemented to decide the direction of theta values i.e. CD or DC.
…lculate velocity.
…t correct lengths for all link shapes. To account for compound links, find the joint pair within a link with the farthest distance to calculate the angle of each link over time. Then, use the matrix solver to find the omega values. Values are slightly off due to some sign and loop order inconsistencies.
…ith side panel. Slider-crank TBD.
… into 235-integrate-velocity-and-acceleration-analyses
✅ Deploy Preview for pmks ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for steady-macaron-f82663 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…ders. Synced with global units.
…globally parsing all strings. This fixes input speeds, IDs, and angles being decoded as strings, which caused omega/acceleration calculations to become NaN as they attempted to calculate using strings not numbers.
rkprad
approved these changes
Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Angular velocity and acceleration calculations for 4-bar, 6-bar, and crank-sliders. Future work: fix side panel issues with displaying graphs and current timestep data.