Rohith

65 Reputation

5 Badges

6 years, 285 days

MaplePrimes Activity


These are questions asked by Rohith

I have to Two Lists with Equal size. Each element in one List is an variable and Each element in second List is an Value of the variable corresponds to First List.

Now when Ever I call a variable I need the script to read its value and Compute.

For Example:

List1 := [v1,v2,v3,v4];
List2 := [a*b/c, a/c,a*b-2,d];

computation := v1*diff(expression,x)+v3*diff(expression,y)+ v3*v4;

but I need the script to read it as

requiredComputation :=(a*b/c)*diff(expression,x)+(a*b-2)*diff(expression,y)+ a*b-2*d;

I used to do this kind of computation in matlab using containers and map. Is there any thing similar??

let
expression := {{a*x}, {{(b*y)}/3}, {a*b}, {log(x+y)}, {3*x}};

I would like to convert the above expression as
 

requiredForm :={a*x, (b*y)/3, a*b, log(x+y), 3*x};

I observed that the function convert can do some convertion but have to use second argument + or *. which causes unstable results.

One method I found is to convert the expression to string and remove "{}" using StringTools:-Remove function.
I would like to know if its possible to do with out converting to String.

result:= convert(expression, `+`);

                                    /1      \              
  
result:= {a b} + {a x} + {3 x} + { - {b y} } + {ln(x + y)}
                                    \3      /            
  

is there anyway I can get the requiredForm

how can I get the first function acting on the symbolic expression as below(in this case log)

expr :=sin(abs(log(a+b*c)));


I need to solve for many unknown expressions. It would be great if I can able to get all functions in sequential order acting.

I got to know using op i can solve if only one function is action like below

expr := sin(a+b*c)
then op(0,expr) #gives sin

op(1,expr) # gives a+b*c


For any symbolic expression like

y = s + (a/b)*log((a+c/b)); 

I want to extract all possible sub-expressions which have one operator operating on exact two operands.
    

subExpression1 = a/b; # any operatoin(+,-,*,/ involving exact two variables)
subExpression2 = c/b;

 

Note: I need an sub-expression which is part of main expression. Above expression is an example. I have quite complex expressions where I need to extract these sub-expressions.  I need to scan my expression at all operators and see on what operands its working on
 

a+c/b # here + is acting on a and c/b clearly it is out of my interest
1 2 3 4 Page 4 of 4