Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9486 > unrolled thread

Evaluating Exponential functions

Started byleigh pascoe <leigh@evry.inserm.fr>
First post2012-04-06 10:08 +0000
Last post2012-04-09 09:35 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Evaluating Exponential functions leigh pascoe <leigh@evry.inserm.fr> - 2012-04-06 10:08 +0000
    Re: Evaluating Exponential functions David Bailey <dave@removedbailey.co.uk> - 2012-04-09 09:35 +0000

#9486 — Evaluating Exponential functions

Fromleigh pascoe <leigh@evry.inserm.fr>
Date2012-04-06 10:08 +0000
SubjectEvaluating Exponential functions
Message-ID<jlmfak$mhr$1@smc.vnet.net>
Dear Experts,

I am working with an age specific risk function

inc1[x_, M_, \[Tau]_, \[Phi]_] :=
 M/\[Tau] \[Phi]^M E^(-(x/\[Tau])) (1 - E^(-(x/\[Tau])))^(M - 1)

where x is the age and M, tau and Phi are constants. This function
plots, can be integrated numerically and Manipulated easily in Mathematica.

I am also interested in the slightly more complicated function

inc3[x, M, \[Tau], \[Phi], \[Tau]2] := (
  E^(-(x/\[Tau])) (1 - E^(-(x/\[Tau])))^(-2 +
    M) (1 - E^(-(x/\[Tau]2))) (-1 + M) \[Phi]^M)/\[Tau] + (
  E^(-(x/\[Tau]2)) (1 - E^(-(x/\[Tau])))^(-1 + M) \[Phi]^M)/\[Tau]2

This function has an additional parameter tau2. When tau2==tau the two
functions should be identical. However the second function will not
Plot, Integrate or be Manipulated in Mathematica. In fact it will not
even evaluate for specific values of the parameters. e.g.

In[10]:= inc1[10, 12, 8, .65]
inc3[10, 12, 8, .65, 8]

Out[10]= 0.0000596328

Out[11]= inc3[10, 12, 8, 0.65, 8]

The output for the two functions should be identical. What am I not
understanding here? How can I define this function so that I can
numerically integrate it and Plot its values over a range of x.

Thanks for any suggestions.

LP

[toc] | [next] | [standalone]


#9524

FromDavid Bailey <dave@removedbailey.co.uk>
Date2012-04-09 09:35 +0000
Message-ID<jluagp$rr6$1@smc.vnet.net>
In reply to#9486
On 06/04/2012 11:08, leigh pascoe wrote:
> Dear Experts,
>
> I am working with an age specific risk function
>
> inc1[x_, M_, \[Tau]_, \[Phi]_] :=
>   M/\[Tau] \[Phi]^M E^(-(x/\[Tau])) (1 - E^(-(x/\[Tau])))^(M - 1)
>
> where x is the age and M, tau and Phi are constants. This function
> plots, can be integrated numerically and Manipulated easily in Mathematica.
>
> I am also interested in the slightly more complicated function
>
> inc3[x, M, \[Tau], \[Phi], \[Tau]2] := (
>    E^(-(x/\[Tau])) (1 - E^(-(x/\[Tau])))^(-2 +
>      M) (1 - E^(-(x/\[Tau]2))) (-1 + M) \[Phi]^M)/\[Tau] + (
>    E^(-(x/\[Tau]2)) (1 - E^(-(x/\[Tau])))^(-1 + M) \[Phi]^M)/\[Tau]2
>
> This function has an additional parameter tau2. When tau2==tau the two
> functions should be identical. However the second function will not
> Plot, Integrate or be Manipulated in Mathematica. In fact it will not
> even evaluate for specific values of the parameters. e.g.
>
> In[10]:= inc1[10, 12, 8, .65]
> inc3[10, 12, 8, .65, 8]
>
> Out[10]= 0.0000596328
>
> Out[11]= inc3[10, 12, 8, 0.65, 8]
>
> The output for the two functions should be identical. What am I not
> understanding here? How can I define this function so that I can
> numerically integrate it and Plot its values over a range of x.
>
> Thanks for any suggestions.
>
> LP
>

You have missed out the _ characters in the definition of inc3 - so it 
doesn't match anything useful. You need:

inc3[x_, M_, \[Tau]_, \[Phi]_, \[Tau]2_] .....

David Bailey
http://www.dbaileyconsultancy.co.uk

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web