Boolean condition and diff issues

Boolean condition and diff issues - Mensajes

#1 Publicado: 11/4/2023 5:56:35
pierre

pierre

2 me gusta en 17 mensajes.

Grupo: 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) descargado 1370 vez(es).

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

⚜ Kenny Lemens, P.E. ᵂᴵ

85 me gusta en 181 mensajes.

Grupo: 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 Publicado: 11/4/2023 9:44:34
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

Wrote

How do you perform such calculation ?


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

Pierre.PNG

#4 Publicado: 11/4/2023 9:53:17
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

... Smath document.

Pierre.sm (7,86 KiB) descargado 1375 vez(es).
#5 Publicado: 11/4/2023 10:01:35
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: User

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

diff-issue.sm (25,8 KiB) descargado 1377 vez(es).

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

pierre

2 me gusta en 17 mensajes.

Grupo: 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) descargado 1400 vez(es).
Regards,

Pierre
#7 Publicado: 11/4/2023 12:11:44
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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 Publicado: 11/4/2023 13:12:19
Jean Giraud

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: 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 Publicado: 11/4/2023 18:41:37
overlord

overlord

600 me gusta en 1.381 mensajes.

Grupo: 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 Publicado: 11/4/2023 19:47:54
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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) descargado 1408 vez(es).

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

pierre

2 me gusta en 17 mensajes.

Grupo: 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) descargado 1364 vez(es).

Thanks for you attention to all

Regards,

Pierre
A 1 usuarios les gustó este mensaje
Alvaro 12/4/2023 23:39:00
#12 Publicado: 13/4/2023 0:25:27
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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) descargado 1409 vez(es).

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

pierre

2 me gusta en 17 mensajes.

Grupo: User

Thanks Alvaro for all your explanations,



I have found a little workaround with late assignment.

heaviside_late_assignment.sm (9,12 KiB) descargado 1405 vez(es).

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

Regards,

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

Jean Giraud

983 me gusta en 6.866 mensajes.

Grupo: User

heaviside_late_assignment Bolean.sm (22,92 KiB) descargado 1425 vez(es).
#15 Publicado: 13/4/2023 10:56:46
Alvaro

Alvaro

1.139 me gusta en 1.805 mensajes.

Grupo: 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) descargado 1361 vez(es).

Best regards.
Alvaro.
  • Nuevos mensajes
  • Sin mensajes nuevos