Rohith

65 Reputation

5 Badges

6 years, 285 days

MaplePrimes Activity


These are questions asked by Rohith

Hi,

I am collecting the coefficients of funciton terms(like sin, cos, log,exp,abs) form the expression. I was able to collect using the function 'coeff'. Initially am getting all functions in the expression using Indets[flat(expression, funciton)] then using seq and coeff trying to get all funcitons

expression := a*sin((a+b)/(a-b))*log(a/b)/c+a*b/c+2*sin(a+b);
numOfFuncs := numelems(indets[flat](expression, function));
Funcs := convert(indets[flat](Expression, function), list);

funcCoeffList := [seq(coeff(Expression, Funcs[i]), i = 1 .. numOfFuncs )];

funcCoeffList := [a*sin((a+b)/(a-b))/c, a*ln(a/b)/c, 2]

When there are terms of form funtion*function I would like to collect the coefficient for function*function as one term rather than two terms. simply I want to write a code which reads the functions having product between them as one term gives me back the coefficient.

Looking for the output as : [a/c,2] or [a/c,1,2];

I am working on expressions with multiple variables ranging between 3 and 10. Each variable has a range for its value. Now I want to find out the possible combination of variable values satisfying expression value which is in certain interval.

I came across how one can find maximum and minimum value of the expression. But, My goal is to find all possible combinations of variables for the given range of expresison value.

f:=2*a*b-3*a-2*b-c;
minimize(f, a = 0 .. 10, b = 1 .. 5, c = 0 .. 1, location);=-13, {[{a = 10, b = 1, c = 1}, -13]}

maximize(f, a = 0 .. 10, b = 1 .. 5, c = 0 .. 1, location); = 60, {[{a = 10, b = 5, c = 0}, 60]}

But when I have a certain range for expression f [15..30].->f>=15 and f<=30

Is there a way to find out all combinations of variables with in this given range??

I have just started to study on Optimization and tried with QPSolve for optimal solution. I observed that QPSolve cannot take variable intervals, but takes inequalities as cnsts.

Optimization:-Interactive(f>=15,f<=30, a=amin..amax,b=bmin..bmax,c=cmin..cmax)

I am able to find the minimum and max possible combination but not all with in the range


EDIT: My final aim is to find out all possible combinations which do not satisfy the given condition. All combinations which fails the condition f>=15,f<=30

Hi, I have been looking at various questions which are similar. But, I could not exactly what I am looking for.

https://www.mapleprimes.com/questions/99679-Removing-Elements-In-A-List

In the above link it is useful to remove elemets of specific type(identical in two lists). I am looking for removing elements from list with specific Index.

L := [1,1,a,c,1];
indexList:=[3,5]

Now based on IndexList I would like to remove the elements from L. That is I want to delete L[IndexList[1]] and L[indexList[2]]. I have tried to do it using

remove(has, L, L[indexList]);  

It is working when there are no identitical elements. In my case it fails to delete exact exlemens.

subs(seq(A[indexList[i]] = NULL, i = 1 .. nops(indexList)), A); Both are working in same way. Not suitable when having identical elements in a list
How one could delete(remove) elements based on index??

I am curious how one can fine the whattype of operation in expression when two variables are actually doing difference or division operation

like

whattype(a-b);
whattype(a/b);

is there any better method to find out actually for all five operations exactly.

1. a-b;  should tell the operation is difference(substraction(`-`))
2. a+b; should tell the operation is addition(`+`)
3. a*b;  should tell the operation is multiplication(`*`)
4. a/b;  should tell the operation is division(`/`)
5. a^b;  should tell the operation is power(`^`)

I understood that maple is reading a-b as a+(-b) and same a/b as a*(1/b). but, for programing it is very much comfortable to know exactly the operation. Especially when solving partial differentiation it is easy if I know exactly.

would be very grateful if I can get this thing solved. Any suggestions and coments are welcomed and thanks in advance
 

restart;
sign(-v1+a);
sign(-V1+a);

my respective outputs are

1
-1

I cannot understand what is the difference between using lowercase and uppercase variable. Could Someone Explain me please.

1 2 3 4 Page 3 of 4