On Wednesday 13 of February 2013 19:47:16 Robert Dodier wrote:
> Here's a short patch which causes 'batch' to display the input
> expression in 1-d format (i.e. sans pretty printing), which I guess
> is what you want.
Yes, this is what I want. I apply the patch and it is very useful for
me to easier distinguish the input and output.
I'm working with matrices a lot in the control problems (using Linear
Matrix Inequalities) and this is not comfortable way to see twice
times the same matrices/vectors in input and then in output. It is
sometimes completely not readable, because you can make very easy
a mistake what is input and what is output.
To Rupert Swarbrick, as I mention above I work a lot with matrices
and when I obtain a result I simply copy it into comment in my file
after given command, but this is very tedious and boring. Why? If
I make a mistake I must Ctrl+C and Ctrl+V into console maxima
the commands, and then Ctrl+C and Ctrl+V the result to my file,
for example:
my_file.mac
------------------------------------------
mTH(k,l):= ThetaHat(k,l) = matrix(
[ Theta(k,l+1) ],
[ Theta(k,l) ]
)$
mA: matrix([ -A1, -A2 ], [ 1, 0 ]);
mB0: matrix([ A3 ], [ 0 ]);
mB1: matrix([ A4 ], [ 0 ]);
mB2: matrix([ A5 ], [ 0 ]);
mC: matrix([ A1, A2 ]);
mD0: matrix([ -A3 ]);
mD1: matrix([ -A4 ]);
mD2: matrix([ A6 ]);
mTH(k+1,l+1) = mA.rhs(mTH(k+1,l)) + mB0.matrix([E(k,l)])
+ mB1.matrix([E(k,l+1)]) + mB2.matrix([E(k,l+2)]);
E(k+1,l+2) = mC.rhs(mTH(k+1,l)) + mD0.matrix([E(k,l)])
+ mD1.matrix([E(k,l+1)]) + mD2.matrix([E(k,l+2)]);
/*
Here, in comment, I put the result, simply by Ctrl+C and Ctrl+V,
e.g. the second equation (the first is too long)
E(k + 1, l + 2) = A6 . E(k, l + 2) - A4 . E(k, l + 1)
- A3 . E(k, l) + A2 . Theta(k + 1, l)
+ A1 . Theta(k + 1, l + 1)
*/
and here goes other commands
/*
and here the results
*/
So my file "my_file.mac" is like textbook. But is very tedious if I make
a mistake and result every commands need once again copy and paste
removing the old wrong result. Now, (after applying the patch below) the
"batch" command is very useful for me, because it is very easy
copy and paste the whole results to my file If I make a mistake.
I do not know if it is clear what I say above, but this is the reason
why the "batch" is needed for me.
I some times use "wxmaxima" but for large matrices the work is not very
comfortable and the console is the best for me.
> There is no flag to change the way 'batch' displays stuff like that, and
> I'm opposed to creating such a flag. However, I am leaning towards
> always printing the input in 1-d format -- it makes it easier to
> distinguish the input and output. Opinions from anyone else?
Yes, you are right, the additional flags are not needed. Your patch
below is OK for me.
Thank you. Thank you very much!
> best
>
> Robert Dodier
Zbigniew
> PS.
> $ git diff src/macsys.lisp
> diff --git a/src/macsys.lisp b/src/macsys.lisp
> index ead7e8a..82e0854 100644
> --- a/src/macsys.lisp
> +++ b/src/macsys.lisp
> @@ -186,7 +186,8 @@
> (setq $__ (caddr r))
> (unless $nolabels (set c-tag $__))
> (cond (batch-or-demo-flag
> - (displa `((mlabel) ,c-tag , $__))))
> + (let (($display2d nil))
> + (displa `((mlabel) ,c-tag , $__)))))
> (setq time-before (get-internal-run-time)
> etime-before (get-internal-real-time))
> (setq area-before (used-area))
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>