1 страниц (17 вхождений)
AI assistance for SMath - Сообщения
Recently I gave an undergraduate course on Numerical Mathematics. It involved solving tasks using SMath and Python. The students complained that AI is nearly useless for SMath, whereas for python they get solutions which work out of the box with just a few prompt iterations in tools like ChatGPT.
Also, when I copy the text of my online tasks (STACK questions in the Moodle learning management system) to ChatGPT, the tool not only paraphrases the task with an impressive correctness (there are sometimes glitches like swapped numbers in data tables), but also upon request produces programs which generate the solution, even if it can't create the solution by itself. This works with Python programs and, to much less extent, also with Maxima.
I guess that many users made similar experience. For Python, even if you can't really rely on correct implementation of the requested algorithms, you usually still get a very helpful starting point.
Not so with SMath.
I guess that in the near future, software without strong AI coverage (i.e. you can ask AI any questions about it or even let it do your work) will be regarded as outdated, cumbersome and inconvenient. People using non-AI supported tools will be much less efficient than those benefitting from AI support.
I don't know if the available data to feed an LLM woud be enough to make it a good companion or co-pilot for creating or analyzing SMath sheets. The data I think of is
- handbooks
- forum contents (messages and attachments)
- public cloud worksheets
- source repository for extensions
I am aware of the AI features in the SMath roadmap like automatic keyword generation and worksheet translation to other languages.
Additional interesting features would be:
- convert printout (PDF) from SMath back to sm files
- convert handwritten calculations to sm files
- edit expressions based on written or spoken commands ("insert an empty column in the matrix right to the second one")
- optimize performance of existing sheets
- Make consistent layout, create tables of contents, interlink sections etc.
This post is to open a discussion on what you expect from AI support and what ideas or experience do you have to improve AI coverage of SMath for the users.
Also, when I copy the text of my online tasks (STACK questions in the Moodle learning management system) to ChatGPT, the tool not only paraphrases the task with an impressive correctness (there are sometimes glitches like swapped numbers in data tables), but also upon request produces programs which generate the solution, even if it can't create the solution by itself. This works with Python programs and, to much less extent, also with Maxima.
I guess that many users made similar experience. For Python, even if you can't really rely on correct implementation of the requested algorithms, you usually still get a very helpful starting point.
Not so with SMath.
I guess that in the near future, software without strong AI coverage (i.e. you can ask AI any questions about it or even let it do your work) will be regarded as outdated, cumbersome and inconvenient. People using non-AI supported tools will be much less efficient than those benefitting from AI support.
I don't know if the available data to feed an LLM woud be enough to make it a good companion or co-pilot for creating or analyzing SMath sheets. The data I think of is
- handbooks
- forum contents (messages and attachments)
- public cloud worksheets
- source repository for extensions
I am aware of the AI features in the SMath roadmap like automatic keyword generation and worksheet translation to other languages.
Additional interesting features would be:
- convert printout (PDF) from SMath back to sm files
- convert handwritten calculations to sm files
- edit expressions based on written or spoken commands ("insert an empty column in the matrix right to the second one")
- optimize performance of existing sheets
- Make consistent layout, create tables of contents, interlink sections etc.
This post is to open a discussion on what you expect from AI support and what ideas or experience do you have to improve AI coverage of SMath for the users.
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
Hi Martin. You can try this code utility ( https://smath.com/en-US/forum/topic/GbopVw/Code-utility#msg137576 ) for scripting SMath functions. By relying on plain text, the AI will be able to provide some form of useful source code for basic applications.
Also, you can use an editor for syntax highlighting

For notepad++:
userDefineLang.xml (79 КиБ) скачан 92 раз(а).
Best regards.
Alvaro.
Also, you can use an editor for syntax highlighting

For notepad++:
userDefineLang.xml (79 КиБ) скачан 92 раз(а).
Best regards.
Alvaro.
Отредактировано 13.06.2025 00:20:34
The world is galloping by while I took a break. What do you know about combining Python and AI to solve engineering problems? Do you have any links?
I don't know if this counts as an engineering problem. It is a python script written by ChatGPT. I didn't save the chat history but as I recall, the prompt was to simulate the movement of a double pendulum and animate it using VPython. The axes of the plot have some glitches, I guess with one more interaction Chatgpt would have fixed that as well.
The process of the making took well below one hour, even though the last time I used vpython was more than 20 years ago.
Pendulum.py (4 КиБ) скачан 84 раз(а).

The process of the making took well below one hour, even though the last time I used vpython was more than 20 years ago.
Pendulum.py (4 КиБ) скачан 84 раз(а).

Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
Greetings,
For training the model, here is my thought.
As for the nature of an AI; I will note, it would probably be wise to treat "AI SMath" in (4) different roles:
As for an effective AI: having good information to train it is important, but I think there is benefit if the AI would be able to 'compile' the code/answer it is willing to provide you. To the best of my knowledge, the current models will auto-generate code for you, you will try/compile it: it will fail, and you will need to inform the AI that it got it wrong: of which the AI would then acknowledge: YEP! that will not compile: IF we can determine a way for the AI to debug its own answer with output matching the goal INSTEAD of guessing at which assortment of coding can/might work.
Finally, to some benefits of AI, you can add "Units Management" as featured in an article posted on this forum a while back (I don't know how to find the thread, but it was uploaded by a user acrXAz )
https://smath.com/en-US/files/Download/acrXAz/AI-Units.pdf
i.e., just because units can be simplified to a common base term, it doesn't mean they represent the same 'thing'; like percentage, radians, and Specific Gravity are all 'unitless' but do not refer to the same concept; AI could manage this.
May this be of Good Help;
⚜ Kenny Lemens, P.E. ᵂᴵ
For training the model, here is my thought.
- Handbooks
- forum contents (messages and attachments)
* Download SMath Studio and Archive
* Samples
* Extensions
* Questions
* Feature Requests
* Bugs & Problems
* Features Announcements
* Project Discussions - p̶u̶b̶l̶i̶c̶ ̶c̶l̶o̶u̶d̶ ̶w̶o̶r̶k̶s̶h̶e̶e̶t̶s I would avoid this as no peer review, and prone to collect bad data; just refer to those published as samples in the forum
- source repository for extensions https://smath.com:8443/!/#public
- API Smath Core Documentation https://smath.com/documentation/api/SMathStudio.Core/1.73.9126/html/N_SMath_Controls.htm
- SMath wiki:
* https://wiki.smath.com/en-US/Main_Page
* https://smath.com/wiki/Tutorials.ashx - Bug/Issues Tracter (https://smath.com/bts/)
- 3rd Party Publications:
* SMath Studio Handbuch (348 Seiten) [https://smath.com/en-US/files/Download/T7PAY/SMath%20Einf%C3%BChrung.pdf]
* SMath Suite: A Primer (Prof. Gilberto E. Urroz) [https://smath.info/wiki/GetFile.aspx?File=Tutorials/SMathPrimer.pdf]
* SMath for Physics (Bernard V Liengme) [https://iopscience.iop.org/book/mono/978-1-6270-5925-1.pdf]
As for the nature of an AI; I will note, it would probably be wise to treat "AI SMath" in (4) different roles:
- Assist in Calculations within SMath Solver
- Assist in Reporting within SMath Writer
- Programming/plugin development/deployment for SMath Studio
- SMath Studio: Version Management, EULA, Bugs, Feature Requests, Extension, Forum Interface, Account Management
As for an effective AI: having good information to train it is important, but I think there is benefit if the AI would be able to 'compile' the code/answer it is willing to provide you. To the best of my knowledge, the current models will auto-generate code for you, you will try/compile it: it will fail, and you will need to inform the AI that it got it wrong: of which the AI would then acknowledge: YEP! that will not compile: IF we can determine a way for the AI to debug its own answer with output matching the goal INSTEAD of guessing at which assortment of coding can/might work.
Finally, to some benefits of AI, you can add "Units Management" as featured in an article posted on this forum a while back (I don't know how to find the thread, but it was uploaded by a user acrXAz )
https://smath.com/en-US/files/Download/acrXAz/AI-Units.pdf
i.e., just because units can be simplified to a common base term, it doesn't mean they represent the same 'thing'; like percentage, radians, and Specific Gravity are all 'unitless' but do not refer to the same concept; AI could manage this.
May this be of Good Help;
⚜ Kenny Lemens, P.E. ᵂᴵ
Отредактировано 17.07.2025 21:46:10
"No matter where you go, there you are." -Buckaroo BanzaiHotkeys: https://en.smath.com/forum/resource.ashx?a=45771&b=2
1 пользователям понравился этот пост
Andrey Ivashov 18.07.2025 23:26:43
Hi. This prompt can be used to ask Gemini or another AI to generate code that can be interpreted within the Code utility. It's obviously not complete and still has a lot of work to do, but it's a starting point.
SMath prompt spa.docx (3 МиБ) скачан 38 раз(а).
Best regards.
Alvaro.
SMath prompt spa.docx (3 МиБ) скачан 38 раз(а).
Best regards.
Alvaro.
1 пользователям понравился этот пост
Martin Kraska 21.07.2025 11:07:39
Alvaro, did you experiment with direct generation of the internal text format and pasting that to a math region without resorting to meta-code?
BTW, range(3) is range(start,end,step).
BTW, range(3) is range(start,end,step).
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
Hi Martin. Yes, but in that case, I don't know if the AI provides useful code, since I'm the one who can't read it. Too many parentheses and an endless line of instructions. I suppose something interesting could be achieved by giving the AI the full list of instructions, for example, taking the definitions from the text_XXX.lang file.
Another option could be to ask it for the code in RPN, either to try to manipulate the XML file in a SMath spreadsheet or to use the function at https://smath.com/en-US/forum/topic/mNFvE7/RPN-Interpreter#msg131314 . I suppose RPN is "inherent" to an AI.
Finally, I haven't tested it in AIs specialized in code generation, nor within VS Code or similar environments, where I assume better results should be obtained.
Best regards.
Alvaro.
Another option could be to ask it for the code in RPN, either to try to manipulate the XML file in a SMath spreadsheet or to use the function at https://smath.com/en-US/forum/topic/mNFvE7/RPN-Interpreter#msg131314 . I suppose RPN is "inherent" to an AI.
Finally, I haven't tested it in AIs specialized in code generation, nor within VS Code or similar environments, where I assume better results should be obtained.
Best regards.
Alvaro.
My rough draft of the syntax description. May contain errors and inaccuracies. The limit of free communication with ChatGPT has been exhausted.
uni-ai-smath-syntax-20250729 (ebnf, draft, rus).md (15 КиБ) скачан 9 раз(а).
The implementation could look like this. It is now technically possible to call a python script that makes a request and returns the result.

uni-ai-smath-syntax-20250729 (ebnf, draft, rus).md (15 КиБ) скачан 9 раз(а).
The implementation could look like this. It is now technically possible to call a python script that makes a request and returns the result.

Отредактировано 29.07.2025 11:19:12
Russia ☭ forever, Viacheslav N. Mezentsev
1 пользователям понравился этот пост
Alvaro Diaz Falconi 29.07.2025 17:39:33
Improved syntax description, but still ambiguous. This document can already be used as a draft, but it still requires revision.
uni-ai-smath-syntax-20250730 (ebnf, draft, rus).md (16 КиБ) скачан 13 раз(а).
If you set a correct and compact description, then it is not necessary to train AI on a bunch of documents, it can simply translate known algorithms using this description. You only need to attach the rules for such an operation and a set of examples.
uni-ai-smath-syntax-20250730 (ebnf, draft, rus).md (16 КиБ) скачан 13 раз(а).
If you set a correct and compact description, then it is not necessary to train AI on a bunch of documents, it can simply translate known algorithms using this description. You only need to attach the rules for such an operation and a set of examples.
Russia ☭ forever, Viacheslav N. Mezentsev
3 пользователям понравился этот пост
Davide Carpi 29.07.2025 18:58:34, ⚜ Kenny Lemens, P.E. ᵂᴵ 29.07.2025 20:55:34, sergio 30.07.2025 08:38:07
Improved syntax description. I can't explain how to specify the sizes of program blocks as constants. Deepseek is already producing good results, but he constantly forgets some details. Perhaps here we need to use a neural network that is trained only to work with code.
uni-ai-smath-syntax-20250730 (ebnf, draft, rus).md (18 КиБ) скачан 9 раз(а).

uni-ai-smath-syntax-20250730 (ebnf, draft, rus).md (18 КиБ) скачан 9 раз(а).

Russia ☭ forever, Viacheslav N. Mezentsev
Have you tried with different AIs?
DuckDuckGo has a set of 5 to use freely: https://duckduckgo.com/?q=DuckDuckGo+AI+Chat&ia=chat&duckai=1&atb=v378-1
DuckDuckGo has a set of 5 to use freely: https://duckduckgo.com/?q=DuckDuckGo+AI+Chat&ia=chat&duckai=1&atb=v378-1
Отредактировано 30.07.2025 11:40:11
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
The syntax description was developed using ChatGPT, but I would like to use it in free popular services.
This direction of code generation seems promising to me. At the first stage, it is necessary to develop a syntax description, at the second stage - its transformation into a document, and at the third stage - the design of the document style.
It is already possible to obtain pseudo code even with such a limited description.
This direction of code generation seems promising to me. At the first stage, it is necessary to develop a syntax description, at the second stage - its transformation into a document, and at the third stage - the design of the document style.
It is already possible to obtain pseudo code even with such a limited description.
Отредактировано 30.07.2025 12:00:06
Russia ☭ forever, Viacheslav N. Mezentsev
I modify a little the prompt given by Viacheslav. Using the prompt SMathAI.md on https://aistudio.google.com/

SMathAI.md (6 КиБ) скачан 9 раз(а).
RKA - AI.sm (23 КиБ) скачан 6 раз(а).
Best regards.
Alvaro

SMathAI.md (6 КиБ) скачан 9 раз(а).
RKA - AI.sm (23 КиБ) скачан 6 раз(а).
Best regards.
Alvaro
1 пользователям понравился этот пост
Вячеслав Мезенцев 30.07.2025 22:17:51
Deepseek and Kimi can't solve the problem completely yet, unlike Google AI. They stumble on the size indication, as I described earlier. It is necessary to conduct some research on how to correctly get around this problem.
Russia ☭ forever, Viacheslav N. Mezentsev
1 страниц (17 вхождений)
-
Новые сообщения
-
Нет новых сообщений