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

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline faruk  
#1 Posted : 06 July 2024 00:34:03(UTC)
faruk

Rank: Newbie

Groups: Registered
Joined: 10/03/2024(UTC)
Posts: 6
Germany
Location: St

Hi all,

I am a structural engineer and I am trying to organize and centralize
calculation rules and formulas in a way that most of it is stored in a single SMATH file.

Doing this would make it easier for me to update functions if some changes are necessary.
When I need to perform some checks, I will read specific functions over "include"

The limitation that I am facing is that I am not able to find a way on how to
display the formulas that I am reading from the "central" file

In the example shown in the picture, I would like to see a complete formula definition like:

X1=y1+y2
X2=y3+y4

instead, only the right part of the formula is shown. As you can see I am using the "Clear" function and
I have set Optimization to none.

I am relatively new to SMath and I would appreciate it a lot if someone knew a way to display complete formulas or if there were some other ways how user-defined formulas can be centralized and easy to access

Thanks a lot



SMath Question.png

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

Offline ioan92  
#2 Posted : 07 July 2024 04:14:09(UTC)
ioan92


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2012(UTC)
Posts: 94
France, Metropolitan

Was thanked: 169 time(s) in 132 post(s)
Hi Faruk,

I’m structural engineer also. I already faced your dilemmas on solutions for organizing a sort of library for including a multitude of structural engineering tools. So, I will share (IMHO), here after, for any eventual utility, some aspects of my experience. Of course, I do not pretend to be always right; I wait for any critics and suggestions.

1. Firstly, in the structural engineering we use a bunch of symbols. One of the biggest qualities of SMath is to allow the use of variable’s names, written and organized as in books and standards. So, the check and the debug are highly facilitated.

