idea: Export as text inputs/outputs

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 554
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

idea: Export as text inputs/outputs

Message par compsystems » ven. déc. 20, 2019 12:50 am

Hello Bernard

Inspired by wxMaxima where each input and output is labeled as %input#, %output#, it is very important to do something similar in Xcas,

wxMaxima

Code : Tout sélectionner

(%i1)	g(x):=3*x+x^2;
(%o1)	g(x):=3*x+x^2

(%i2)	f(x):=x^3+10+8*x+3*x^2;
(%o2)	f(x):=x^3+10+8*x+3*x^2

(%i3)	f(g(x));
(%o4)	(x^2+3*x)^3+3*(x^2+3*x)^2+8*(x^2+3*x)+10
The idea is to export the work session in text format with labels
#1> means first entry as commentary
#1< means first output as commentary

for example

Xcas

Code : Tout sélectionner

#1>
	g(x):=3*x+x^2
#1<
	(x)->3*x+x^2

#2>
	f(x):=x^3+10+8*x+3*x^2
#2<
	(x)->x^3+10+8*x+3*x^2

#3>
	h:=unapply(f(g(x)),x)
#3<
	(x)->(3*x+x^2)^3+10+8*(3*x+x^2)+3*(3*x+x^2)^2

#4>
	h1:=simplify(h)
#4<
	(x)->x^6+9*x^5+30*x^4+45*x^3+35*x^2+24*x+10
Everything to capture the work session and thus be able to copy it into a document, this facilitates the writing and understanding of what is being done line by line.

thank you very much

compsystems
Messages : 554
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: idea: Export as text inputs/outputs

Message par compsystems » mer. déc. 25, 2019 6:38 pm

Hi
maxima also allows you to customize the text string for input and output

Code : Tout sélectionner

inchar:"#>";
outchar:"#<";

Code : Tout sélectionner

(#>1)	g(x):=3*x+x^2;
(#<1)	g(x):=3*x+x^2

(#>2)	f(x):=x^3+10+8*x+3*x^2;
(#<2)	f(x):=x^3+10+8*x+3*x^2

(#>3)	f(g(x));
(#<4)	(x^2+3*x)^3+3*(x^2+3*x)^2+8*(x^2+3*x)+10

Répondre