MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Simple Eval Question

  • To: mathgroup at
  • Subject: [mg31889] Re: [mg31883] Simple Eval Question
  • From: BobHanlon at
  • Date: Mon, 10 Dec 2001 06:14:27 -0500 (EST)
  • Sender: owner-wri-mathgroup at

In a message dated 12/9/01 6:50:44 AM, ivo.welch at writes:

>I have a simple problem.  I want to numerically solve
>   Solve[  Integrate[ f[x,p]*g[x], {x,0,Infinity}] == V , p ]
>where f[] and g[] are defined functions, but the naive solution fails.
>W=1; g=0.5; q=0.1; V=2;
>fd[x_]:= PDF[ LogNormalDistribution[0,1],x ] ;
>Solve[ Integrate[ ((W +(x-p)*q)^g)/g * fd[x], { x, 0, Infinity } ]== V,
>p ]
>Solve::"tdep": "The equations appear to involve the variables to be solved
>for in an essentially non-algebraic way."
>The correct answer seems to be 1.5652 .  How do I ask Mathematica to tell
>this number?
>(My ultimate goal is to plot the solved p as a function of q.)

Solve is primarily for polynomials;  use FindRoot.


Clear[fd, pe, q];

fd[x_]:=Evaluate[PDF[LogNormalDistribution[0,1], x]];

W=1; g=0.5; V=2;

pe[q_] := (p /. 
              {x, 0, Infinity}] == V, 
          {p, 1.64-0.901q+1.11q^2}]);

The starting value expression (quadratic estimate of p as a function of q) is 
developed below.



data = Table[{q, pe[q]}, {q, 0.02, 0.2, 0.02}];

quadEst[q_] := Evaluate[Fit[data,{1,q,q^2},q]];

Plot[quadEst[q], {q, 0.02, 0.2}, 
     PlotStyle -> Blue,
    Epilog -> {Red, AbsolutePointSize[4], Point /@ data}];

Bob Hanlon
Chantilly, VA  USA

  • Prev by Date: Re: Simple Eval Question
  • Next by Date: Re: Re: scope all wrong? in Mathematica 4.1
  • Previous by thread: Re: Simple Eval Question
  • Next by thread: Re: Simple Eval Question