2. One of the major features of SMath is that the variables are public. A same name, present in different functions is accessible in read/write operations from anywhere. Clearly, I do not deny the advantages of these features for certain uses. In order to handle this feature, when it is perceived more as an inconvenience, many users add some complementary symbols (@; # & etc.) to avoid hard controlled interferences. Also, some people use the clear() function.

3. Classical programming data scope is not comprehensible applied in SMath (!?).

4. In order to avoid some mess, I proposed to Andrey the creation of a special type of totally encapsulated function, where all the used information is introduced, for read exclusively, only through the function name definition and the results accessible in only read mode, exclusively accessed through the output line. This encapsulation has the great advantage of the free use of names allover without the risk of an out-of-control. In fact, all the native functions (sin(),tan() etc. have this behavior. Probably that the introduction of the concept of public blocks of names declaration could also be benefic.

5. The use of “include” command do not change the common use of variable’s names.

6. Some of the biggest inconveniences of the use of one huge module are hard to manipulate; slow to execute; big damages in a crash, etc.

7. A way I practiced is based on the creation of independent modules changing information by using read/write data files.

Please take my assessments in their full relativity. Really, I would be glad to profit also on some others “art of programming” with SMath. I use SMath, since many years, as it is and as it evoluated during the time, in a very profitable manner. I had not enough words to thank Andrey for his generous project.

The main feature of SMath, that I insistently point, is the full transparency of applications, in opposition with the “black box” feature of major parts of commercial codes.

The major paradox for the use of the modern informatics in the practical engineering is that the commercial programs are doing all in the name of the user who can’t accede in the details of the operations while the user himself keeps the whole and exclusive responsibility.

Best regards,
Ioan

Edited by user 09 July 2024 23:40:45(UTC)  | Reason: Not specified

Do to others as you would like them to do to you!
Knowledge is of no value unless you put it into practice - Chekhov
Offline faruk  
#3 Posted : 15 July 2024 05:12:18(UTC)
faruk

Rank: Newbie

Groups: Registered
Joined: 10/03/2024(UTC)
Posts: 6
Germany
Location: St

Hi Ioan,

thanks a lot for sharing your experience. As you said, I agree, SMath is a well developed tool that greatly helps with structural calcluations.
I am currently discovering ways to use it and I appreciate all your advices.

I totally agree regarding your point 1. Having unique named variables as per standards helps a lot. The only issue I am facing is when some variable has several calculations options.

Please see my short example with Fax,k force (note:formulas are not correct).

Connectors Example.gif (1,484kb) downloaded 11 time(s).

In this case, I would like to have options to store different sets of equations that would be called based on the chosen values from the list.
Maybe something similar as snippet but that is not copied in the new file but instead it is referenced from some central location

I have managed to achive at some level what I wanted. I have stored values and formulas in a set of if statments and then I am including that file in
some checks. I still have to use Clear function to display the formuls that are stored inside included file.

If in the future some encapsulated function as you described in Point 3 would exist, it would be I think much simpler to define something like this

Edited by user 15 July 2024 05:14:45(UTC)  | Reason: Not specified

Offline ioan92  
#4 Posted : 15 July 2024 07:52:03(UTC)
ioan92


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2012(UTC)
Posts: 94
France, Metropolitan

Was thanked: 169 time(s) in 132 post(s)
Hi Faruk,

Thank you for your answer.
1. I'm sorry, but it is not possible for me to identify from your “gif” file, the problem that you want to solve.

2. For me the major part of the problems can be formulated in an algorithmic manner; this means:

a. Input information;

b. An algorithmic procedure for the transformation of the input information into the output results;

c. The algorithm is often based on some standard procedures (as for instance Eurocodes norms) and some complementary information that I can “invent” myself or I gather from some literature sources; I use abundantly the functions that I define case by case for avoiding redundancy;

d. Waiting for some potential evolution of the SMath, we can do a lot with the available features of the SMath as it is, trying to overcome some difficulties.

3. I prefer to start a problem with a small sketch that allows a better identification of the problem.

4. So, I propose to you to start in this way. We can exchange and also, we can ask advice to the good willing and competent peoples in the forum.


Best Regards,
Ioan

Do to others as you would like them to do to you!
Knowledge is of no value unless you put it into practice - Chekhov
Offline faruk  
#5 Posted : 16 July 2024 03:09:13(UTC)
faruk

Rank: Newbie

Groups: Registered
Joined: 10/03/2024(UTC)
Posts: 6
Germany
Location: St

Hi Ioan,

I've been working on some simple examples to achieve the following:

1. I want to use a single SMATH "Data file" that is included inside other calculation sheets. The file in this case is called TEST_DATA_FILE.sm.
2. I need to have a dropdown list in the "SOME_CALCULATION.sm" file, which calls some algorithms from the "Data file" based on the selected value.
3. It should be possible to display the called formulas.
4. Finally, I need to be able to calculate the results.

SMATH Question2.png (672kb) downloaded 6 time(s).

The best way I've managed to get it working so far is shown in the two attached files. As you can see,
I've had to use a lot of "blue" colored lines in order to show the formulas that are being used.
I hope that there is some more elegant solution for this

TEST_DATA_FILE.sm (15kb) downloaded 6 time(s). SOME_CALCULATION.sm (16kb) downloaded 7 time(s).
Offline ioan92  
#6 Posted : 16 July 2024 06:09:14(UTC)
ioan92


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2012(UTC)
Posts: 94
France, Metropolitan

Was thanked: 169 time(s) in 132 post(s)
Hi Faruk,

I worked a little for you...

Here after, there are my proposals:

SOME_CALCULATION_Ioan.sm (25kb) downloaded 13 time(s). TEST_DATA_FILE_Ioan.sm (25kb) downloaded 8 time(s).

Of course there are also other better solutions. Maybe some others could propose you something else.

1. It seems that you do not use correctly the user defined functions;

2. Take care units. I desafected yours (!?)

If useful please ask.


Regards,
Ioan

Do to others as you would like them to do to you!
Knowledge is of no value unless you put it into practice - Chekhov
Offline faruk  
#7 Posted : 16 July 2024 18:33:26(UTC)
faruk

Rank: Newbie

Groups: Registered
Joined: 10/03/2024(UTC)
Posts: 6
Germany
Location: St

Hi Ioan,

this looks much cleaner and better organized.

Thanks a lot for your help, much appreciate it

Best regards
Faruk
Offline ioan92  
#8 Posted : 18 July 2024 07:41:11(UTC)
ioan92


Rank: Advanced Member

Groups: Registered
Joined: 23/12/2012(UTC)
Posts: 94
France, Metropolitan

Was thanked: 169 time(s) in 132 post(s)
Hi Faruk,

I revisited the information that I send for you and I have some observations that I submit to your attention.

1. I interchanged the lines for the definition of: Fax and MyRk; the first value must be already known for the calculation of the second;

2. I compared the results for two screws of the same diameter (8mm) from the two producers. They are very different, that means to me that there are some problems with the formulas;

3. I suggest that you include in your file some copy/paste of formulas from the literature sources, for a good validation of your code;

4. I suggest to you the use of units; this is simple and profitable;

5. I suggest including data for screws in distinct matrices for each producer. It is also possible to import data from Excel files.


Feel free to ask if you feel useful. Me as others have started as beginners; that has nothing abnormal.

Best regards,
Ioan



SOME_CALCULATION_Ioan b.sm (13kb) downloaded 9 time(s). TEST_DATA_FILE_Ioan b.sm (18kb) downloaded 10 time(s).

Edited by user 18 July 2024 08:19:28(UTC)  | Reason: Not specified

Do to others as you would like them to do to you!
Knowledge is of no value unless you put it into practice - Chekhov
Users browsing this topic
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.