To apply log transform on a variavble equation and transform to log variable the equation.

Look for a function where I can use it for a log transform on a equation and it will output the equation with log transformed variables.
For example: f=x^2*y^2
log transform on this will result in equation of 2a+2b where a and b are defined by x=e^a and y=e^b.
Similarly the inverse log transform can be used on equations.
If anyone of know any information please send me.
-Pavan

Answers (1)

Symbolic toolbox.
However, your proposed transform is not correct.
Suppose x = -1 and y = e^3, then x^2*y^2 = 1*(e^3)^2 = e^6, and ln(e^6) is 6.
If x=e^a and x=-1 then -1=e^a, ln(-1)=a, a = I*Pi; If y=e^b and y=e^3 then e^3=e^b, b=3; 2*a+2*b = 2*Pi*I + 2*3 = 2*Pi*I + 6
We can see, though, that 6 is not 2*Pi*I + 6. The transform is thus at most valid over non-negative real values.

6 Comments

Walter I was looking into the question and I'm stuck with a problem
log(exp(2*a + 2*b)) , how can I force MuPad to simplify into just 2*a+2*b ?
Paulo, you would have to add assumptions about the range and data type of the values.
For example, in Maple if you had ln(f) = ln(x^2*y^2)
then,
simplify(%) assuming nonnegative
would give
ln(f) = 2*ln(x)+2*ln(y)
I just did this
a = sym('a','positive')
b = sym('b','positive')
and MuPad simplifies to 2*a+2*b :)
This goes into what Walter said about non-negative real values :)
thanks Walter, it's great to learn so much by trying to solve these problems :)
Here X is a non negative value and Paulo Silva's solution will work if function is simple product but what can be done in case where the function is a sum of product terms then how to apply the log transform and after some operation, need to apply the inverse transform too?
Maple is able to handle assumptions about expressions; I suspect MUPAD is as well.

Sign in to comment.

Products

Asked:

on 31 Mar 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!