## 10 Badges

10 years, 263 days

## Labeling in matrixplot...

Maple

Hello,

I have use a sparsematrixplot to identify the patterns in a matrix.

In order to facilitate the readability of my sparsematrixplot, i would like to change the labels of the rows/ columns axis.

Instead of the numeric graduation, i would like to add :

- for my rows, the labels : [eq1,eq2, ..., ]
- for my columns, the labels : [q1,q2,q3,...,]

Do you have ideas how I can do that ?

Thank you for your help

## Simplification of trigonometric expressi...

Maple

Hello,

In the post :

http://www.mapleprimes.com/questions/209721-Simplification-Of-Trigonometric-Expressions

you have help me to build a procedure so as to simplify trigonometric expressions of the following form, that is to say where each trigonometric expression is in factor with a term :

x0(t)+sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))*xb-sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))*zb-sin(alpha0(t))*cos(beta0(t))*yb+cos(alpha0(t))*sin(gamma0(t))*zb+cos(alpha0(t))*cos(gamma0(t))*xb-l2*(sin(psi(t))*sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))-cos(psi(t))*sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))+sin(psi(t))*cos(alpha0(t))*cos(gamma0(t))+cos(psi(t))*cos(alpha0(t))*sin(gamma0(t)))-l3*(sin(theta(t))*sin(psi(t))*sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))+sin(theta(t))*cos(psi(t))*sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))+cos(theta(t))*sin(psi(t))*sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))-cos(theta(t))*cos(psi(t))*sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))-sin(theta(t))*sin(psi(t))*cos(alpha0(t))*sin(gamma0(t))+sin(theta(t))*cos(psi(t))*cos(alpha0(t))*cos(gamma0(t))+cos(theta(t))*sin(psi(t))*cos(alpha0(t))*cos(gamma0(t))+cos(theta(t))*cos(psi(t))*cos(alpha0(t))*sin(gamma0(t)))-xp(t) = 0

From a mechanical point of view, this form of equations comes from the constraint equations obtained with a vectorial closure.

Now I would like to silmplify the constraint equations which come form angular closure.

The equations are in the form :

sin(gamma0(t))*cos(beta0(t)) = -(sin(psi(t))*cos(theta(t))*cos(gamma(t))+sin(psi(t))*sin(theta(t))*sin(gamma(t))-cos(theta(t))*cos(psi(t))*sin(gamma(t))+cos(psi(t))*sin(theta(t))*cos(gamma(t)))*cos(beta(t))

i try to treat the right side with the following code :

applyrule([
cos(u::anything)*cos(v::anything)-sin(u::anything)*sin(v::anything)=cos(u+v),
cos(u::anything)*sin (v::anything)+sin(u::anything)*cos(v::anything)=sin(u+v),
sin(u::anything)*sin(v::anything)-cos(u::anything)*cos(v::anything)=-cos(u+v),
-sin(v::anything)*cos(u::anything)-sin(u::anything)*cos(v::anything)=-sin(u+v)], simplify(-(sin(psi(t))*cos(theta(t))*cos(gamma(t))+sin(psi(t))*sin(theta(t))*sin(gamma(t))-cos(theta(t))*cos(psi(t))*sin(gamma(t))+cos(psi(t))*sin(theta(t))*cos(gamma(t)))*cos(beta(t)), size))

The result is :

(-sin(theta(t)+psi(t))*cos(gamma(t))+sin(gamma(t))*cos(theta(t)+psi(t)))*cos(beta(t))

It seems that the result is not simplified enough. I would like to obtain this expression :

cos(beta(t))*sin(gamma(t)-theta(t)-psi(t))

Have you a idea why the simplification is not conducted once more ? Do you have ideas so as to simplify the equation so as to obtain the result mentioned ?

Thanks a lot for your help

## Extracting functions of time ...

Maple

Hello,

I would like to extract from a equation only the list of variables depending of time.

eq:= x0(t)+sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))*xb-sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))*zb-sin(alpha0(t))*cos(beta0(t))*yb+cos(alpha0(t))*sin(gamma0(t))*zb+cos(alpha0(t))*cos(gamma0(t))*xb-l2*(sin(psi(t))*sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))-cos(psi(t))*sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))+sin(psi(t))*cos(alpha0(t))*cos(gamma0(t))+cos(psi(t))*cos(alpha0(t))*sin(gamma0(t)))-l3*(sin(theta(t))*sin(psi(t))*sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))+sin(theta(t))*cos(psi(t))*sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))+cos(theta(t))*sin(psi(t))*sin(alpha0(t))*sin(gamma0(t))*sin(beta0(t))-cos(theta(t))*cos(psi(t))*sin(alpha0(t))*sin(beta0(t))*cos(gamma0(t))-sin(theta(t))*sin(psi(t))*cos(alpha0(t))*sin(gamma0(t))+sin(theta(t))*cos(psi(t))*cos(alpha0(t))*cos(gamma0(t))+cos(theta(t))*sin(psi(t))*cos(alpha0(t))*cos(gamma0(t))+cos(theta(t))*cos(psi(t))*cos(alpha0(t))*sin(gamma0(t)))-xp(t) = 0;

I think the indets function should help be.

indets(lhs(eq)-rhs(eq), function(t))

The last argument of the indets is wrong but should enable to explain my need.

Thanks a lot for your help

## Transforming functions to names...

Maple

Hello,

I have this list :
T:=[alpha(t),beta(t)]

I would like to create this list automatically:

Tmod:=[alpha_,beta_]

In other words, how can I remove the 3 characters "(t)" and replace it by "_"

Do you have ideas to do so ?

Thanks a lot for your help

## Flatten a list with {}...

Maple

Hello,

How can I flatten this list ? [1,2,3, {4,5,6}]

I tried this :

Flatten([1,2,3, {4,5,6}]); But it doesn't work.

Flatten seems to work only on this kind of list [1,2,3, [4,5,6]]

and I would like to obtain this :[1,2,3,4,5,6]

Thank you for your help

P.S:

If I can use Flatten, it would be fine

﻿