How to send (import) any sage variable back to other software in Sage e.g. Maxima or R

31 views
Skip to first unread message

Jozef Hanč

unread,
Jun 22, 2017, 5:39:58 AM6/22/17
to sage-support
Probably a simple task.

Environment: cocalc sage worksheet

PROBLEM 
Background) It seems that I understand how to send a variable from e.g. Maxima mode (%maxima) to Sage mode.
e.g. using this code in CoCalc:
-------Maxima mode---------------
%maxima
x=2
-------Sage mode-------------------
y=maxima('x')

So the value 2  of x variable defined in Maxima appears as a value of y variable in Sage.

Problem statement) However, I am not able to do a reverse.
I have no idea how to send a variable from Sage to Maxima.

Any advice, link or comment?

Dima Pasechnik

unread,
Jun 22, 2017, 7:52:58 AM6/22/17
to sage-support
it is not clear what you mean by "sending a variable"

What are you trying to achieve?

kcrisman

unread,
Jun 22, 2017, 1:40:43 PM6/22/17
to sage-support
Just in general, you should be able to do

f = stuff

y = maxima(f)

z = y._sage_() # or maybe sage(y)

Nils Bruin

unread,
Jun 22, 2017, 6:46:42 PM6/22/17
to sage-support
Furthermore, results transferred to interfaces are assigned to variables

sage: U=maxima(sin(x))
sage: U.name()
'sage4'
sage: maxima('sage4')
sin(_SAGE_VAR_x)

Reply all
Reply to author
Forward
0 new messages