Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8332
| From | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Problem using Solve or Nsolve |
| Date | 2012-02-04 11:31 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jgj4vc$mvl$1@smc.vnet.net> (permalink) |
| References | <201202030710.CAA12005@smc.vnet.net> |
This may be more efficient:
Clear[a, f, g]
f[x_] = (4^x)*E^-4/Gamma[x + 1];
g = g /. First@NDSolve[{g'[x] == f[x], g[0] == 0}, g, {x, 0, 5}];
a = a /. FindRoot[g[a] == 0.5, {a, 2}]
{g@a, NIntegrate[f@x, {x, 0, a}]}
3.86298
{0.5, 0.5}
You can solve for other values without using NDSolve again:
FindRoot[g[x] == 0.3, {x, 2}]
{x -> 2.85784}
Bobby
On Fri, 03 Feb 2012 01:10:12 -0600, droopy <tototo@yopmail.com> wrote:
> Dear all,
>
> I am a new user of mathematica and i am trying to find the upper limit
> of an integrate such as it is equal to a certain value.
>
> Therefore, for the moment i did :
> f = (4^x)*E^-4/Gamma[x + 1]; Reduce[{Integrate[f, {x, 0, A}] == 0.5},
> {A}]
>
> But it doesn't work, I did the same thing with Solve :
> Solve[Integrate[f, {x, 0, A}] == 0.5, A]
> but it doesn't work.
>
> The only way that i found to obtain a solution was with
> FindRoot[Integrate[f, {x, 0, A}] == 0.5, {A, 2}]
>
> Do you have a solution?
>
> Thanks !
>
--
DrMajorBob@yahoo.com
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Problem using Solve or Nsolve DrMajorBob <btreat1@austin.rr.com> - 2012-02-04 11:31 +0000
csiph-web