fitPolynomialModelGprimeConcentration: fitPolynomialModelGprimeConcentration

Description Usage Arguments Details Value Author(s) Examples

View source: R/fitPolynomialModelGprimeConcentration.R

Description

Fits a polynomial model of the form Gprime=A*(x-c0)^n to experimental G' (Gprime) data. Here, x and Gprime are known (measured), while we try to find A, c0 and n.

Usage

1
fitPolynomialModelGprimeConcentration(Gprime,polymer_conc_mgmL,n=2.5, do_full_fit=TRUE)

Arguments

Gprime

Measured G' values

polymer_conc_mgmL

Known concentration of the suspension, in terms of polymer concentration, typically in mg/mL

n

Initial guess for the exponent in the polynomial model

do_full_fit

At the end of the fitting procedure, do you want to attempt to fit simultaneously the three parameters A, c0 and n after initial fitting? This can provide the best fit, but often does not converge.

Details

Carries out least squares fitting by using nls; depending on the data and starting values, this can be finicky. Check the values that you obtain.

Value

List with named entries for A, n and c0

Author(s)

Thomas Braschler

Examples

1
2
3
4
5
6
x=c(30,35,40,45,50)
Gprime=c(10,400,1500,5000,11000)
plot(x,Gprime,log="y",xlab="Polymer concentration [mg/mL]",ylab="G'")
coeffs=fitPolynomialModelGprimeConcentration(Gprime=Gprime,polymer_conc_mgmL=x,n=2.5, do_full_fit=FALSE)
x_theory=seq(from=0,to=50, length.out=200)
lines(x_theory,polynomial_model(x=x_theory,A=coeffs[["A"]],c0=coeffs[["c0"]],n=coeffs[["n"]]))

tbgitoo/rheologyEvaluation documentation built on March 19, 2021, 8 p.m.