cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Transforming mathcad programs into "Python" for use in robotics

WolfgangIssel
1-Newbie

Transforming mathcad programs into "Python" for use in robotics

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"?

4 REPLIES 4

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

StuartBruff
23-Emerald II
(To:VladimirN)

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.

Top Tags