Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
In our new project "psycho-mathematics" we have developped a program in mathcad 11/14 able to calculate presumable human behaviour as a function of certain boundary conditions.
We would like to integrate this theory into robotics for integrating human properties.
Robotics often use "Python" as a common programming language.
Are there possibilities to transform programs written in mathcad into "Python"?
Wolfgang Issel wrote:
In our new project "psycho-mathematics" we have developped a program in mathcad 11/14 able to calculate presumable human behaviour as a function of certain boundary conditions.
We would like to integrate this theory into robotics for integrating human properties.
Robotics often use "Python" as a common programming language.
Are there possibilities to transform programs written in mathcad into "Python"?
Directly? No. It should be possible to do it the old-fashioned way, though (by hand!) - I've done this both ways between languages ranging from C to Mathematica (and more recently Haskell).
Indirectly? One way is to write a translator that will take a Mathcad xml file (eg, xmcd) and convert it to Python. Another option might be to use Mathcad's automation interface and write Python code to run the worksheets.
In several projects I have used Mathcad to develop and document my models and then translate them into some suitable target language (eg, Matlab/Simulink). If Mathcad were to be used in such a fashion (which I believe is one of the fundamental Mathcad usage paradigms) then it might be worth your institution contacting PTC and seeing if there they would be interested in furthering this development.
Stuart
Perhaps that in this case (transfer the calculation from Mathcad into Python) is possible to use the following bundle: first using the existing plug-in integration (MATLAB/Mathcad) transfer calculation in MATLAB and then transfer from MATLAB into Python.
P.S. I found an interesting article "Compare Computational Tools: Python, Matlab, Mathcad": Compare Computational Tools: Python, Matlab, Mathcad | Programming for Engineers
VladimirN. wrote:
I found an interesting article "Compare Computational Tools: Python, Matlab, Mathcad": Compare Computational Tools: Python, Matlab, Mathcad | Programming for Engineers
That certainly shows off some of Mathcad's notational superiority. I wonder why they didn't give a Mathcad example of the 2D heat equation?
Stuart
Not automatically, no. Of course, you can port it by hand. How much work that would be depends on how complicated your Mathcad program is, and possibly how much memory you have available on the embedded controller. If the Mathcad worksheet is simple enough you could get by with just Python and the numpy library. If it has functions that are not included in Python or the numpy library then you would either have to write them yourself, or possibly use the scipy library. The scipy library is big though, hence the question regarding available memory.