# Trying to solve for an unknown function, numerically or otherwise

I would like so find the function $n(z)$ that solves the following equation:

$$n(z) = \frac{.2 + .24 z \int_1^{\infty} \frac{n(z)}{z^2}dz}{.5 + .24 z \int_1^{\infty} \frac{n(z)}{z^2}dz}$$

That is, $n(z)$ is defined in terms of it's own integral. Even if there's no nice analytic solution to this, Numerical approximations of some sort are good enough. In fact this is just a parametrized instance of a more general equation I am interested in. What methods should I be using to find such a solution? Does Mathematica or Matlab has nice built in routines for this kind of thing?

For your further information I am interested only in $n(z)$ on $[1,\infty]$, and it is required to be between 0 and 1, so those integrals lie between 0 and 1, so $n(z)$ should be monotonically increasing. It seems like it should be well behaved, but on the face of it Mathematica doesn't like it.

Background: it is the steady state of a dynamic system in a network; think epidemic diffusion. $n(z)$ is the infection rate among agents with z links, and in the steady state it is

$$n(z) = (g + (1-g)t v z )/(g + r + (1-g) t v z ),$$ where $g$ is the new infection rate, $r$ is the cure rate,and $v$ is the new infections from your peers in a networks, and $f(z)$ is the distribution of that networks; the proportion of peers withg $z$ links. One such distribution often of interest is power-law, which is

$$f(z) = 2 z^{-3}$$ and t is the infection rate among a random peer, given by $$t = \int_1^{\infty} z n(z) f(z)dz,$$ which, along with a paramtetrization of the above rates, gave the problem above.

Other distributions of interest are geometric, where $f(z) = Log(4) 2^{-z}$. So we are solving for the steady state level of infection among guys with z peers.

-

Well you know how $n(z)$ looks like. Note that $\displaystyle \int_{1}^{\infty} \frac{n(z)}{z^2} dz$ is just a number. Call it $a$.

So now we have

$$n(z) = \frac{0.2+0.24 a z}{0.5+0.24 a z} = 1 - \frac{0.3}{0.5+0.24 a z}$$

where $a = \displaystyle \int_{1}^{\infty} \frac{n(z)}{z^2} dz$.

Use the above equation to get an equation solely in $a$ which you can solve for numerically.

I have done the solving part below.

$a = \displaystyle \int_{1}^{\infty} \frac{n(z)}{z^2} dz = \int_{1}^{\infty} \frac{1}{z^2} dz - \int_{1}^{\infty} \frac{0.3}{0.5 z^2 + 0.24 a z^3} dz = 1 - \int_{1}^{\infty} \frac{15}{25 z^2 + 12 a z^3} dz$

$$a = \frac{2}{5} + \frac{36}{125}a \log(\frac{25}{12a}+1)$$

You can now try to solve this numerically or plug it in mathematica as I did, which gives me $a \approx 0.673338$.

As you expected, $a \in (0,1)$.

So the function now is $$n(z) \approx 1 - \frac{15}{25+8.080056z} = \frac{10+8.080056z}{25+8.080056z}$$

and the function $n(z) \in (0,1)$, $\forall z \in \mathbb{R}^+$. In fact when $z \in [1,\infty)$, $n(z) \in (\frac{6}{11},1)$.

-
Great answer. This is also very helpful for my more general problem, which I won't expound on here, save to say that the .2, .24 and .5 are products of parameters, and the $z^2$ is a particular distribution - so long as I don't ask Mathematica to treat everything symbolically, this method extends nicely to other instances of the parameters and other distributions. So Numerically, I think I can meet all my needs. Thanks! – Dennis Feb 9 '11 at 23:08
@Dennis: Nice problem and I felt happy when I wrote down the solution :). Once I found out the solution, I said to myself... "Wow! Cool solution!" :). Could you throw light on the more general problem? I am just asking out of my own interest. If the problem is too complicated or requires a lot of explanation or if you do not wish to reveal, no problem. – user17762 Feb 9 '11 at 23:18
Well it is the steady state of a dynamic system in a network; think epidemic diffusion. n(z) is the infection rate among agents with z links, and it follows the following process: – Dennis Feb 9 '11 at 23:24
@Dennis: Thanks for throwing light on the general problem in the question. – user17762 Feb 10 '11 at 1:13