## 12 Reputation

18 years, 96 days

## Argument Extraction (again)...

Thanks again. The trick you proposed is perfect for this case. I wanted a more generic function which deals with any kind of argument like v:=(1+I)*exp(I*theta). With the tricks you gave me I wrote my function. It first extract the coefficient multiplying the exponential in the variable x1 by replacing the exp term by 1 like this: x1:=subsindets(v,'specfunc( anything, exp)',1); It then extract the exp term like this: x2:=indets(v,'specfunc(anything,exp)'); It returns the argument by summing the argument of both x1 and x2 argument(x1)+ Im(op(x2[1]));

## Argument Extraction (again)...

Thanks again. The trick you proposed is perfect for this case. I wanted a more generic function which deals with any kind of argument like v:=(1+I)*exp(I*theta). With the tricks you gave me I wrote my function. It first extract the coefficient multiplying the exponential in the variable x1 by replacing the exp term by 1 like this: x1:=subsindets(v,'specfunc( anything, exp)',1); It then extract the exp term like this: x2:=indets(v,'specfunc(anything,exp)'); It returns the argument by summing the argument of both x1 and x2 argument(x1)+ Im(op(x2[1]));
 Page 1 of 1
﻿