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

Update exampleKcl.ts #2264

Closed
wants to merge 1 commit into from
Closed

Update exampleKcl.ts #2264

wants to merge 1 commit into from

Conversation

iterion
Copy link
Contributor

@iterion iterion commented Apr 26, 2024

@jgomez720 I recently went through onboarding again and noticed we duplicated some constants where we could just reuse the variable instead. I think my moment calculation is still correct, but wanted to get your thoughts and see if we can reuse any more.

@iterion iterion requested a review from jgomez720 April 26, 2024 12:16
Copy link

vercel bot commented Apr 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Apr 26, 2024 0:25am

Copy link
Contributor

src/lib/exampleKcl.ts has been updated in this PR, please review and update the src/routes/onboarding, if needed.

@@ -5,7 +5,7 @@ const sigmaAllow = 35000 // psi
const width = 6 // inch
const p = 300 // Force on shelf - lbs
const distance = 12 // inches
const M = 12 * 300 / 2 // Moment experienced at fixed end of bracket
const M = distance * p / 2 // Moment experienced at fixed end of bracket
const FOS = 2 // Factor of safety of 2
const shelfMountL = 8 // The length of the bracket holding up the shelf is 6 inches
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I stared at this more and now I'm realizing now that distance isn't related at all to shelfMountL or wallMountL. Just thinking through the problem, it would make sense to me the moment experienced at the end of the bracket would be related to those and not necessarily distance?
Also, why do we divide moment by 2? Is this just because we were originally assuming the distance of each arm of the bracket was 1/2 of the original distance of 12?

So, maybe it should be const M = shelfMountL * p?

Copy link
Collaborator

@jgomez720 jgomez720 Apr 29, 2024

Choose a reason for hiding this comment

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

Looking back at this, I don't like some of the variable names I chose.

We are dividing by two because there are two brackets holding up the shelf (assumed at equal distance apart from the load).
distance in this example is supposed to be the shelf length from the wall. I'm going to add this picture to the onboarding to make it more clear and update the code to follow. This is what it should be:

Screenshot 2024-04-29 at 8 03 00 AM
const sigmaAllow = 35000 // psi
const w = 6 // width of the bracket - in
const p = 300 // Force on shelf - lbs
const L = 12 // Length of the shelf from the wall - in
const M = L * p / 2 // Moment experienced at fixed end of bracket. Divided by 2 since there are 2 brackets holding up the shelf.
const FOS = 2 // Factor of safety
const shelfMountL = 8 // The length of the bracket holding up the shelf - in
const wallMountL = 6 // the length of the bracket mounted on the wall - in

// Calculate the thickness off the allowable bending stress and factor of safety
const t = sqrt(6 * M * FOS / (w * sigmaAllow))

Calculating the bending stress, we have
$$\sigma = \frac{M*c}{I} FOS$$

where

$$M = \frac{p L}{2}$$

$$c = \frac{t}{2}$$

$$I = \frac{1}{12} w t^3$$

plugging those in and simplifying:

$$\sigma = \frac{6 F L}{w t^2} FOS$$

so

$$ t = \sqrt{\frac{6 p L}{w \sigma} FOS} $$

I'm going to update the onboarding code and make it clearer. Thanks for bringing this up @iterion!

@jgomez720
Copy link
Collaborator

I updated the onboarding here
#2269

Let me know if this makes more sense

@iterion
Copy link
Contributor Author

iterion commented Apr 29, 2024

Thanks so much, for the improvements!

@iterion iterion closed this Apr 29, 2024
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.

2 participants