Thread Subject: log with syms variables?

Subject: log with syms variables?

From: David Doria

Date: 21 Feb, 2008 14:39:02

Message: 1 of 3

if i do this

syms a b;
simplify(log(a*b))

i get log(a*b)

if i do this:

syms a b positive;
simplify(log(a*b))

i get log(a) + log(b)

The later is what I would like. Is it necessary to declare
the symbolic variables as 'positive'? Or am I doing
something else wrong?

Thanks,

Dave

Subject: log with syms variables?

From: David Doria

Date: 22 Feb, 2008 20:01:02

Message: 2 of 3

Can someone at least confirm this is the way it works?

Thanks,

Dave

"David Doria" <daviddoria@gmail.com> wrote in message
<fpk2e6$4db$1@fred.mathworks.com>...
> if i do this
>
> syms a b;
> simplify(log(a*b))
>
> i get log(a*b)
>
> if i do this:
>
> syms a b positive;
> simplify(log(a*b))
>
> i get log(a) + log(b)
>
> The later is what I would like. Is it necessary to declare
> the symbolic variables as 'positive'? Or am I doing
> something else wrong?
>
> Thanks,
>
> Dave

Subject: log with syms variables?

From: Arthur G

Date: 23 Feb, 2008 00:42:44

Message: 3 of 3

On 2008-02-22 15:01:02 -0500, "David Doria" <daviddoria@gmail.com> said:
> Can someone at least confirm this is the way it works?

You pretty much answered your own question. If your example isn't
enough "proof" that you need to declare variables as positive to
simplify as you desire, consider the following:

log( (-1)*(-1) ) = log(1) = 0

but

log(-1) = i*pi

so

log(-1) + log(-1) = 2i*pi


>
> Thanks,
>
> Dave
>
> "David Doria" <daviddoria@gmail.com> wrote in message
> <fpk2e6$4db$1@fred.mathworks.com>...
>> if i do this
>>
>> syms a b;
>> simplify(log(a*b))
>>
>> i get log(a*b)
>>
>> if i do this:
>>
>> syms a b positive;
>> simplify(log(a*b))
>>
>> i get log(a) + log(b)
>>
>> The later is what I would like. Is it necessary to declare
>> the symbolic variables as 'positive'? Or am I doing
>> something else wrong?
>>
>> Thanks,
>>
>> Dave


Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com