Bendesarts

450 Reputation

10 Badges

14 years, 173 days

MaplePrimes Activity


These are replies submitted by Bendesarts

Have you tried the latex function ?

As fat I concerned, I launch the latex function.

Next, I copy/ paste in word equipped with Mathtype and it runs.

@acer 

Thanks a lot for your feedback and very interesting answer.

However, I would be very interested if you have a suggestion of code which enable the simplication without a prior analysis of the variables (here x=[p,g,th]) that you want to be allowed to be combined.

In other words, I would be very interested by a more general code as you told at the end of your posts. I only hope that the simplification could be conducted with a time inferior to 10 min.

Thanks a lot for your help

For the 3bar mechanism, have you developped the mechanical equations of the kinematics ? And if yes, is it possible for you to share it ?

@acer 

 

Perfect! It works!

I just find it something a bit curious in the path linked to the fact I have some antislash and slash (second line) and not only slash for the definition of the path. But, it is not important. I could create my package and use it.

Thanks a lot

 

@acer

 

 

 

Thank you for your help.

I have still an issue.

I think there is something wrong in the way of defining the path.

Do you have others ideas ?

Thank you in advance

 

 

When I launch the save function to store the package, I receive this mistake :

 

Can you help me so as to well use this function "save" ?

@Markiyan Hirnyk 

1) where is located (which folder ?) the package that I use the save function  ? save(NamePackage,cat(libname[1],"/NamePackage.mla"); 

2) After having used the save function, is the custom package always present in the libname ? If I want to remove it, how can I do it ?

3) When I launch the save function, I receive this mistake :

 

 

Do you have some ideas about this error ? How can I correct it ?

@Markiyan Hirnyk 

Thanks a lot for your help.

So the steps I'm planning to do are the following :

0) Adding at the begin of my worksheet the call of the package LibrariesTools

with(LibraryTools):

1) wrapping my procedures in a table so as to create the package

NamePackage:=table();
NamePackage[NameProcedure1]:= proc(...)
end proc:

2) saving the package, locating them with the other packages

save(NamePackage,cat(libname[1],"/NamePackage.mla");

--> For this step, I have 2 questions : where is located the package that I have save ? Can I see it in the Maple folder with windows explorer ?

--> After having used the save function, is the custom package always present in the libname ? If I want to remove it, how can I do it ?

3) Calling the package in a worksheet

with(NamePackage);

May you have a look to my questions? and let me know if you thing that I have forgotten something important.

Thanks a lot for your help

Thank you for your feedback.

But, is it possible to convert in a easy way your worksheet with components to a worksheet with classic maple input ?

 

Hello,

I find your application very interesting. But, is it possible to obtain this worksheet with only classic maple input ? In fact, I prefer using classic maple input so as to see more clearly the code.

Thank you.

@Kitonum 

Here my attempt to make a procedure to automatize the simplification of this kind of trigonometric equation :

eq_liaison:=sin(gamma0(t))*cos(beta0(t)) = -(sin(gamma[1](t))*sin(psi[1](t))*sin(theta[1](t))-sin(gamma[1](t))*cos(theta[1](t))*cos(psi[1](t))+cos(gamma[1](t))*sin(psi[1](t))*cos(theta[1](t))+cos(gamma[1](t))*cos(psi[1](t))*sin(theta[1](t)))*cos(beta[1](t));

Initialisation
restart:
with(LinearAlgebra):
with(Student[MultivariateCalculus]):
with(plots):
with(MathML):
with(ListTools):
constants:= ({constants} minus {gamma})[]:
`evalf/gamma`:= proc() end proc:
`evalf/constant/gamma`:= proc() end proc:
unprotect(gamma);
Angular Constraint equations
eq_liaison:=sin(gamma0(t))*cos(beta0(t)) = -(sin(gamma[1](t))*sin(psi[1](t))*sin(theta[1](t))-sin(gamma[1](t))*cos(theta[1](t))*cos(psi[1](t))+cos(gamma[1](t))*sin(psi[1](t))*cos(theta[1](t))+cos(gamma[1](t))*cos(psi[1](t))*sin(theta[1](t)))*cos(beta[1](t)); 
Traitement
TrigoTransform2:= proc(Eq)
local S,S1,tt,pp,Eq2,ListVariables,ListVariablesMod,Subs,size,rhsEq2,lhsEq2;
#Construit une liste à plat#
ListVariables:=indets(Eq, function(identical(t)));
ListVariables:=[op(ListVariables)];
ListVariablesMod:=map(f->cat(op(0,f),_),ListVariables);
Subs:=ListVariables=~ListVariablesMod;
#Variables Changement#
Eq2:=Eq:
print("Equation traitée=",Eq2): 
Eq2:=subs(Subs, Eq2);
print("Equation après subs=",Eq2): 
#Trigonometric transformations#
lhsEq2:=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(lhs(Eq2), size));
print("Equation lhsEq2 première analyse=",lhsEq2):
rhsEq2:=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(rhs(Eq2), size));
print("Equation rhsEq2 première analyse=",rhsEq2):
try
lhsEq2:=(trigsubs(2*combine(lhsEq2))[])/2;
print("Equation lhsEq2=",lhsEq2):
catch:
lhsEq2:=lhs(Eq2);
end try;
try
rhsEq2:=(trigsubs(-2*combine(rhsEq2))[])/2;
print("Equation rhsEq2=",rhsEq2):
catch:
rhsEq2:=rhs(Eq2);
end try;
Eq2:= lhsEq2=rhsEq2;
#Variables Changement#
Eq2:=subs(map(t->rhs(t)=lhs(t),Subs),Eq2) 
end proc:
TrigoTransform2(eq_liaison);

