Le forum de XCAS

Xcas: un logiciel libre de calcul formel
Nous sommes actuellement le Mer Avr 25, 2018 4:41 pm

Heures au format UTC




Publier un nouveau sujet Répondre au sujet  [ 15 messages ] 
Auteur Message
 Sujet du message: printf: 2D print
MessagePublié: Lun Mar 12, 2018 11:09 pm 
Hors-ligne

Inscrit le: Sam Fév 04, 2017 11:34 pm
Messages: 178
Localisation: Colombia
Hello BP
I do not see the 2D print, Why?


Code:
f():={
  print(sqrt(2));
  printf(sqrt(2));
  return "Done";
}:;


Haut
 Profil  
 
 Sujet du message: Re: printf: 2D print
MessagePublié: Mar Mar 13, 2018 11:59 am 
En ligne

Inscrit le: Mar Déc 20, 2005 4:02 pm
Messages: 4302
2d printing is visible in the console (at the bottom) in Xcas for Firefox and in DispG() screen in Xcas native.


Haut
 Profil  
 
 Sujet du message: Re: printf: 2D print
MessagePublié: Mar Mar 13, 2018 3:26 pm 
Hors-ligne

Inscrit le: Sam Fév 04, 2017 11:34 pm
Messages: 178
Localisation: Colombia
Some suggestions for DispG window:

1: On the first print delete the message "Step by step console"
2: Allow the ClrIO command to clean the print history
3: the impression of the last line must move the previous ones, so that it can be visualized in real time

Thanks


Haut
 Profil  
 
 Sujet du message: Re: printf: 2D print
MessagePublié: Mar Mar 13, 2018 4:19 pm 
En ligne

Inscrit le: Mar Déc 20, 2005 4:02 pm
Messages: 4302
Ok for supporting ClrIO, but I won't change anything else in DispG in Xcas native.


Haut
 Profil  
 
 Sujet du message: Re: printf: 2D print
MessagePublié: Mar Mar 13, 2018 8:20 pm 
Hors-ligne

Inscrit le: Sam Fév 04, 2017 11:34 pm
Messages: 178
Localisation: Colombia
thanks, with the ClrIO command, the screen is automatically cleaned

There is a simple problem, the printing is superimposed (you have to increase the line spacing =) ), please try the following code,

Citer:
sol_sys1():={
local y,x,list0,expr0,lsolx,y1,y2,sols,test1;
purge(x,y);
autosimplify(nop); autosimplify();
approx_mode(0); approx_mode();
DispG; ClrIO; printf("Solving a system of two equations"); printf("Solve the following system:");
list0 := [ y = x^2, y = 2*x + 3 ]; printf(list0);
printf("substitute y = x² in y = 2x + 3:");
expr0 := subst(list0(2),list0(1)); printf(expr0);
printf("substract 2x + 3:");
expr0 := expr0-(2*x + 3); printf(expr0);
printf("simplify:");
expr0 := simplify(expr0); printf(expr0);
printf("factor:");
expr0 := factor(expr0); printf(expr0);
printf("zero factor theorem:");
lsolx := [ part(left(expr0),1)=0, part(left(expr0),2)=0 ]; printf(lsolx);
printf("First factor plus 3, second minus 1:");
lsolx := [lsolx(1)+3, lsolx(2)-1 ]; printf(eval(lsolx,1));
printf("simplify"); printf("x values:");
lsolx := simplify(lsolx); printf(lsolx);
printf("y values:"); printf("Replace x values in the system, firts equation");
y1 := subst(list0(1),lsolx(1)); printf(y1);
printf("Replace x values in the system, second equation");
y2 := subst(list0(1),lsolx(2)); printf(y2);
printf("Solutions shaped as a array");
sols:=[[lsolx(1),y1],[lsolx(2),y2]]; printf(sols);
printf("Checking results:"); printf("Replace x and y values in the system, firts equation");
test1 := subst(list0(1),[sols(1,1),sols(1,2)]); printf(test1);
printf("Evaluate:");
test1 := evalb(test1); printf(test1);
printf("Replace x and y values in the system, second equation");
test1 := subst(list0(1),[sols(2,1),sols(2,2)]); printf(test1);
printf("Evaluate:");
test1 := evalb(test1); printf(test1);
sols := solve([ y = x^2, y = 2*x + 3 ],[x,y]); printf("Solutions:"); printf(sols);
printf("Solutions shaped as a boolean expression:");
sols := list2exp(sols,[x,y]); printf(eval(sols,1));
printf("Graphing");
plot([x^2,2*x+3],x);
return("Done");
}:;


I think that to take better advantage of the console space, please align to the left

Thank you very much


Haut
 Profil  
 
 Sujet du message: Re: printf: 2D print
MessagePublié: Mar Mar 13, 2018 8:56 pm 
En ligne

Inscrit le: Mar Déc 20, 2005 4:02 pm
Messages: 4302
Run it inside Xcas for Firefox. As I said, I won't make UI changes in Xcas native. The future of Xcas native is for intensive computations where Xcas for Firefox would be too slow.


Haut
 Profil  
 
 Sujet du message: Re: printf: 2D print
MessagePublié: Ven Mar 23, 2018 10:03 pm 
Hors-ligne

Inscrit le: Sam Fév 04, 2017 11:34 pm
Messages: 178
Localisation: Colombia
Hello BP, the future of the app are online app, but on-line_xcas is in development, while the PC version, usually works well and is already "ready"

I think it will not change anything in the UI, at least correct BUGS in the same

when running the next program, the super indexes are superimposed, the bug is solved simply by increasing the line spacing, maybe the something simple on source-code, or maybe this involves modifying 100s the code lines.


