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 Teacher  
#1 Posted : 24 February 2017 16:41:36(UTC)
Teacher


Rank: Member

Groups: Registered
Joined: 28/09/2015(UTC)
Posts: 20

Was thanked: 1 time(s) in 1 post(s)
Hi there,

I'm using Excel to generate some mechanical models for shafts of gear-boxes and I also have got the possibility to put the equilibrium conditions into text- formulars.

Because Execl can neither display the equations in any way, nor calculate the results I would like to import the "Values" of the Excel-sheet into SMath.

As I use Geogebra too, wich has got the function to type commands in one line and let them run as an input I thought that it would be great to have it in SMath too...

So, is there some kind of scripting functionality tha provides the possiblity to read a script-file in text-format which tells smath what to do ... e.g. x:5/3 *F.Ax

And if not, do you have another idea for a solution?

Regards
Teacher

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

Offline Jean Giraud  
#2 Posted : 24 February 2017 19:50:03(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
1. Smath can read Excel data
2. Excel can tabulate values from the equation, and plot the graph
3. Show your formula in Smath.
4. Smath can retrieve formula(s) ... "include"
Offline mkraska  
#3 Posted : 24 February 2017 19:51:36(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 1120 time(s) in 718 post(s)
More questions than answers.

- What do you mean by generating models? Collect parameter values?
- I bet Excel can actually calculate any result, provided the user is able to specify the procedure.
- What is the purpose of using external text files instead of directly specifying what you want to do?

There are some examples for mechanical problems in the online gallery, see e.g. BeamFEA, which includes heavy scripting/programming.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Teacher  
#4 Posted : 24 February 2017 20:46:51(UTC)
Teacher


Rank: Member

Groups: Registered
Joined: 28/09/2015(UTC)
Posts: 20

Was thanked: 1 time(s) in 1 post(s)
Hey,

thanks for your replies ....

Maybe I try to describe the situation a little bit more:

I've build a sheet where I can input the loads and the geometry of the shaft and Excel is now calculating vales of the reaction forces - not the formulas.

Though I often have to give a sample solution I am in need of the formulas of the reaction forces. So put the given input data within Excel together to get the formulas (as a string in a cell of the sheet) like this:
S/greek F.y=0 /next fomular/ F.Ay+F.By-F.t-F.p=0
S/greek F.z=0 /next fomular/ F.Az+F.Bz-F.r=0
... and so on...

Because I have to use those forumlas to continue calculating wihtin SMath I am looking for a possibility to import a list of commands (like I said, I know this from Geogebra) or just copy & paste the "text of the command" (like given above), so I don't have to type it manually again!

I hope this makes things a little bit more clear.

@Jean: If I would import the data the Excel-sheet, would it be possible to create a formula from a given string within the imported table?


So thanks again in advance for further informations
Offline Jean Giraud  
#5 Posted : 24 February 2017 23:20:41(UTC)
Jean Giraud

Rank: Guest

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

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Teacher Go to Quoted Post
So thanks again in advance for further informations


Start from square 0 in Smath
Write your formula(s), one by one , plot the first formula
try next, and so on. Collabs can see something.
The key failure is "hybrid non-compatible math tools"
You have Geogebra ... doing what that Smath can' t do ?
Excel plots and tabulates: you don't need => Smath plots & tabulates.
Can't help w/o seeing your 1rst step(s).
Offline Davide Carpi  
#6 Posted : 25 February 2017 12:38:23(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: Teacher Go to Quoted Post
So, is there some kind of scripting functionality tha provides the possiblity to read a script-file in text-format which tells smath what to do ... e.g. x:5/3 *F.Ax


You can use importData.XLSX from Xlsx Import/Export plugin
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Teacher  
#7 Posted : 08 March 2017 02:14:36(UTC)
Teacher


Rank: Member

Groups: Registered
Joined: 28/09/2015(UTC)
Posts: 20

Was thanked: 1 time(s) in 1 post(s)
Hi again,
sorry for posting again so late, but there were quite a few things to be done ...
So here what it is all about:
I've created a Excel-file with many different sheets within to do the following:
-1- define the input-values like
+ setcions of a shaft (diameter, length)
+ material paramters (mechanical stiffness parameters)
+ the points where loads are aplied to the shaft as well as the mounting points
+ ....1-Input.jpg
-2- the sheet is built up in the way that the reaction forces at the mounting points are calculated automatically by value (not by formula)2-calculated_reacion_forces.jpg
-3- on another sheet ...
+ the internal force variables
+ the single mechanical stresses (like tensile stress / pressure, bending stresses and torsional stress) are evaluated by combining the internal forces with the given geometry data
+ the reliability is determined from the given stresses and the material parameters
All this is calculated by value (not by formula) in a veeeery huge table 3-numerical_calculations.jpg (1,005kb) downloaded 9 time(s).
-4- the results are shown in some diagrams4-results_numerical_calculations.jpg

