Maple Tools - Symbolic engine for SMath Studio. - Messages






Functions: maple().
Components: Maple, Maple Plot.
⚠ For now I just want to show how to use old symbolic engine in SMath Studio. We haven't normal symbolic engine yet, so I decided to use cmaple.exe for this purpose.
Examples:
maple-system-tools.sm (17 KiB) downloaded 209 time(s).






Links:
1. Maple interpreter (rus)
MapleWrapper. Examples.pdf (66 KiB) downloaded 1167 time(s).
I tried it but unfortunately I did not figure out how to use it. Just copied the folders from the zip archive, started SMath and even I could see that the MapleVR4 plugin present in the plugin list, there is also a maple() function in the function list but did not figure out how to use it. Never mind, I am just very grateful to you for working on this issue.
BTW, is there any chance to include some other (free) symbolic engines into SMath?
Regards,
Radovan
Thanks a lot
oscampo
QuoteBTW, is there any chance to include some other (free) symbolic engines into SMath?
SMath Studio Should have own symbolic engine. Some knowledge is needed for this. Except the author, I also try to do researches in this area. These knowledges are based on works of 1960-1970th years in MIT. Before transformation were executed on LISP. Here there are two programs which I try to restore:
SIN: https://mysvn.ru/cop/sin/SIN.lisp
SOLDIER: https://mysvn.ru/cop/sin/SOLDIER.lisp
The description can be found here (Joel Moses):
LISP 1.5 family
Joel Moses. Symbolic Integration. AI Memo 97, Artificial Intelligence Project, MAC-M-310, Project MAC, Massachusetts Institute of Technology, June 10, 1966, 17 pages.
Joel Moses. Symbolic Integration II. AI Memo 97a, Artificial Intelligence Project, MAC-M-327, Project MAC, Massachusetts Institute of Technology, October 13, 1966, 12 pages.
As to other possibilities, yes it is possible, but it can't be done, because work on own symbolic engine will be stoped or paused. We'll get history of Mathcad in this case (only numeric -> maple engine -> mupad engine -> ? (Mathcad Prime)).
On the picture the mechanism of work is described. It's not so needed for use maple() function. Try some expression on the picture. If you'll see any result then it works.
If I understood you well, your intention is to improve the SMath own symbolic engine. I appreciate that, thank you.
BTW, the maple plugin did not work for me.
Regards,
Radovan
QuoteIf I understood you well, your intention is to improve the SMath own symbolic engine.
Yes, that's right.

