surania

20 Reputation

2 Badges

11 years, 116 days

MaplePrimes Activity


These are replies submitted by surania

@carl

Hi Carl,

Thank you very much for the quick solution. I tested it in Matlab and works fine.

thanks again

Surani

@carl

Hi Carl,

Thank you very much for the quick solution. I tested it in Matlab and works fine.

thanks again

Surani

@Carl Love 

Thank you for the quick reply and Sorry about the wrong code. Please try this code.

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

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 := convert(T11[1 .. 3, 4], Matrix);

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);

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

 

Regards

Surani

Dear Preben Alsholm,

Your solution worked like a charm. It would have been helpful if Maple proviced these changes. Otherwise, the code which worked perfectly well does not all all  of a sudden and we have to waste time to dig out the problem. Tried to contact Maple for a slution but they only care about license details not the problem with their product. 

Any way, i tip my hat to you.

Keep up the good work,

Surani

Dear Preben Alsholm,

Your solution worked like a charm. It would have been helpful if Maple proviced these changes. Otherwise, the code which worked perfectly well does not all all  of a sudden and we have to waste time to dig out the problem. Tried to contact Maple for a slution but they only care about license details not the problem with their product. 

Any way, i tip my hat to you.

Keep up the good work,

Surani

Page 1 of 1