1

I'm using CasADi symbolic framework to study a Robotics problem. Since my symbolic equations are very long, I decided to export them to Mathematica in order to simplify them. The problem is that when I use the command

with open("dyn_eq.txt", "w") as eq:
    print>>eq, f_x

to write these equations on a text file, Python cut them (because they are too long) using three dots

+(-0.4726*sin((x_0+x_1))))+...)*...))-...))))*...))*...)+...)+...))))+...)]

and Mathematica can't read them obviously.

Am I using the wrong command? Is there a way to avoid Python from cutting these expressions?

Tobia Marcucci
  • 204
  • 1
  • 7
  • Please show us the original equation in your example. Maybe [self reference](http://stackoverflow.com/questions/13851581/python-printed-a-list-three-dots-appeared-inside-sublists) may be your problem? – Raoul Jun 21 '15 at 20:43
  • Do you mean the entire text file? Anyway I don't think that the problem is self reference: in the script.py I can set the number of bodies I want to simulate (more bodies I study longer are the expressions I want to print) and for a low number of bodies these dots don't appear. When I set higher numbers, these dots come at the end of every term of the symbolic list, I'm quite sure it's a problem of length... Maybe there is a way to set a "view option" that prevent Python from cutting expressions? Do you agree? Thanks! – Tobia Marcucci Jun 22 '15 at 08:25

1 Answers1

1

That's actually an output limiting feature of CasADi rather than of Python itself. You can verify this limit by using

f_x.getMaxNumCallsInPrint()

(default 10000L), and eventually change it via its companion function

f_x.setMaxNumCallsInPrint(20000L)

(e.g. to change the call value to 20k)

Source: http://casadi.sourceforge.net/v1.5.0/api/html/d2/db3/classCasADi_1_1SX.html