Re: Mathematica Question
- To: mathgroup at smc.vnet.net
- Subject: [mg66448] Re: Mathematica Question
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Sat, 13 May 2006 02:42:37 -0400 (EDT)
- Organization: The University of Western Australia
- References: <e419bs$h5o$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <e419bs$h5o$1 at smc.vnet.net>, "Bharat Bhole" <bbhole at gmail.com> wrote: > Thanks very much for all those who replied. I really appreciate it. > Unfortunately for the more complicated function that I had, the procedure > did not work. It just returned the expression back to me. Perhaps, this is > because the expression is not negative as I was hoping it to be, or perhaps > because Mathematica could not do it. I don't know which one. I would guess that Mathematica could not do it -- nor is it likely that it can be done in closed form. > Just for > information I am writing down the expression I wanted to check this for. > > Suppose U[p,d,rl,rh] = (Log[1+p*d*rh] / Log[1+p*d*rl]) where, 0.2<p<1, > 2<d<20, rl > rh > 0. I wanted to find whether the second partial derivative > of this with respect to d is negative. Also, if cross partial with respect > to (d,p) is negative at least for large enough 'p'. For small, p, it can be > seen the ross partial can be positive or negative, which explains why > Mathematica just returns the expression. Are you trying to determine the maximum of U[p,d,rl,rh] using the second derivative test? For your function, u[p_, d_, rl_, rh_] = Log[d p rh + 1]/Log[d p rl + 1]; you can search for the maximum over the domain depending on rl and rh using NMaximize: nmax[rl_, rh_] := NMaximize[{u[p,d,rl,rh], 0.2<p< 1, 2<d<20}, {p, d}] For example, nmax[7, 3] {0.8306876783749496, {d -> 20., p -> 1.}} and this result shows that the maximum is on the boundary of your region. Also, I should point out that you can (and should) reduce the number of parameters in your expression by scaling the variables. For example, since p, d > 0, replace p d -> x where 0.4 < x < 20. Going further, essentially your function is Log[1 + y] / Log[1 + a y] where y = p d rh > 0 and a = rl/rh > 1. Now, clearly for any fixed a, the maximum of this function occurs for the maximum allowed value of y. However, Maximize does not solve even this much simpler problem, even for fixed a. For example, Maximize[{Log[1 + y]/Log[1 + 2 y], 0 < y < 10}, y] Nevertheless, N[%] gives the numerical solution. Cheers, Paul _______________________________________________________________________ Paul Abbott Phone: 61 8 6488 2734 School of Physics, M013 Fax: +61 8 6488 1014 The University of Western Australia (CRICOS Provider No 00126G) AUSTRALIA http://physics.uwa.edu.au/~paul