Re: solving a system of equations involving numerical integration
- To: mathgroup at smc.vnet.net
- Subject: [mg42568] Re: solving a system of equations involving numerical integration
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 16 Jul 2003 09:13:31 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <bf097l$vr$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, your code below include serious syntax errors. It is a wonder, that it run at all. However With[{NIntegrate[...},...] is perfect nonsense. With[] is to define a temporal symbolic constant for the body of the With[] statement i.e. With[{plotPnts=12}, Plot3D[Sin[x*y],{x,0,Pi},{y,0,Pi},PlotPoints->plotPnts] ] Regards Jens Vladimira Ilieva wrote: > > I am trying to find the solution to a system of two equations in two > unknowns. The difficulty comes from the fact that the two equations involve > numerical integration. > > > > Could you please let me know what you think about the code above? I have > been running this code for hours with no response from Mathematica yet. > > > > Thanks! > > > > Clear[f]; > > Clear[g]; > > Clear[a]; > > Clear[b]; > > > > f[a_?NumericQ, b_?NumericQ]:= > > > > With[{NIntegrate[(1/(100+5x+5y)^0.5)*[ExponenitalE]^(((Log[x] - Log[a] - > > > > 0.03)^2/2) - ((Log[y] - Log[b] - 0.02)^2/2))/(2*Pi*y) , {x, 0.001, ∞}, > > > > {y, 0.001, ∞}, Method -> Trapezoidal, MinRecursion -> 3, MaxRecursion -> > > > > 10]} /; ! (a == 0) || ! (b == 0)]; > > > > > > g[a_?NumericQ, b_NumericQ] := > > > > With[{NIntegrate[(1/(100 + 5x + 5y)^0.5)*[ExponentialE]^(((Log[x] - Log[a] - > > > > 0.03)^2/2) - ((Log[y] - Log[b] - 0.02)^2/2))/(2*Pi*x), {x, 0.001, ∞}, {y, > > > > 0.001, ∞}, Method -> Trapezoidal, MinRecursion -> 3, MaxRecursion -> 10]} > /; > > > > ! (a == 0) || ! (b == 0)]; > > > > > > FindRoot[{a == 0.95*f[a, b]*(100 + 5*a + 5*b)^0.5 , b == 0.95*g[a, b]*(100 + > 5*a + 5*b)^0.5}, {a, 1}, {b, 1}] > >