Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline EngMath  
#1 Posted : 13 April 2021 13:59:05(UTC)
EngMath


Rank: Advanced Member

Groups: Registered
Joined: 18/10/2020(UTC)
Posts: 50
Poland

Hi,

I am working on a shaft torsion problem in SMath and I came accross 2 issues. The first one is related to the use of sum(4). I'm trying to sum l_1, l_2 and l_3. As you can see, sum(1) works fine but I wonder why sum(4) gives error (l_j is not defined):



I'm quite surprised that it doesn't work because I've found a similar example in "SMath Suite: A Primer" document:



Second issue is that I can't find out how to make a torque diagram. First I tried the way it's done in MathCAD (the example I'm working on here is from a book about MathCAD):



Then I tried with piecewise function and again something is wrong (the image below features also reference diagram from a book):



Of course M_s1, M_s2 and M_s3 are calculated first but I also tried with their values inside the if function and still didn't get any plot.

Here's the sm file: Torsion.sm (106kb) downloaded 8 time(s).

Thanks in advance for your help.

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline mkraska  
#2 Posted : 13 April 2021 16:17:08(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,988
Germany

Was thanked: 1124 time(s) in 721 post(s)
The first problem is because you used text index instead of element index in the sum. This is visible by the added space between variable and index for element indices.

This feature is discussed in the getting started guide, which has a polish version by the way thanks to Ihor Rokach.

A convenient way to define piecewise continuous functions is the cases() function in combination with the ternary logical operators ltlt() or lele() defined in the Custom functions plugin by Davide Carpi.

In the ternary operators I should have added brackets for better readibility or better: define x1...x3 in advance.

Torsion_kr.png
Torsion_kr.sm (106kb) downloaded 10 time(s).
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 30/05/2021(UTC)
Offline PompelmoTell  
#3 Posted : 13 April 2021 16:21:36(UTC)
PompelmoTell


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2011(UTC)
Posts: 319
Man
Italy
Location: italy

Was thanked: 109 time(s) in 93 post(s)
be careful to:
-subscript (which you get with the .) and vector index (which you get with [) are very different
- range is used to create a vector and not a range of values
- for diagrams the units of measurement must be managed

torsion_S.sm (105kb) downloaded 12 time(s).

sergio
thanks 1 user thanked PompelmoTell for this useful post.
on 30/05/2021(UTC)
Offline Jean Giraud  
#4 Posted : 13 April 2021 16:28:47(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Numerical subscript are inefficient and most confusing [your first red].
l as variable name is even more confusing ... l => λ

Shaft.PNG
Offline EngMath  
#5 Posted : 13 April 2021 16:52:40(UTC)
EngMath


Rank: Advanced Member

Groups: Registered
Joined: 18/10/2020(UTC)
Posts: 50
Poland

Thank you very much for your help.

Originally Posted by: mkraska Go to Quoted Post


Torsion_kr.png
Torsion_kr.sm (106kb) downloaded 10 time(s).


How can I type this part in equation system bracket (or is it a different type of curly bracket) ? It doesn't let me type if (or anything else) after M_s1.

Originally Posted by: PompelmoTell Go to Quoted Post
be careful to:
-subscript (which you get with the .) and vector index (which you get with [) are very different
- range is used to create a vector and not a range of values
- for diagrams the units of measurement must be managed

torsion_S.sm (105kb) downloaded 12 time(s).

sergio


I see that you fixed the first formulation used for the plot. But what changes were made to the second one (M(x)=|y=if ...) ? I can't see any difference and yet it generates a plot, unlike in my file (even after adding units under the plot like you did).



When it comes to l, this variable stands for length, that's why I don't use lambda.

Offline Ber7  
#6 Posted : 13 April 2021 17:17:07(UTC)
Ber7


Rank: Advanced Member

Groups: Registered
Joined: 15/07/2010(UTC)
Posts: 437
Man
Israel
Location: Beer-Sheva

Was thanked: 520 time(s) in 288 post(s)
It is better to designate the length with a capital letter" L", so as not to confuse it with a"1"
Offline mkraska  
#7 Posted : 13 April 2021 17:20:40(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,988
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: EngMath Go to Quoted Post
Thank you very much for your help.

How can I type this part in equation system bracket (or is it a different type of curly bracket) ? It doesn't let me type if (or anything else) after M_s1.



This instruction is from the interactive handbook, accessible via extension manager.

cases.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 13/04/2021(UTC)
Offline Jean Giraud  
#8 Posted : 13 April 2021 17:21:29(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: EngMath Go to Quoted Post
When it comes to l, this variable stands for length, that's why I don't use lambda.

No comment ... here is your plot.

Torsion (Doctored plot).sm (117kb) downloaded 5 time(s).
Offline Jean Giraud  
#9 Posted : 13 April 2021 17:36:40(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
... bar plot added

Torsion (Doctored plot).sm (121kb) downloaded 18 time(s).
Offline Jean Giraud  
#10 Posted : 14 April 2021 16:40:59(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
... easy to bar plot. Respective scale not done.
If you want ... will attach.

Torsion.PNG
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.