0
$\begingroup$

I have a function defined in terms of data points and I need to take the derivative of this function and use it in the Newton Raphson iteration.

The function f below is obtained through a series of definitions -

$$a = \frac{T_{\text{top}} - T_{\text{bottom}}}{\ln P_{\text{top}} - \ln P_{\text{bottom}}} $$

All values are known i.e. $T_{\text{top}}$, $T_{\text{bottom}}$, $P_{\text{top}}$, $P_{\text{bottom}}$

$$b = T_{\text{top}} - a \cdot \ln P_{\text{top}} $$

$$ pln = \ln P_{\text{bottom}} + \frac{\theta - \theta_{\text{bottom}}}{\theta_{\text{top}} - \theta_{\text{bottom}}} * (\ln P_{\text{top}} - \ln P_{\text{bottom}}) $$

pln is the initial guess value for pressure in logarithmic space for the Newton Raphson iteration.

Here $\theta$, $\theta_{\text{top}}$, $\theta_{\text{bottom}}$ are all known

Finally

$$ ekp = e^{pln}$$

$$ t = a * p ln + b $$

$$ f = t * ekp $$

$$ \frac{df}{dp} = ekp (t -a) $$

So I need to derive the final expression for Newton Raphson iteration but I would like to have some idea on how to get df/dp since all I have are data points. All I have are discrete measurements of temperature and pressure. Any clue to get to the final derivative will be appreciated as I have to modify a and b to get a different df/dp. Some of these values are constants(such as theta without a subscript) and those will be zero. But what about the others ?

$\endgroup$
4
  • 1
    $\begingroup$ The equations themselves do not really matter: what matters is what is known and what is unknown. Can you make that more explicit in your case? $\endgroup$
    – Ian
    Feb 15, 2018 at 16:36
  • $\begingroup$ What are you using Newton-Raphson for? Are you trying to find where the graph of $f$ versus $p$ crosses zero (or some other particular value)? If so, the hidden question is "How smooth is $f(p)$?", since any attempt to make the derivative sensible will have to assume something about this. Do you have theoretical or prior information about the smoothness of this function? $\endgroup$ Feb 15, 2018 at 16:41
  • $\begingroup$ Nobody has a prayer of figuring out what you are talking about with your equations formatted so poorly. Look at the MathJax tutorial and use the knowledge obtained therein to make your equations readable. $\endgroup$ Feb 15, 2018 at 23:36
  • 1
    $\begingroup$ I tried prettying up your question a little. It's still not clear what kinds of things $pln$ and $ekp$ are. Are they single symbols or the product of three variables? It looks like $pln$ is the value of $\ln p$ that you get from interpolating via the independent variable $\theta$. Then $ekp$ is the corresponding value of $p$. I find it hard to avoid reading your equations as $t=t\cdot ekp=\left(a\ln p+b\right)p$ so $$\frac{df}{dp}=a\ln p+b+a=t+a$$ $\endgroup$ Feb 16, 2018 at 3:40

1 Answer 1

1
$\begingroup$

If we assume a linear relationship between $\ln p$ and $\theta$ then the two-point formula for the line through $\left(\theta_\text{bottom},\ln P_{\text{bottom}}\right)$ and $\left(\theta_\text{top},\ln P_{\text{top}}\right)$ is $$\frac{\ln p-\ln P_{\text{bottom}}}{\theta-\theta_\text{bottom}}=\frac{\ln P_{\text{top}}-\ln P_{\text{bottom}}}{\theta_\text{top}-\theta_\text{bottom}}$$ Then $$\ln p=\ln P_{\text{bottom}}+\frac{\theta-\theta_\text{bottom}}{\theta_\text{top}-\theta_\text{bottom}}\left(\ln P_{\text{top}}-\ln P_{\text{bottom}}\right)$$ Also we assume a linear relationship between $t$ and $\ln p$ so that $t=a\ln p+b$. Knowing $T_{\text{bottom}}=a\ln P_{\text{bottom}}+b$ and $T_{\text{top}}=a\ln P_{\text{top}}+b$ we can solve for $a$ and $b$ to get $$a=\frac{T_{\text{top}}-T_{\text{bottom}}}{\ln P_{\text{top}}-\ln P_{\text{bottom}}}$$ and $$b=T_{\text{top}}-a\ln P_{\text{top}}$$ Then if we define $$f=te^{\ln p}=tp=\left(a\ln p+b\right)p$$ We have $$\frac{df}{dp}=a+a\ln p+b=t+a$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.