Re: assuming certain properties about variables

• To: mathgroup at smc.vnet.net
• Subject: [mg111467] Re: assuming certain properties about variables
• From: Christoph Lhotka <christoph.lhotka at univie.ac.at>
• Date: Mon, 2 Aug 2010 07:06:05 -0400 (EDT)

```hello,

there is the symbol \$Assumptions exactly for this purpose (please see my
previous response for a working definition of f, such that it will
return t, whenever it is assumed to be positive)...

best,

christoph

On 01/08/2010 10:57, Murray Eisenberg wrote:
> But once you put the restriction on the argument of f, you've told
> Mathematica not to carry out the evaluation of f unless the input
> supplied is actually positive.
>
> If now t is just a symbol, then it is not positive (and not negative,
> either) -- it's just a symbol. So why would you expect to be able to
> tell Mathematica that it's positive?  In general, Mathematica variables
> don't really have types.
>
> If it's just the particular symbol t that you want to supply to f, then
> you could do this (I'm changing your function definition for clarity) --
> not that you probably want SetDelayed (:=) instead of Set (=):
>
>     f[x_?Positive] := x^2
>     f[t] = t^2;
>
>     f[3]
> 9
>     f[t]
> t^2
>     t = -5;
>     f[t]
> f[-5]
>
>     f
>
>
> On 7/31/2010 2:40 AM, Benjamin Hell wrote:
>
>> let's say I have defined the following function:
>> f[x_?Positive] = x
>> Now I want to evaluate f with a variable t:
>> f[t]
>> As mathematica knows nothing about t, the output is f[t] instead of t.
>>
>> How can I tell mathematica, that t should be a positive number so that
>> Positive[t] evaluates true and then f[t] evaluates to t?
>> Of course this is just an example, which should present what I would
>> like to know.
>>
>

```

• Prev by Date: Re: Cannot load example data
• Next by Date: Re: Problem with Min Max between two functions
• Previous by thread: Re: assuming certain properties about variables
• Next by thread: Re: Re: assuming certain properties about variables