Modeller Region - Introduction of Modeller Region with how to use step-by-step instruction - Messages
First of all I want to say that this region allows to do magic things with SMath Studio and I believe that this is the most powerfull part of the program. I spend on it many time, I did demos of it to many people in order to find out the best approaches can be made. Because of this region I developed Viewer next to SMath Studio and integrated it as a simple to use plug-in. But I'm still in the middle of its implementation. It is really a big and interesting job!
Idea of this region is very simple: user should be able to draw data and SMath Studio must recognize it to perform appropriate calculations. Great! Good idea is everything developer needs

So, how it works:
- Modeller Region is not built-in into standard SMath Studio package. It should be installed using Extensions Manager (Tools > Plugins > Online Gallery).
- Modeller Region available via Insert menu, so lets try to add it to the worksheet;
- Modeller requires output variable to be set. Try to evaluate this variable after Region to see its value. 0 - means no data drawn.
- Ok. Now we should specify objects can be used inside Modeller. This objects called Templates. Every Template is a row-vector with several parameters inside. All templates should be composed within single sys() function as shown below.
- In the simplest layout you are able to set the name of Template and its path. Path is a matrix with two columns - pairs of coordinates of points. It is absolutely the same as supported by Plot Region.
- Now we neeed to link Templates with a Modeller Region. It can be simply done with Context menu.
- After it is done you will see a Shape appeared at right of Modeller and while this Shape is hovered you will see a hint with Shape's name.
- That is all we need to start. Now you can drag'n'drop shapes from the palette at right to the Modeller canvas.
- Check out output variable. Do you see how butifull it is? Indeed, it contains full description of Shapes drawn inside Modeller! Now we can do whatever we want with this data!
- Column #1: Number of Template used for the Shape;
- Column #2: X-coordinate of the Shape;
- Column #3: Y-coordinate of the Shape;
- Column #4: Width of the Shape;
- Column #5: Height of the Shape;
- Column #6: Determins whether Shape is active (focused);
- Column #8: Unique id of the Shape;
- Other columns I will discribe later. - We need more Templates!
- As for me, I can play with it all day long
- All Shapes are in vectors, so we can zoom in and out using mouse scroll.
- By the way, to delete drawn Shape just focus it by mouse and press Del on keyboard. You can also update Shape properties by double click on it
try it by yourself. For the start you can use example I created for this intro:
modeller-demo.sm - Modeller Region is fully compatible with SMath Viewer, so you can create very powerfull applications now! For example there are 2 applications available via Extensions Manager.
The only a part of functionality described above, but this one the most important.
Glad if you'll find Modeller Region usefull and interesting. And of course I'm trilled to see how you will use it! Share results if it is possible! Thank you!
Best regards, Andrey Ivashov.
One of them: Usage as multidimensional slider...
WroteThat really seems to be a whole new space of opportunities. Will take a while to explore them.
One of them: Usage as multidimensional slider...
I agree :d
I've played a little with the worksheet shared by Andrey and I love how the click and drag works

WroteI cannot access the applications from the online gallery, neither in the installer version nor in the (otherwise reliable) portable one.
works for me

