Hello to everyone,

I was trying to make some camputational tool for my students, to allow them 
to compute powers of matrices quickly. I made a tiny htm page with some 
text giving explanations, and the following code embedden in a one-cell 
script

DEF=[[0.25,0.55,0.2],[0.35,0.15,0.1],[0.45,0.3,0.7]];

@interact 
def  _(T=input_grid(3,3, default = DEF, label='Transition matrix $T=$', 
        to_value=matrix), d=input_box(3, width=5, label="number of digits "), 
        n=input_box(2,width=5,label="power of $T$, $n=$")):
    T = T.apply_map(RealField(d*log(10)/log(2)))
    M=T^n
    html('$T^n = \displaystyle %s$'%latex(M))



I happen to have a page which background is blue, so the standard output, 
in black is not very adapted... Anyone can tell how to change the output 
color of html(...) to white?

And I have a second question : I would like to round the matrices ut to 
some desired precision. What I did here is not exactly that. I don'n know 
why M.round(3) didn't worked... I spent more time that I should have trying 
to figure out this... I someone could help, that would be very nice!

Regards,

JC

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to