Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Optimizing parameter values using non-linear least squares in R (with integrals)

$
0
0

Obviously an R (and math) amateur. I've been working 10+ hours on trying to get this to work, so I thought I'd attempt posting here as a shot.

I have data collected from an experiment with two variables: Iq and q. These data are linear when plotted in loglog space. I am trying to solve for two other variables, por and r, in the following equation:

Iq=SLD^2*(por/Vra)*integral{Rmin to Rmax}((Vr)^2*f(r)*F dr)

Where:

  • SLD=known constant
  • por=unknown
  • Vra=integral{0 to Inf}(Vr*f(r)dr)
  • Vr=(4/3)*pi*r^3
  • Rmin and Rmax = known constants
  • f(r)=((r^-(1+fd))/(Rmin^(-fd) - Rmax^(-fd))/fd)
  • r=unknown
  • fd=known constant
  • F=(3*(sin(q*r)-q*rcos(q*r))/(q*r)^3)^2

I've tried many attempts at this, but can't seem to wrap my brain around the variables inside the variables into code. This problem used to be solved in an Excel solver routine that optimized parameter values using non-linear least squares that only works on (imo) Windows 95 Excel, and we're trying to adapt it into a more user-friendly data processing method. But I'm a geochemist, so basically useless. Any help would be much appreciated! I can include more details if some kind soul out there is willing to help out.


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>