By the way, It crashes for me (Win7(x64))when choosing "Dependent layout" - see this video
Actually, have no idea what this "layout" means. When I choose it - there is "Syntax is incorrect" error or crash
Regards,
Radovan
WroteIt seems very interesting, thank you Andrey
![]()
By the way, It crashes for me (Win7(x64))when choosing "Dependent layout" - see this video
Actually, have no idea what this "layout" means. When I choose it - there is "Syntax is incorrect" error or crash
Regards,
Radovan
below there is an example which i found while messing with, if there is more settings it will be revealed (i hope so

Page2.sm (5 KiB) downloaded 254 time(s).
ioan92, you're welcome!
overlord, you are absolutely correct about usage of Predefined/Dependent layouts! I will describe it deeply later (just have no time to do it right now). But here is a small hint - Modeller fully supports units!
Best regards, Andrey Ivashov.

I just created a very simple game based on the modeller Region functionality. It is available as an Example and Application within Extension Manager.
Use Example to see how it works:
I can imagine to create some applications for students with tasks about math, physics or anything else where students should set correct locations of some objects (numbers, resistors etc) to pass the test/exam. Note: that Print button is available in SMath Viewer, so the result can be sent to print out in seconds! Any ideas?

Best regards, Andrey Ivashov.
WroteI can imagine to create some applications for students with tasks about math, physics or anything else where students should set correct locations of some object to pass the test/exam. Note: that Print button is available in SMath Viewer, so the result can be sent to print out in seconds! Any ideas?
Best regards, Andrey Ivashov.
I am using Moodle for homework assignments in engineering mechanics. You can define problems with random individual parameters for each student and ask for a single number (with units support). This number is checked against a reference solution formula, given as a single expression without intermediate variables. Moodle takes care of deadlines, grading and the like.
These formula can be several hundred characters long, just imagine to compute the maximum stress in a compound cross section, where the centroid and moments of inertia need to be calculated from the given data. Kay had the job to create and input these reference formulae - guess what he did: writing a plugin for export of expressions to moodle format.
With interactive graphics at hand, I could imagine to ask for free body diagrams and support reactions with automatic consistency checking.
Or let the students draw shear and moment diagrams from randomly created loads and support conditions.
Or just create graphic problem representations based on parameters.
Moodle has a plugin interface and there seems to be a maxima plugin. However, I am not a moodle administrator and it was quite hard for me to find out how to operate it. The docs explain the buttons and dialogs but do not guide you through common workflows.
An interesting tool for such interactive graphics combined with computer algebra functions is geogebra. This is a tool which can be embedded in web sites, similar to SMath live. It is developed in Austria and in recent releases moves towards computer algebra.
Andrey, I agree that there is plenty of potential. However, for real impact, interfacing with a full featured course management and grading system is required and that is a project on it's own. Designing problems for such systems is considerable investment and one needs to be sure that the features in use are still working with the next moodle update.
WroteI can imagine to create some applications for students with tasks about math, physics or anything else where students should set correct locations of some objects (numbers, resistors etc) to pass the test/exam. Note: that Print button is available in SMath Viewer, so the result can be sent to print out in seconds! Any ideas?
I can imagine "libraries" of templates and post-processing functions... this open a view in the direction of the skills of programs like powersim (used at university some years ago), I like this plugin very much

Hope this will encourage more users and developers to play with SMath (and not just to play

For those who wants to see an example of enhanced controlling of the Modeller's region I've created the following file: https://smath.com/files/Download/Tgmbb. Warning: this file is not a simple one. A way to operate with this region will be simplified in future, so some complexities is absolutely expected for now.
Best regards, Andrey Ivashov.
debugging my Table Region plugin I've incidentally encountered a (small) bug in the GetPossibleItemsLists(Store store) function (used in the Modeller and even in other plugins, such as combobox region etc...)
If there are many variables on the canvas with the same name but different types (where a type is what fit and what don't fit the criteria inside GetPossibleItemsLists), and one variable does the job but is not the last, you have a false positive, because obviously in the end GetDefinitionByName returns the last value assigned to the variable.
(BTW here is not critical, but could be useful for someone)
private void GetPossibleItemsList(Store store)
{
// Cleaning
this.AvailableItems = new List<String>();
// Garbage collector: to skip items with the same name previously defined (false positives) and already processed items
List<String> ProcessedItems = new List<String>();
for (int k = store.Count - 1; k > -1; k--)
{
if (store[k].Answer.Length > 0 && !ProcessedItems.Contains(store[k].Name))
{
if (store[k].Answer requirements are reached)
{
this.AvailableItems.Add(store[k].Name);
}
ProcessedItems.Add(store[k].Name);
}
}
}
Best regards,
Davide
Edit: Sorry, I attached an outdated version of the file. There nothing is distorted. But when removing all except the two first elements of the template, then the distortion happens without any obvious reason.
The rectangle in post #1 has no added arguments as well and is not distorted. What is wrong with my example?
modeller-demo-Kr.sm (6 KiB) downloaded 186 time(s).
It looks like Modeller Region Can support text (Modeller Region: ver 1.0.5346.33851), just copy and paste what I have below and include it in your template:
texty:mat("Text",mat("TESTR","Green",100,1,3),1,mat(20,40,2,1),mat(10,40,2,1),0,1,1,7)
I don't think you can font or style though...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
In addition; I found a fatal bug; if I were to enter this into the modeller Region:
texty:mat(1,3,"Test","Green",2,4,5,1,7)
SMath will crash. My guess would be that the code is trying to perform math operations on a string; I would investigate incompatible types but I don't know the code so I'm just taking a shot in the dark at what the problem may be.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Wrotejust copy and paste what I have below and include it in your template:
texty:mat("Text",mat("TESTR","Green",100,1,3),1,mat(20,40,2,1),mat(10,40,2,1),0,1,1,7)
Nice, it works

WroteSMath will crash. My guess would be that the code is trying to perform math operations on a string
I think is related with SS-132 (wrong templates)
I know it has been quiet here for a while, but there is little something something I could use modeller for - strut & tie modelling:
http://best.umd.edu/publications/stm.pdf
or in plain words, conceptually separating a chunk of concrete into compression elements (struts) and tension steel rebar elements (ties) in a way that will create a valid load path from the point load to the support or reaction.
The thing with strut & tie is that it is very graphical solution; if you can draw it, it will work.
I was hoping to use modeller to draw a set of interconnected lines. Once drawn, the lines (start & end coordinates) can be extracted to SMath for further processing.
Modeller would be a perfect environment for this, except in it current form it cannot draw inclined lines, or lines that will "snap" to the existing node.
Andrey, do you anticipate any further work on this plugin?
Right now I am "drawing" in EXCEL and heck it is not right way of doing this.
ThanksFile not found.File not found.
-
New Posts
-
No New Posts