Often I need to write a sample solution. For this I need to document the way how to get to the solution by formula (and not as it is done within the Excel-sheets by value only (yes there are fomulas too within the sheets but they are generated in a veeeery general way, so nothing ever any engineer would use without a computer).
For this reason there is
-5- a sheet where it is possible to generate some free punches for calculating
+ the reaction forces and
+ the internal force variables 5a-preparing _data_for_free_punch_output.jpg (824kb) downloaded 14 time(s).5b-free_punch_as_graphics.jpg

Because this is just a "static" picture [as it is not possible to build a 3D-vector-diagram wihtin Excel] I thought about using Geogebra so there is
-6- another sheet where the given model (shaft-geometry, loads, reaction forces and if needed the inernal forces) is translated into text-command-lines to be used as an input on Geoegebra's input line.6-geogebra-output_with_results_wihtin_geogebra.jpg


Maybe you can - by looking at the screenshots - follw my decision to use Excel-sheet instead of the sheet-functionallety within SMath...

Now, at least, the only thing for documentation which is still missing is generating the the formulars for calculating the reaction forces and the internal forces, and maybe somewhen the stresses and the reliability at certain points.7-typical-and_wanted-documentation.jpg

.... and all this was leading to the question: Is there a way to import commands, which are given in a text-form (e.g. F.Ax:100'N <CR> F.Bx:F.Ax-F.Sx=), into SMath. Or is there any way to write my own .sm-file or any other way the get those commands into SMath-sheet?

I hope posting a screenshot of every given point is helping to follow my explanation.

So and after this I hope what I'm trying to find and can help me out with some solution ;-)

Regards
Offline uni  
#8 Posted : 08 March 2017 09:00:02(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,494
Man
Russian Federation

Was thanked: 1274 time(s) in 745 post(s)
It's not entirely clear what you mean by commands. You will not be able to place the expression on the sheet. You can specify any definitions, but their appearance will be hidden, since they are formed dynamically in memory. You will see only results. Therefore, you can create a document as a template and load the definitions from a file. The definition can be a formula or a function.
Theoretically you can create your own sm-file, but it's too hard.

You can create a report using LaTeX or something similar.

Script Region

Code:
var cmds = new List<string>( new[] { "F.Ax:100*'N", "F.Bx:F.Ax-a" } );

cmds.ForEach( c => 
{
    var tmp = SMath.Math.Symbolic.Converter.ToMItem(c).ToTerms();

    Decision.SymbolicCalculation( Entry.Create( tmp ), store );
} );

store.TraceData( "Done." );


2017-03-08 10-50-18 SMath Studio - [Script. Load definitions.sm ].png

Edited by user 08 March 2017 09:09:43(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
Offline Teacher  
#9 Posted : 08 March 2017 21:21:22(UTC)
Teacher


Rank: Member

Groups: Registered
Joined: 28/09/2015(UTC)
Posts: 20

Was thanked: 1 time(s) in 1 post(s)
Thanks for answering Uni,

It's funny, but I was still hoping for the sentence "You will not be able to place the expression on the sheet." not to come. But in fact thats exactly what I'm trying to do.

The "hidden" definitions are good for calculating, but then it would be possibleto import Excel-data instead ... So this is not helping me out at all.

I just took a look on an example .sm-file and recognized that it is "just" a textfile, so it would be possible to "copy & paste" the body of an empty .sm-file and then insert my fomulars ....
8-SMath-file_math+text-region.jpg
the marked regions are going to look like that ....
9-SMath-workbook-appearance.jpg

As it seem to be a boring work to analyse the .sm-file and figuring out which command / region is responsible for which expression in the workbook and how its structure works:

***
Is there any description of the SMath-file-format to help me getting along faster?
***

Of course that's a lot of work, but if there is no other way to get my documentations done ... Over the years it will save a lot of time and of course - boring work of typing the formulas manually...

:'( I wish there would be a more comfortable way .....

... May be now, as it seem to be clear what I'm trying to do, anyone has got a better idea ...

Regards

Edited by user 08 March 2017 21:43:12(UTC)  | Reason: Not specified

Offline mkraska  
#10 Posted : 09 March 2017 00:45:56(UTC)
mkraska


Rank: Advanced Member

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

Was thanked: 1120 time(s) in 718 post(s)
You could use the snippet mechanism to insert external sm-files into the currently open document.

Just create an sm-file (by modifying a sample xml source as described above) and write it to the snippets directory of your SMath installation. In the file properties you can define a name, which you just need to type at the point, where you want to insert the file.

The procedure is described in my pdf handbook.

I don't think that the numerics of the beam is too complicated for SMath, just have a look at the BeamFEA example (you can open it in SMath in the cloud)
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Davide Carpi  
#11 Posted : 09 March 2017 02:28:39(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
2017-03-09 00_35_29-Microsoft Excel - test.xlsx.png

Edited by user 09 March 2017 02:36:30(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Teacher  
#12 Posted : 09 March 2017 22:57:36(UTC)
Teacher


Rank: Member

Groups: Registered
Joined: 28/09/2015(UTC)
Posts: 20

Was thanked: 1 time(s) in 1 post(s)
Hi there,

thanks again and again and again ;-) Pretty cool to know that there are some other people out there who's also interested in solving problems ...

@mkraska: I know about the snippets and I also had a look at the beam-example a while ago. And of course I don't think that SMath can't handle the calculations I've been doing along with Excel. It's more that in this case I found it much more comfortable doing the graphing and drawing things along with Excel and so I did the rest along with it too.

@Davide: Sorry for ignoring your former post about the inputData-plugin. According to that I've got some questions:
-1- how is the path defined for the XLSX-file (I've been trying some example where I just put both files (.sm .XLSX) within the same directory, but it doesn't work.
-2- Is it possible to "repost" the definition of a formula? When defining a formula like F.Ax:F.Bx-F.S I can see the definition (of course ;-)), but when typing F.Ax= it only shows the numerical result of the formula. I think that's the reason you've been using a matrice for importing the data, right? Is there any way torepost the definition of a formula??

Regards
Offline Davide Carpi  
#13 Posted : 10 March 2017 00:23:28(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: Teacher Go to Quoted Post
@Davide: Sorry for ignoring your former post about the inputData-plugin. According to that I've got some questions:
-1- how is the path defined for the XLSX-file (I've been trying some example where I just put both files (.sm .XLSX) within the same directory, but it doesn't work.
-2- Is it possible to "repost" the definition of a formula? When defining a formula like F.Ax:F.Bx-F.S I can see the definition (of course ;-)), but when typing F.Ax= it only shows the numerical result of the formula. I think that's the reason you've been using a matrice for importing the data, right? Is there any way torepost the definition of a formula??

Regards



  1. absolute (C:\...) or relative (in the example above, both the files were in the same folder)
  2. you can import definitions (simplified example in the cloud) or you can act like in the screenshot above; if you don't mind about calculations smath-side, then you can use a boolean equal in place of the definition symbol and maybe you can hide the LHS (the import function - right click on the region and unflag "display input data")
    false definition.gif

Edited by user 10 March 2017 02:32:45(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Teacher  
#14 Posted : 06 April 2017 18:40:32(UTC)
Teacher


Rank: Member

Groups: Registered
Joined: 28/09/2015(UTC)
Posts: 20

Was thanked: 1 time(s) in 1 post(s)
Hi there,

it's been a while since opening he post ...

At first I really like to thank you all for beeing interested in my problems and giving your point of view to solving the problem.

After thinking a while (and of course looking at the structure of a SMath-file) I decided that it is best for me wo export my Excel-generated data into a native SMath-file.

I know that there are easier way to solve the given problem by using so mathematics, but because I like the solution to look like it is "hand-made" it took a while in considering all those special cases that might occur. And now, after all I'm done with that and everythings works fine. So the most of the time I was spening my time in generating names for the variables, match the layout and stuff like that. Exporting and building the SMath-file was just an blink of an eys compared with that...

You might want to habe a look. The attached SMath-file is totally automated exported from Excel. When opening the first time you might dicover that it takes a while for SMath to build up the screen. It might be that I was not looking too seriously at the synthax-rules. But SMath is very frugal with that and if you save the file and reopen it everything is "repaired" by SMath.

Again, thanks a lot for inspiring me ;-)

Regards

here is a screenshot for those who don't like downloading the file:
10-ExcelExportedSMathFile.jpg

here is the SMath-file for downloading:
UM-Achsen+Wellen-Aufgaben-Aufgabe 5.sm (19kb) downloaded 37 time(s).

Edited by user 06 April 2017 18:45:00(UTC)  | Reason: Not specified

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.