WrotePlease, Uni or Omorr, could you translate the text on the image on first post?
Thanks a lot
oscampo
The algorithm (C#):
// Вычисления на уровне термов
static public bool ExpressionEvaluation( Term root, Term[][] args, ref Store context, ref Term[] result ) {
// Application path and command line arguments
string ApplicationPath = Path.GetDirectoryName( System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName )
+ "\\plugins\\mapledos.exe";
string InFile = Path.GetTempFileName();
string OutFile = Path.GetTempFileName();
string ApplicationArguments = InFile;
MItem expression = SMath.Math.Symbolic.Converter.ToMItem(args[0]);
SMath.Math.Symbolic.Expansion.Prepare( ref expression );
SMath.Math.Symbolic.Expression.SimplifyEx( expression, context );
string Expr = SMath.Math.Symbolic.Converter.ToString( expression );
StreamWriter sw = File.CreateText( InFile );
// From long to shot name
StringBuilder shortPath = new StringBuilder(255);
GetShortPathName( OutFile, shortPath, shortPath.Capacity );
sw.WriteLine( "interface(quiet=true);" );
sw.WriteLine( "writeto(`" + shortPath.ToString().Replace( "\\", "\\\\" ) + "`):" );
sw.WriteLine( "convert(" + Expr.Replace( ",", "." ).Replace( ";", "," ).Replace( "{", "(" ).Replace( "}", "
" ).Replace( '\u2261', '=' ).Replace( '"', '`' )
+ ",string);" );
sw.WriteLine( "quit:" );
sw.Close();
// Create a new process object
Process ProcessObj = new Process();
// StartInfo contains the startup information of
// the new process
ProcessObj.StartInfo.FileName = ApplicationPath;
ProcessObj.StartInfo.Arguments = ApplicationArguments;
ProcessObj.StartInfo.WorkingDirectory = Path.GetDirectoryName( System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName )
+ "\\plugins";
// These two optional flags ensure that no DOS window
// appears
ProcessObj.StartInfo.UseShellExecute = false;
ProcessObj.StartInfo.CreateNoWindow = true;
// If this option is set the DOS window appears again :-/
// ProcessObj.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
// This ensures that you get the output from the DOS application
ProcessObj.StartInfo.RedirectStandardOutput = true;
ProcessObj.StartInfo.RedirectStandardInput = true;
// Start the process
ProcessObj.Start();
// Wait that the process exits
ProcessObj.WaitForExit();
if ( File.Exists( InFile ) ) { File.Delete( InFile ); }
StreamReader sr = new StreamReader( OutFile );
string OutStr = sr.ReadToEnd().Trim().Replace( ",", ";" ).Replace( ".", "," ).Replace( '`', '"' );
sr.Close();
result = SMath.Math.Symbolic.Converter.ToMItem( OutStr ).ToTerms();
if ( File.Exists( OutFile ) ) { File.Delete( OutFile ); }
return true;
}
I can make system() function for executing external programs but this is dangerous.
WroteI have forgotten that separators can be different. As you see I use other adjustments ("," and ";" instead of "." and "," like on your example). Number PI isn't supported yet, it is necessary to write so: Pi (maple notation).
Unfortunately, I can not make it work. There is no difference regarding languages, decimal and argument separator. It is not working for me. I will try some more. I hope that someone else will have success in trying this plugin.
Regards,
Radovan
Wrote
QuoteIf I understood you well, your intention is to improve the SMath own symbolic engine.
Yes, that's right.
You might want to take a look at this symbolic calculator written in java. Sources at :
http://webuser.hs-furtwangen.de/~dersch/jasymca2/indexEN.html
Maybe the SMath developer plans to use the library Mathdotnet, funded by Microsoft, which eventually will support symbolics.
I am not a programmer and do not know how the things are working regarding SMath development, but regarding plugins I was hopping (and still I am) that the thing would go this way. I thought that there would be interested people to just made some plugins from already free existed numerical and symbolical libraries - like a lego bricks. I might be wrong or there must be some other things to be done regarding the plugin functionality, or maybe there are some project on the way - I do not know. Anyway, I still think that the best way for SMath is just to incorporate as many numerical functions as possible from different available sources and to incorporate already existing symbolic engines side by side with the SMath core functionality. On the other way, I think that SMath needs just few more numerical and symbolical features (equations solvers, fitting, plotting capabilities etc.) in order to be used by many of users on a daily basis.
I might be naive about this, but the only thing I wish is that the SMath become quite powerful and to have larger user base.
Regards,
Radovan

It is possible to be connected to free packages (AlgLib, ...), but only without fanaticism. Otherwise SMath Studio will lose the status of the mathematical program, and will be only the interface with plug-ins to mathematical engines. That's why I am careful in this question.
Thank you for the reply, but I think I did not make myself clear. I'll try to be more specific.
I just think that SMath needs to be more powerful. It needs few more solvers (algebraic, ODE etc.) and some other things. For instance, I am very grateful to you that you made the Mathcad like ODE solvers. I hope they will be a standard SMath plugin. Smath needs some more numerical functions - you already did some from Mathcad as well. It needs some more symbolic features - you try to do the same as well. The question is - how to make SMath a bit more powerful in a relatively acceptable period of time in the future? SMath made quite a progress in past few years and I am really convinced that SMath needs only few more things in order to be used by many more users on a daily basis. As I could see there are two things to be done. Firstly, Andrey to continue developing the SMath core as he is doing, but he can not do all these things in SMath - this is impossible. Secondly, good willing people (like you) to make plugins. Now, I did not quite understand how to make those plugins. I do not understand what could be reused in SMath from other available sources and just make "packages"-plugins for SMath and, moreover, what could be useful for SMath and its users.
WroteRadovan, I think that there is a possibility to connect any mathematical package (like Maple, Matlab, Mathematica...), but they should be installed in system. If you have Matlab (for example, with size of 1-10 Gb
), why you need SMath Studio in this case?
No, not at all. I am not using either of these programs and there is no need to make any plugin to connect with them - just my opinion.
WroteIt is possible to be connected to free packages (AlgLib, ...), but only without fanaticism. Otherwise SMath Studio will lose the status of the mathematical program, and will be only the interface with plug-ins to mathematical engines. That's why I am careful in this question.
Sorry, I did not understand this at all. Could you please explain that to me.
Let us imagine the present state of SMath as it now but with few hundred numerical functions more in the function list, with more symbolic possibilities and features. I think that the average user would not care where those things come from while he/she is able to do the all the math calculations in SMath (without installing some additional commercial packages, of course). At the present state, some more advanced user will say:"Hmm...I like SMath but unfortunately I can not do this or that in it and I am forced to use some other math tool".
I could not see how SMath could lose the status of a mathematical program by incorporating in it some freely available numerical or symbolical libraries. SMath can not compete with, say, Matlab because there are thousands of programmers involved in its development and it is not the point to compare Matlab and SMath. However, as far as I know even than Matlab used and incorporated in it lots of freely available numerical libraries. The same thing is with, say, Scilab (free Matlab like software). There are lots of incorporated freely available libraries as well.
I might be wrong about all of this, of course, but can not see what could be wrong in making plugins from some freely available, well established C, C++, C# numerical library (or even Fortran), if this could be possible. On the other hand, I would not really care if some other (free) symbolic engine is present in SMath as a plugin - contrary I would like that (BTW, I prefer, say, Jasymca over Maple). Actually, I would be very grateful if someone is willing and could do all of this.
Regards,
Radovan
http://bit.ly/puJvvD
There are links to numerical .Net libraries and also a library for accessing matlab from .Net
As for me I'll try to learn c# and make some plugin.
As a reminder, uni made few just amazing plugins. Just see this pages:
ODEsolvers
debugger
mcadefi
Alglib
plot3D
I hope I did not miss any.
Many thanks to uni

Regards,
Radovan
FIR Filter Design (rus)

When I ignore this error in smath the command Maple does nothing - sometimes I get an error message saying: Fill out every empty places (or something like this, I am translating back to English from the Danish message). If I instead try to run Mapledos in a commandprompt it reports that VDM IPX/SPX isn't supported but apart from this I can actually run Mapledos in this commandprompt.
Has anybody got a clue why smath can't communicate with this?
And, Uni, I have noticed that your maple files are slightly different from what I am running under Mathcad 11.2SG. Can this be something related to sources and could this possibly have any impact on my issues?
WroteHi uni. Can you upload again the maple plugin? File was deleted from cd.ru. Thanks.
Try this one: mvr4_20120926.zip. In the plugins folder there is a log file of transformations: mvr4.txt. Don't forget to check it periodically.
WrotePlease, Uni or Omorr, could you translate the text on the image on first post?
Thanks a lot
oscampo
Thank you for your efforts on this but, unfortunately, there is no way for me to understand how is this working and how should this plugin be used

Regards,
Radovan
WroteHello uni
WrotePlease, Uni or Omorr, could you translate the text on the image on first post?
Thanks a lot
oscampo
Thank you for your efforts on this but, unfortunately, there is no way for me to understand how is this working and how should this plugin be used.
Regards,
Radovan
Ok. I'll make simple video tutorial.
-
New Posts
-
No New Posts