Boolean condition and diff issues

Boolean condition and diff issues - Сообщения

#1 Опубликовано: 11.04.2023 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 КиБ) скачан 60 раз(а).

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 Опубликовано: 11.04.2023 09:06:47
⚜ Kenny Lemens, P.E. ᵂᴵ

⚜ Kenny Lemens, P.E. ᵂᴵ

74 сообщений из 164 понравились пользователям.

Группа: 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 Опубликовано: 11.04.2023 09:44:34
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

How do you perform such calculation ?


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

Pierre.PNG

#4 Опубликовано: 11.04.2023 09:53:17
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

... Smath document.

Pierre.sm (7 КиБ) скачан 55 раз(а).
#5 Опубликовано: 11.04.2023 10:01:35
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: User

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

diff-issue.sm (25 КиБ) скачан 67 раз(а).

Best regards
Alvaro.
#6 Опубликовано: 11.04.2023 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 КиБ) скачан 51 раз(а).
Regards,

Pierre
#7 Опубликовано: 11.04.2023 12:11:44
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: 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 Опубликовано: 11.04.2023 13:12:19
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: 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 Опубликовано: 11.04.2023 18:41:37
overlord

overlord

554 сообщений из 1333 понравились пользователям.

Группа: 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 Опубликовано: 11.04.2023 19:47:54
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: 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 КиБ) скачан 47 раз(а).

Best regards.
Alvaro
#11 Опубликовано: 12.04.2023 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 КиБ) скачан 51 раз(а).

Thanks for you attention to all

Regards,

Pierre
1 пользователям понравился этот пост
Alvaro Diaz Falconi 12.04.2023 23:39:00
#12 Опубликовано: 13.04.2023 00:25:27
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: 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 КиБ) скачан 53 раз(а).

Best regards.
Alvaro.
#13 Опубликовано: 13.04.2023 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 КиБ) скачан 53 раз(а).

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

Regards,

Pierre
#14 Опубликовано: 13.04.2023 10:40:14
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

heaviside_late_assignment Bolean.sm (22 КиБ) скачан 47 раз(а).
#15 Опубликовано: 13.04.2023 10:56:46
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1675 понравились пользователям.

Группа: 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 КиБ) скачан 59 раз(а).

Best regards.
Alvaro.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений