Boolean condition and diff issues

Boolean condition and diff issues - 消息

#1 已发布: 2023/4/11 05:56:35
pierre

pierre

2个赞,共17个帖子。

组: 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.92 KiB)已下载 1392 次。

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 已发布: 2023/4/11 09:06:47
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

85个赞,共181个帖子。

组: 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 已发布: 2023/4/11 09:44:34
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

Wrote

How do you perform such calculation ?


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

Pierre.PNG

#4 已发布: 2023/4/11 09:53:17
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

... Smath document.

Pierre.sm (7.86 KiB)已下载 1390 次。
#5 已发布: 2023/4/11 10:01:35
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: User

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

diff-issue.sm (25.8 KiB)已下载 1393 次。

Best regards
Alvaro.
#6 已发布: 2023/4/11 11:13:57
pierre

pierre

2个赞,共17个帖子。

组: 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.14 KiB)已下载 1408 次。
Regards,

Pierre
#7 已发布: 2023/4/11 12:11:44
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: 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 已发布: 2023/4/11 13:12:19
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: 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 已发布: 2023/4/11 18:41:37
overlord

overlord

600个赞,共1,381个帖子。

组: 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 已发布: 2023/4/11 19:47:54
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: 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.5 KiB)已下载 1426 次。

Best regards.
Alvaro
#11 已发布: 2023/4/12 04:53:58
pierre

pierre

2个赞,共17个帖子。

组: 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.46 KiB)已下载 1387 次。

Thanks for you attention to all

Regards,

Pierre
1位用户喜欢此帖子
Alvaro 2023/4/12 23:39:00
#12 已发布: 2023/4/13 00:25:27
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: 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.11 KiB)已下载 1424 次。

Best regards.
Alvaro.
#13 已发布: 2023/4/13 04:39:12
pierre

pierre

2个赞,共17个帖子。

组: User

Thanks Alvaro for all your explanations,



I have found a little workaround with late assignment.

heaviside_late_assignment.sm (9.12 KiB)已下载 1416 次。

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

Regards,

Pierre
#14 已发布: 2023/4/13 10:40:14
Jean Giraud

Jean Giraud

983个赞,共6,866个帖子。

组: User

heaviside_late_assignment Bolean.sm (22.92 KiB)已下载 1443 次。
#15 已发布: 2023/4/13 10:56:46
Alvaro

Alvaro

1,139个赞,共1,805个帖子。

组: 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.7 KiB)已下载 1378 次。

Best regards.
Alvaro.
  • 有新帖
  • 无新帖