Code:
sol_sys1():={
local y,x,list0,expr0,lsolx,y1,y2,sols,test1;
purge(x,y);
autosimplify(nop); autosimplify();
approx_mode(0); approx_mode();
DispG; ClrIO; printf("Solving a system of two equations"); printf("Solve the following system:");
list0 := [ y = x^2, y = 2*x + 3 ]; printf(list0);
printf("substitute y = x² in y = 2x + 3:");
expr0 := subst(list0(2),list0(1)); printf(expr0);
printf("substract 2x + 3:");
expr0 := expr0-(2*x + 3); printf(expr0);
printf("simplify:");
expr0 := simplify(expr0); printf(expr0);
printf("factor:");
expr0 := factor(expr0); printf(expr0);
printf("zero factor theorem:");
lsolx := [ part(left(expr0),1)=0, part(left(expr0),2)=0 ]; printf(lsolx);
printf("First factor plus 3, second minus 1:");
lsolx := [lsolx(1)+3, lsolx(2)-1 ]; printf(eval(lsolx,1));
printf("simplify"); printf("x values:");
lsolx := simplify(lsolx); printf(lsolx);
printf("y values:"); printf("Replace x values in the system, firts equation");
y1 := subst(list0(1),lsolx(1)); printf(y1);
printf("Replace x values in the system, second equation");
y2 := subst(list0(1),lsolx(2)); printf(y2);
printf("Solutions shaped as a array");
sols:=[[lsolx(1),y1],[lsolx(2),y2]]; printf(sols);
printf("Checking results:"); printf("Replace x and y values in the system, firts equation");
test1 := subst(list0(1),[sols(1,1),sols(1,2)]); printf(test1);
printf("Evaluate:");
test1 := evalb(test1); printf(test1);
printf("Replace x and y values in the system, second equation");
test1 := subst(list0(1),[sols(2,1),sols(2,2)]); printf(test1);
printf("Evaluate:");
test1 := evalb(test1); printf(test1);
sols := solve([ y = x^2, y = 2*x + 3 ],[x,y]); printf("Solutions:"); printf(sols);
printf("Solutions shaped as a boolean expression:");
sols := list2exp(sols,[x,y]); printf(eval(sols,1));
printf("Graphing");
plot([x^2,2*x+3],x);
//DispHome
return("Done");
}:;


Haut
 Profil  
 
 Sujet du message: Re: printf: 2D print
MessagePublié: Dim Mar 25, 2018 7:55 pm 
En ligne

Inscrit le: Mar Déc 20, 2005 4:02 pm
Messages: 4302
Unfortunately, the widget used for the step by step console is the same as for displaying matrices, changing anything there would certainly have bad side effects.


Haut
 Profil  
 
 Sujet du message: Re:
MessagePublié: Sam Avr 14, 2018 3:48 pm 
Hors-ligne

Inscrit le: Sam Fév 04, 2017 11:34 pm
Messages: 178
Localisation: Colombia
An idea, to avoid the superposition of lines automatically print a blank line after each impression.

printf("");


Haut
 Profil  
 
 Sujet du message: Re: printf: 2D print
MessagePublié: Sam Avr 21, 2018 3:43 pm 
Hors-ligne

Inscrit le: Sam Fév 04, 2017 11:34 pm
Messages: 178
Localisation: Colombia
parisse a écrit:
Ok for supporting ClrIO


ClrIO is not working

Code:
printf(x^2);printf(x/y);Pause;ClrIO;


xcas has commands similar to ClrHome (ClrWorkSheet)? http://tibasicdev.wikidot.com/68k:clrdraw


Haut
 Profil  
 
 Sujet du message: Re:
MessagePublié: Sam Avr 21, 2018 4:25 pm 
En ligne

Inscrit le: Mar Déc 20, 2005 4:02 pm
Messages: 4302
It works on linux with 1.4.9-59, maybe binaries are not updated for win and mac.


Haut
 Profil  
 
 Sujet du message: Re:
MessagePublié: Sam Avr 21, 2018 4:42 pm 
Hors-ligne

Inscrit le: Sam Fév 04, 2017 11:34 pm
Messages: 178
Localisation: Colombia
the last windows version throws giac 1.4.9-57.

It is possible that the graph DispG; plot(x-1/6*x^3,x); is only drawn in the DispG window and not in the worksheet?, since it does not make sense to see the graph in two parts,DispG window and worksheet window.


Haut
 Profil  
 
 Sujet du message: Re:
MessagePublié: Sam Avr 21, 2018 5:30 pm 
En ligne

Inscrit le: Mar Déc 20, 2005 4:02 pm
Messages: 4302
No. The worksheet should be the place where all happens, you should not use DispG, it's here only for compatibility.


Haut
 Profil  
 
 Sujet du message: Re:
MessagePublié: Sam Avr 21, 2018 5:42 pm 
Hors-ligne

Inscrit le: Sam Fév 04, 2017 11:34 pm
Messages: 178
Localisation: Colombia
^
you believe that a clrHome command is important to clean the worksheet?


Haut
 Profil  
 
 Sujet du message: Re:
MessagePublié: Sam Avr 21, 2018 6:27 pm 
En ligne

Inscrit le: Mar Déc 20, 2005 4:02 pm
Messages: 4302
What do you mean by clearing the worksheet?


Haut
 Profil  
 
Afficher les messages publiés depuis:  Trier par  
Publier un nouveau sujet Répondre au sujet  [ 15 messages ] 

Heures au format UTC


Qui est en ligne ?

Utilisateurs parcourant actuellement ce forum : Aucun utilisateur inscrit et 3 invités


Vous ne pouvez pas publier de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas insérer de pièces jointes dans ce forum

Rechercher pour:
Sauter vers:  
Powered by phpBB® Forum Software © phpBB Group
Traduction réalisée par Maël Soucaze © 2009 phpBB.fr