Modeller Region

Modeller Region - Introduction of Modeller Region with how to use step-by-step instruction - Сообщения

#1 Опубликовано: 11.02.2014 18:34:50
Andrey Ivashov

Andrey Ivashov

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

Группа: Super Administrator

Modeller Region


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:


  1. Modeller Region is not built-in into standard SMath Studio package. It should be installed using Extensions Manager (Tools > Plugins > Online Gallery).


  2. Modeller Region available via Insert menu, so lets try to add it to the worksheet;


  3. Modeller requires output variable to be set. Try to evaluate this variable after Region to see its value. 0 - means no data drawn.


  4. 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.


  5. 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.


  6. Now we neeed to link Templates with a Modeller Region. It can be simply done with Context menu.


  7. 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.


  8. That is all we need to start. Now you can drag'n'drop shapes from the palette at right to the Modeller canvas.


  9. 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.


  10. We need more Templates!


  11. As for me, I can play with it all day long


  12. All Shapes are in vectors, so we can zoom in and out using mouse scroll.


  13. 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

  14. 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.
6 пользователям понравился этот пост
Davide Carpi 11.02.2014 19:50:00, IVR 12.02.2014 08:44:00, Martin Kraska 11.02.2014 19:36:00, Radovan Omorjan 12.02.2014 09:34:00, Вячеслав Мезенцев 12.02.2014 10:59:00, ioan92 12.02.2014 11:03:00
#2 Опубликовано: 11.02.2014 19:39:25
Martin Kraska

Martin Kraska

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

Группа: Moderator

That really seems to be a whole new space of opportunities. Will take a while to explore them.
One of them: Usage as multidimensional slider...

Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Опубликовано: 11.02.2014 20:04:09
Davide Carpi

Davide Carpi

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

Группа: Moderator

Wrote

That 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

Wrote

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


works for me
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#4 Опубликовано: 12.02.2014 10:05:11
Radovan Omorjan

Radovan Omorjan

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

Группа: Moderator

It 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
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#5 Опубликовано: 12.02.2014 14:35:53
Martin Kraska

Martin Kraska

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

Группа: Moderator

What is the idea for dispaying result-dependent geometry: are we supposed to modify templates or is there a chance to provide input just in the format of the output?
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#6 Опубликовано: 12.02.2014 17:08:35
overlord

overlord

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

Группа: Moderator

Wrote

It 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 КиБ) скачан 257 раз(а).
1 пользователям понравился этот пост
Davide Carpi 12.02.2014 20:36:00
#7 Опубликовано: 12.02.2014 17:21:40
Andrey Ivashov

Andrey Ivashov

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

Группа: Super Administrator

Radovan, thank you very much. I will fix it soon.

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.
1 пользователям понравился этот пост
Davide Carpi 12.02.2014 20:36:00
#8 Опубликовано: 12.02.2014 18:54:30
Andrey Ivashov

Andrey Ivashov

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

Группа: Super Administrator

Hello again

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.
3 пользователям понравился этот пост
Davide Carpi 12.02.2014 19:21:00, Martin Kraska 12.02.2014 19:56:00, Вячеслав Мезенцев 14.02.2014 05:19:00
#9 Опубликовано: 12.02.2014 19:46:00
Martin Kraska

Martin Kraska

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

Группа: Moderator

Wrote

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 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.







moodle.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#10 Опубликовано: 12.02.2014 19:48:00
Davide Carpi

Davide Carpi

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

Группа: Moderator

Wrote

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?



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 )
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#11 Опубликовано: 14.02.2014 05:22:31
Вячеслав Мезенцев

Вячеслав Мезенцев

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

Группа: Moderator

Hint for the last example (rus): Каждый охотник желает знать, где сидит фазан.
Russia ☭ forever, Viacheslav N. Mezentsev
#12 Опубликовано: 14.02.2014 19:17:44
Andrey Ivashov

Andrey Ivashov

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

Группа: Super Administrator

Thank you for all the comments!

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.
3 пользователям понравился этот пост
Radovan Omorjan 15.02.2014 01:58:00, ioan92 14.02.2014 19:34:00, Davide Carpi 14.02.2014 20:30:00
#13 Опубликовано: 17.02.2014 20:22:09
Davide Carpi

Davide Carpi

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

Группа: Moderator

Hi Andrey,

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)

Показать спойлер




Best regards,

Davide
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#14 Опубликовано: 18.04.2014 06:56:28
Martin Kraska

Martin Kraska

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

Группа: Moderator

Why is the template ellipse distorted?

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 КиБ) скачан 193 раз(а).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#15 Опубликовано: 13.11.2014 19:04:15
Andrey Ivashov

Andrey Ivashov

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

Группа: Super Administrator

Just for the info: I've just recorder a small demo: http://smath.info/file/yLAXA - it shows how to start using Modeller in few steps.
2 пользователям понравился этот пост
Martin Kraska 13.11.2014 19:24:00, Вячеслав Мезенцев 14.11.2014 15:01:00
#16 Опубликовано: 13.11.2014 19:24:31
Martin Kraska

Martin Kraska

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

Группа: Moderator

Can you please pass some info on how to place text in the region?
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#17 Опубликовано: 22.01.2015 23:28:10
Ryan Freund

Ryan Freund

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

Группа: User

How did / do you incorporate units?
#18 Опубликовано: 14.09.2015 16:56:00
9_82abZ2

9_82abZ2

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

Группа: User

mkraska,

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.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Modeller Text Crash.png
#19 Опубликовано: 15.09.2015 18:31:39
Davide Carpi

Davide Carpi

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

Группа: Moderator

Wrote

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)


Nice, it works

Wrote

SMath 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)


If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#20 Опубликовано: 08.03.2016 02:06:47
Alexander O. Melnik

Alexander O. Melnik

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

Группа: Moderator

Andrey,

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.

201501121015359155.jpg

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.



ThanksФайл не найден.Файл не найден.
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений