Boolean condition and diff issues

Boolean condition and diff issues - Messages

#1 Posted: 4/11/2023 5:56:35 AM
pierre

pierre

2 likes in 17 posts.

Group: User

Hello everybody,

I have issues regarding diff function and boolean function.
I have been looking on different solution on the forum, but i have not found a related post.
How do you perform such calculation?

diff-issue.sm (19 KiB) downloaded 59 time(s).

I mainly use Smath for simple calculation, and such boolean conditions, are used for Moment / shear load diagram etc...
(ps: I am not looking for a 10 digit precision, this is structural engineering )


You will find in attachment a spreadsheet detailing the different test performed.

Thank you,

Regards,

Pierre
#2 Posted: 4/11/2023 9:06:47 AM
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

74 likes in 164 posts.

Group: User

Greetings,

To obtain an answer, you are going to have to keep the boolean test out of your diff. equation.

Your equation would look similar to the following:
SMath_DiffBool.jpg

As a tangent to your question, you may want to explore the following forum Topics (beam equation related):
  • https://en.smath.com/forum/yaf_postst23343_Frame-and-Beam-analysis-with-Moment-distribution-method.aspx
  • https://en.smath.com/forum/yaf_postst23264_FEBeam.aspx
  • https://en.smath.com/forum/yaf_postsm10143_Beam-calculation.aspx#post10143



May this be of Good Help;
- Kenny Lemens, P.E. ᵂᴵ
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
#3 Posted: 4/11/2023 9:44:34 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Wrote

How do you perform such calculation ?


That's my understanding ?
Cheers ... Jean.

Pierre.PNG

#4 Posted: 4/11/2023 9:53:17 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

... Smath document.

Pierre.sm (7 KiB) downloaded 53 time(s).
#5 Posted: 4/11/2023 10:01:35 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

Hi. If you use maple, maybe this could help.

diff-issue.sm (25 KiB) downloaded 65 time(s).

Best regards
Alvaro.
#6 Posted: 4/11/2023 11:13:57 AM
pierre

pierre

2 likes in 17 posts.

Group: User

Thank you all for your answer,

@Kenny Lemens,

If needed i will do this solution, or find a way to automatise this step, as it cas be quite cumbersome to implement.
I will take a closer look to you links, to see if i find answer to this.

@Jean Giraud

I have to admit, you may show me the moon, but i dont even get the finger
I believe, i was unclear on my question, and i will elaborate by providing my spreadsheet

@Razonar
I was quite exited when i saw your answer.
However, i am not sur i use heaviside correctly.
It seems that the condition disapears after derivation.

You can see on the plot, that the calculation of both M and V are OK once the last heaviside condition is satified.

Do you have any idea on how to solve?
I dont mind using my actual methodology, but i would like to progress with smath


e7_5_3-hs.sm (135 KiB) downloaded 49 time(s).
Regards,

Pierre
#7 Posted: 4/11/2023 12:11:44 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

Wrote

... It seems that the condition disapears after derivation.



Hi. You're using Heaviside from Statical Tools plugin. I forgot it, because I don't use it, It define Heaviside(x,y) as (1+sign(x-y))/2, which could be cool for numerical procedures, but the derivative of maple of sign(x) is zero, but diff Heaviside(x) /dx is Dirac(x). So, the file that I upload works very different with that plugin. There are also other posts in this forum about Heaviside, Dirac and civil engineering. Maxima have their own implementation of those functions too.

Best regards.
Alvaro.
#8 Posted: 4/11/2023 1:12:19 PM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

Your latest document is much different than your original.
The golden rule is to specify Bolean completely.
Sometimes it's immaterial ... One exception is DeBoor.

PierreOtherwise.PNG
#9 Posted: 4/11/2023 6:41:37 PM
overlord

overlord

554 likes in 1333 posts.

Group: Moderator

Wrote

Hello everybody,

I have issues regarding diff function and boolean function.
I have been looking on different solution on the forum, but i have not found a related post.
How do you perform such calculation?


diff() function can't parse if original function has boolean expression.
Once derivative is completed result can be booleaned. (is this even a proper word )
Here how it is.

Regards

2023-04-12_00-39.png
#10 Posted: 4/11/2023 7:47:54 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

Wrote

...
Do you have any idea on how to solve?



Yes. Use maple(diff(convert(M(x),Heaviside),x)) for convert SMath sign function into Maple Heaviside's. It looks ok now:

Clipboard01.png

e7_5_3-hs ok.sm (139 KiB) downloaded 45 time(s).

Best regards.
Alvaro
#11 Posted: 4/12/2023 4:53:58 AM
pierre

pierre

2 likes in 17 posts.

Group: User

Dear alvaro

The evaluation at 2m (ie:78in) is higher than the higher boolean/heaviside condition, therefore the result is always ok.
In My comuter the graph of shear (V) clearly showes an difference between V and V.hs below 45inch, is it similar for you?


Wrote



Yes. Use maple(diff(convert(M(x),Heaviside),x)) for convert SMath sign function into Maple Heaviside's. It looks ok now:

Best regards.
Alvaro



I am getting quite a nice result with the following function

hs(x,y):1/2+1/π*atan(10^10*(x-y)/UnitsOf(y))

It is quite a quick solution, easy to diff and integrate,
however to get all solution from solve, i need to limit the interval.

e7_5_3-hs-tan.sm (128 KiB) downloaded 49 time(s).

Thanks for you attention to all

Regards,

Pierre
1 users liked this post
Alvaro Diaz Falconi 4/12/2023 11:39:00 PM
#12 Posted: 4/13/2023 12:25:27 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

Wrote

Dear alvaro

The evaluation at 2m (ie:78in) is higher than the higher boolean/heaviside condition, therefore the result is always ok.
In My comuter the graph of shear (V) clearly showes an difference between V and V.hs below 45inch, is it similar for you?



Hi. Yes, but I just don't pay attention to the "small values" at inches, just see that both are the same at meters. Some notes about Heaviside in the attached.

notes.sm (11 KiB) downloaded 49 time(s).

Best regards.
Alvaro.
#13 Posted: 4/13/2023 4:39:12 AM
pierre

pierre

2 likes in 17 posts.

Group: User

Thanks Alvaro for all your explanations,



I have found a little workaround with late assignment.

heaviside_late_assignment.sm (9 KiB) downloaded 52 time(s).

I think it will be faster/cleaner once implemented than the atan solution.

Regards,

Pierre
#14 Posted: 4/13/2023 10:40:14 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

heaviside_late_assignment Bolean.sm (22 KiB) downloaded 45 time(s).
#15 Posted: 4/13/2023 10:56:46 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 likes in 1675 posts.

Group: User

Wrote

I think it will be faster/cleaner once implemented than the atan solution.



Atan is great if you don't go to use further the function too much, like in integrations. For this other option you have this other implementation too.

heaviside_late_assignment.sm (34 KiB) downloaded 57 time(s).

Best regards.
Alvaro.
  • New Posts New Posts
  • No New Posts No New Posts