Summation in if-loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Summation in if-loop
Hi
I want to create a loop that for the next interval add the results in the previous interval etc. I have made an attempt in the following program, but something is wrong. Any help is appreciated.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Maybe this is what you are looking for:
Because a "return" statement stops a program from running any further, you can also write
Prime 9 file attached
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Not really, I want the diagram to look like this (Excel).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
f(0) = 0
f(4,5) = 0 + 4,5x9 = 40,5
f(8,3) = f(4,5) + (8,3 - 4,5) x 7 = 67,1
f(11,3) = f(8,3) + (11,3 - 8,3) x 8 = 91,1 etc...
Hopefully you understand what I'm looking for 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You are demanding now something different compared to your initial posting.
There your wrote " that for the next interval add the results in the previous interval etc." (and your function attempt also showed additios) and now you obviously want to subtract somehow?
In your program you wrote b <-- gamma2*z + a and NOT b <-- gamma2*(z - 4.5 m) + a
Maybe you can get more clear about what you actually need!
So far I guess that this could be what you are looking for:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Or you may use a more generic approach
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you, that's what I was looking for! 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Very nice, I like that generic approach! That will be useful for me in the future, thank you!
I have a further query associated to that. The above example describes the vertical stress of a porous material saturated in water. It is common that a part of the material in above water and the other part of the material is submerged in water. Let's assume that the depth to water d=1 m and the weight above that level is 16 kN/m3 (for example). Below that water level (1 m) the conditions are as previously stated. How can I incoorporate that into your generic approach?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am not sure if I fully understand your new question.
Doesn't it just mean that you have to add 16 on top of the "gamma" vector and -1 on top of the "limits" vector?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Nevermind, I found a way to solve it 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Or, if you're using Express and can't program
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Werner's formula is precise and well done!
But this is really a simple integration, Attached Prime 4 Express.
(Extension to the second problem, above the water) will require definition of sign conventions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
But this is really a simple integration,
😉 Its only simple once you found a way to automatically choose the correct gamma-value for every depth, like you did with
