Skip to content

Static Force Analysis service and its UI #309

Merged
ekim39 merged 39 commits into
mainfrom
Static-Force-Analysis-UI-and-Service-Integration-Branch
Apr 18, 2026
Merged

Static Force Analysis service and its UI #309
ekim39 merged 39 commits into
mainfrom
Static-Force-Analysis-UI-and-Service-Integration-Branch

Conversation

@tlnguyen2009
Copy link
Copy Markdown
Contributor

In this pull request, we merged the Static Force Analysis logic (from branch static-equilibrium-position-analysis-(static-kinematic-solver)) and its UI design (from branch Forces-Analysis-Panel).

tlnguyen2009 and others added 30 commits November 19, 2025 12:24
This version:
+ Analyze the reaction forces at each joint in a sub-mechanism.
+ Show direction of Torque at Input Joint
+ API for front-end allows user to choose Reaction Force direction and Torque direction.
+ Add gravitational convention for mass
+ Apply matrix to get all unknown reaction forces and torque
This fix allows us to set a mass for the link now
…ting moments

+ The user can choose the pivot for calculating the moment. If the user doesn't choose any, it will be set to "Center of Mass" by default.
Fixed the dual side-by-side form and link-edit-panel to allow user to edit the mass and center-of-mass
Make the Link object save new center of mass coordinates when user edit it.
The starting points for the forces now remain fixed during the animation. The issue was caused by the previous version of the code using "storedAngle" instead of "finalAngle", which represents the updated angle during the linkage animation.
If we custom center of mass (COM) after we create a force for a link, the force position will be sliding back and ford. The reason is the custom COM is not defined when Force class and Link class was built in the past.

In this fix:
+ Added logic to find COM in different frame of animation using circle technique.
+ Made Force objects in the Link update every time we have custome COM
Adding an error tolerance when using the circle intersection technique to calculate the next positions of mechanisms.
…on Frames

Even though this version is finished, it's still a draft and has not been tested yet. I push it to Github just to save my work.

In general, this version will export data for static analysis of all Reaction Forces and Torque at all animation frames (all positions of the mechanism when it moves on a 2D planar)
+ Deleted some functions that are not used anymore.
+ Added some more header comments for better explanation.
- analyzeIfNeeded(...): call this once every time when the component created. It will automatically check if we need to recalculate again.

- getAnalysisResultAtFrame(...): Use this from the front-end to retrieve data.
…solver)' into Static-Force-Analysis-UI-and-Service-Integration-Branch
…vice-Integration-Branch' into Static-Force-Analysis-UI-and-Service-Integration-Branch
+ When the user hit the drop-down panel "Data Summary", it will trigger re-calculate static force analysis if needed.

+ save torque data from the static-analysis service in a variable in this front-end component to minimize the call to the service.
+ Use debounceTime() to prevent continuously re-calculation if the user move a joint/link non-stop. It will just start calculating when the user releases the mouse for around 300ms
+ Use debounceTime(300) to prevent re-calculation immediately when the user is moving/changing the mechanism. It starts calculating when the user releases their mouse for 300ms.
…pon creation

addForce() in link.ts calls newForce.updateAfterMovement() immediately after adding. This is unnecessary at t=0 (the force is already positioned correctly from the constructor) and causes the start setter's boundToLink() to potentially snap the position. So we should remove "newForce.updateAfterMovement();" in addForce()
calculatePositionInLink() stores the absolute angle but updateAfterMovement() adds parentAngle one more time, causing double-counting the initial orientation.
+ The current COM in analysis-solver.service is not correct, a new solution added using Circles Intersection Technique for finding/ tracking COM of each link in a sub-mechanism.
…ction forces from back-end for front-end usage
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2026

Deploy Preview for steady-macaron-f82663 ready!

Name Link
🔨 Latest commit 114db2f
🔍 Latest deploy log https://app.netlify.com/projects/steady-macaron-f82663/deploys/69e3be9b682a200008177067
😎 Deploy Preview https://deploy-preview-309--steady-macaron-f82663.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 8, 2026

Deploy Preview for pmks failed.

Name Link
🔨 Latest commit 114db2f
🔍 Latest deploy log https://app.netlify.com/projects/pmks/deploys/69e3be9b22f55f0008ff635f

@tlnguyen2009 tlnguyen2009 requested a review from rkprad April 8, 2026 21:26
Copy link
Copy Markdown
Contributor

@rkprad rkprad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved

@ekim39 ekim39 merged commit 9bee1d7 into main Apr 18, 2026
5 of 10 checks passed
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.

4 participants