Question: Matlab code generation with optimize=true -> loses matrix dimensions: Maple 17

Dear all,

I compute a 12,3 matrix in Maple and when I try to generate matlab code with optimization on, the result is a 36 element vector. Also, it warns me as "Warning, cannot resolve types, reassigning t15's type" and "Warning, cannot translate list". When I tried it without optimize=false it yields correct result but the file size is big. I have obtained the correct optimized resutls using Maple 13 before and hence i guess theres somthing to do with maple 17. Any help would be appreicated. The sample code is given below.

=====================

restart;with(VariationalCalculus);
interface(prettyprint = 3);with(LinearAlgebra);
with(CodeGeneration);

d1 := a+b;p1 := a^2;t1 := arctan(sqrt(3)*c-a, b+c);
T11 := (Matrix(4, 4, {(1, 1) = cos(t1), (1, 2) = -sin(t1), (1, 3) = 0, (1, 4) = 0, (2, 1) = sin(t1), (2, 2) = cos(t1), (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1})).(Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = d1, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1})).(Matrix(4, 4, {(1, 1) = cos(xi*p1), (1, 2) = 0, (1, 3) = sin(xi*p1), (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (3, 1) = -sin(xi*p1), (3, 2) = 0, (3, 3) = cos(xi*p1), (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1})).(Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = -d1, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1})).(Matrix(4, 4, {(1, 1) = cos(t1), (1, 2) = sin(t1), (1, 3) = 0, (1, 4) = 0, (2, 1) = -sin(t1), (2, 2) = cos(t1), (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1}));
var := [a, b, c];

tmp := Matrix(12, 3); t := map(int, convert(T11[1 .. 3, 4], Matrix), xi = 0 .. 1); for i to 3 do tmp[1 .. 3, i] := tmp := Matrix(12, 3); t := map(int, convert(T11[1 .. 3, 4], Matrix), xi = 0 .. 1); for i to 3 do tmp[1 .. 3, i] := map(diff, t, var[i]) end do; for i to 3 do tmp[3*i+1 .. 3*i+3, 1 .. 3] := map(diff, tmp[1 .. 3, 1 .. 3], var[i]) end do:

Matlab(tmp, resultname = J, optimize = true, output = string, defaulttype = numeric)

================

thanks

Surani

Please Wait...