## 345 Reputation

10 years, 196 days

## Understanding a package using local vari...

Maple

Hello,

I would to understand a code that I have where the structure of packages are often using a local variable in a particular way. A variable local _DO_CONSTRAINT with the same name as the procedure DO_CONSTRAINT is created.

The code is the following :

module ()
local _DO_CONSTRAINT;
export DO_CONSTRAINT;
option package;

_DO_CONSTRAINT:=proc (phi::list, varslist::list)
table([obj = CONSTRAINT, expr = phi, vars = varslist])
end proc

DO_CONSTRAINT:=proc (phi::{list, scalar}, vars::{list, scalar})
if type(phi, scalar) and type(vars, scalar) then
_DO_CONSTRAINT([phi], [vars])
elif type(phi, list) and type(vars, list) and nops(phi) = nops(vars) then
_DO_CONSTRAINT(phi, vars)
else ERROR("The number of expressions <phi> and variables <vars> are not equal")
end if
end proc

end module

Question :
1) It seems me that this technique enable to adapt the procedure  (DO_CONSTRAINT) to different types of inputs that we can try on it (lists or scalars). Do I right ? May you give me more informations on how it works ?
2) Is it the only possibility to do this ? In other words, is there a possibility to make a similar code and also concise but without using this local variable ?

Thanks a lot for your help.

## Solving trigonometric equations with con...

Maple

Hello,

I'm a quiet perplexed  in front of the result of the function solve for trigonometric equations.

The result of this equation solve(cos(x)=a,x); is arccos(a) and the solution -arcos(a) is not given.

In order to have the other solution (-arccos(a)), I try this solve({cos(x)=a,x>Pi/2,x<3*(Pi/2)},x); but without success.

1) How can I obtain all the solution with the solve function with trigonometric equation and only symbolic equations (no numerical value)?

2) Is it possible to obtain a specific solution by defining the definition domain of the variables in the equation ?

Thanks a lot for your help

## solving numerical numerical equations in...

Maple

Hello,

I have to solve numerical trogonometric equations such as :
solve(.3707752782+.1499320455*sin(theta[4](t))+.1117559025*cos(theta[4](t))=0.5,theta[4](t));

But, after, I would like to keep only the solution defined in a specific interval such as : [0,Pi]

1) Is there a possibility to define options with the function solve to limit the solutions belonging to a specific interval ?

2) Otherwise, may you help me to make an systematic process to choose a solution in a specific interval ?

## use both slider and textarea to control ...

Maple

Hello,

With the Explore function, the use of sliders is very convenient to test the sensibility of a result with regard to a parameter.

However, It is also very convenient to specify a accurate value to a parameter.

Consequently, i would like to combine the use of slider (usually defined in the default mode) with the use of the option "controller=textarea".

Do you have ideas to combine the use of slider and the use of textarea for the definition of the parameters in the Explore function ?

Here you can find a example of the theta4 function depending of 8 parameters (xp3,xp4,zp3,zp4,phi3,phi4, gamma3, gamma4).

TestExplore_4.mw

I manage to use either the sliders or the textarea option but not both.

## Use of Explore function on a quiet big t...

Maple

Hello,

I try to use the Explore function on a trigonometric expressions depending of 8 parameters. My aim is to study the influence of these parameters on the results.

However, i receive an error message and I didn't manage to troubleshoot it.

May you have a look of an extract of my code and see if you see the mistake ?

Thanks a lot for your help.

 2 3 4 5 6 7 8 Last Page 4 of 31
﻿