I?ve had the same problem some time ago in classroom - some pupils asked me?try
load(diag)$
A:matrix([2, 0, 0], [0, 2, 0], [-1, 0, 3]);
f(x):=x^^k$
mat_function(f,A);
AND: it is more or less self explaining (important in education :-))
BUT: It works only with an actualized version of diag.mac since version 5.28.+
see: http://sourceforge.net/p/maxima/bugs/2568/
Jan
Am 26.10.2013 um 11:07 schrieb Michele Minelli <micheleminelli1 at gmail.com>:
> Hi, thank you but the result is not correct. In particular the element (3,1). I think that your method raises each element to the k-th power, while I want to raise the whole matrix by doing M*M*M*... k times. Anyway never mind: thanks to this mailing list I was able to solve my problem.
> Thank you once again.
> Regards,
>
> Michele M.
>
> Il 25/10/2013 20:16, Paul Bowyer ha scritto:
>> On 10/25/2013 05:39 AM, Michele Minelli wrote:
>>> Hello everyone,
>>> is there a way to compute the k-th power of a matrix in a symbolic way?
>>> For example if the matrix is [2, 0, 0], [0, 2, 0], [-1, 0, 3] it should return [2^k, 0, 0], [0, 2^k, 0], [2^k-3^k, 0, 3^k].
>>> Thank you.
>>> Michele
>>> _______________________________________________
>>> Maxima mailing list
>>> Maxima at math.utexas.edu
>>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>>
>> In wxMaxima, I wrote:
>> M:matrix([[2, 0, 0],[0, 2, 0],[1, 0, 3]]);
>> (%o1) [[2,0,0],[0,2,0],[?1,0,3]]
>>
>> M2:M^k;
>> (%o2) [[2^k,0,0],[0,2^k,0],[(?1)^k,0,3^k]]
>>
>> So it seems to be straight forward to apply arbitrary exponents.
>>
>> wxbuild_info()$
>> wxMaxima version: 13.4.0 (compiled from source)
>> Maxima version: branch_5_31_base_79_gf5e6d07
>> Maxima build date: 2013-10-18 17:39:30
>> Host type: x86_64-unknown-linux-gnu
>> Lisp implementation type: SBCL
>> Lisp implementation version: 1.1.12
>>
>> Respectfully,
>>
>> Paul Bowyer
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.tiff
Type: image/tiff
Size: 17906 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20131026/30dfa75c/attachment-0001.tiff>