Strangely, I noticed that the simplification is done only if there is a minus before the combine function. The simplification works but the result is wrong because i didn't obtain the good sign.

Can you help me to correct this point ? and to make the code more general so as to make this simplification in a automatic way ?

Thanks a lot for your help.

Here my attempt to make a procedure to automatize the simplification of this kind of trigonometric equation :

eq_liaison:=sin(gamma0(t))*cos(beta0(t)) = -(sin(gamma[1](t))*sin(psi[1](t))*sin(theta[1](t))-sin(gamma[1](t))*cos(theta[1](t))*cos(psi[1](t))+cos(gamma[1](t))*sin(psi[1](t))*cos(theta[1](t))+cos(gamma[1](t))*cos(psi[1](t))*sin(theta[1](t)))*cos(beta[1](t));

Initialisation
restart:
with(LinearAlgebra):
with(Student[MultivariateCalculus]):
with(plots):
with(MathML):
with(ListTools):
constants:= ({constants} minus {gamma})[]:
`evalf/gamma`:= proc() end proc:
`evalf/constant/gamma`:= proc() end proc:
unprotect(gamma);
Angular Constraint equations
eq_liaison:=sin(gamma0(t))*cos(beta0(t)) = -(sin(gamma[1](t))*sin(psi[1](t))*sin(theta[1](t))-sin(gamma[1](t))*cos(theta[1](t))*cos(psi[1](t))+cos(gamma[1](t))*sin(psi[1](t))*cos(theta[1](t))+cos(gamma[1](t))*cos(psi[1](t))*sin(theta[1](t)))*cos(beta[1](t));
Traitement
TrigoTransform2:= proc(Eq)
local S,S1,tt,pp,Eq2,ListVariables,ListVariablesMod,Subs,size,rhsEq2,lhsEq2;
#Construit une liste à plat#
ListVariables:=indets(Eq, function(identical(t)));
ListVariables:=[op(ListVariables)];
ListVariablesMod:=map(f->cat(op(0,f),_),ListVariables);
Subs:=ListVariables=~ListVariablesMod;
#Variables Changement#
Eq2:=Eq:
print("Equation traitée=",Eq2):
Eq2:=subs(Subs, Eq2);
print("Equation après subs=",Eq2):
#Trigonometric transformations#
lhsEq2:=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(lhs(Eq2), size));
print("Equation lhsEq2 première analyse=",lhsEq2):
rhsEq2:=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(rhs(Eq2), size));
print("Equation rhsEq2 première analyse=",rhsEq2):
try
lhsEq2:=(trigsubs(2*combine(lhsEq2))[])/2;
print("Equation lhsEq2=",lhsEq2):
catch:
lhsEq2:=lhs(Eq2);
end try;
try
rhsEq2:=(trigsubs(-2*combine(rhsEq2))[])/2;
print("Equation rhsEq2=",rhsEq2):
catch:
rhsEq2:=rhs(Eq2);
end try;
Eq2:= lhsEq2=rhsEq2;
#Variables Changement#
Eq2:=subs(map(t->rhs(t)=lhs(t),Subs),Eq2)
end proc:
TrigoTransform2(eq_liaison);

Strangely, I noticed that the simplification is done only if there is a minus before the combine function. The simplification works but the result is wrong because i didn't obtain the good sign.

Can you help me to correct this point ? and to make the code more general so as to make this simplification in a automatic way ?

Thanks a lot for your help.

@Markiyan Hirnyk 

Great !

Perfect, it is exactly what I'm looking for, but I used a bad syntax before.

Thank you.

@Kitonum 

Thanks a lot for your help.

You answer to my need for my current mechanical problem.

However as I explain in the post :

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

I often have to deal with :
- constraint equations for vectorial closure,
- constraint equations for angular closure.

Consequently, I'm really interested to make, as I can do with your help for the constraint equations for vectorial closure, also a procedure to simplify the constraint equations for angular closure with a more general way.

Can you help me to build this procedure ?

The idea is to build a general procedure so as to simplify the trigonometric equations that we can met when dealing mechanical constraint equations.

Thanks a lot for your help

@Kitonum 

Thanks a lot for your help

Here a small example to show what I try to make.

Jacobienne.mw

For the x axis, the labels are well written but not for the y axis.

3 4 5 6 7 8 9 Last Page 5 of 17