0
$\begingroup$

i have 4 sets of data of JCS as a function of T at 4 different B values the equation is
JCS = JCST*Exp[-(B/BSC)];

JCST = JCS0*(1 - T/78.4)^alpha2;

BSC = BSC0*Exp[-(T/TSC)];

where JCS0 BSC and TCS have to be the same for all the dataset while B changes for each data but they are known. i use to do a fit whit a single data set setting B every fit, but I get different best values for JCS0 BSC and TCS. how can I perform a single Fit of JCS vs T with all 4 sets of data including the fact that B is not a fitting parameter but is a know value?

thanx modified to add the code I'm using actually

JCS = JCST*Exp[-(B/BSC)];
JCST = JCS0*(1 - T/78.4)^alpha2;
BSC = BSC0*Exp[-(T/TSC)];
JCS2 = JCS /. {B -> 1}

fit3T = NonlinearModelFit[
   a1T, {JCS2, alpha2 > 0,  BSC0 > 0, 
    TSC > 0}, {{TSC, 8}, {JCS0, 0.5}, {BSC0, 90}, {alpha2, 0.8}},
    T];
fit3Ta = fit3T["BestFitParameters"]

Show[ListLogPlot[a1T, PlotRange -> {{0, 90}, {0.0001, 2}}, 
  PlotStyle -> PointSize[0.02]], 
 LogPlot[JCS2 /. fit3Ta, {T, 0, 90}, PlotRange -> {0.0001, 2}]]
```
$\endgroup$
8
  • $\begingroup$ Please make use of code blocks and ensure that the question is readable / the code is copyable. $\endgroup$
    – Szabolcs
    Commented Nov 12, 2020 at 11:40
  • $\begingroup$ @Szabolcs what do you mean with code blocks? $\endgroup$ Commented Nov 12, 2020 at 12:30
  • $\begingroup$ MAybe the following may help: mathematica.stackexchange.com/questions/5362/… $\endgroup$ Commented Nov 12, 2020 at 15:25
  • 1
    $\begingroup$ Check my resource function MultiNonlinearModelFit $\endgroup$ Commented Nov 12, 2020 at 16:56
  • $\begingroup$ @SjoerdSmit 's MultiNonlinearModelFit is the way to go but it does assume (and please correct me if I'm wrong) that the error variances are identical among the individual models. If the response variables are in different units, then that assumption of a common error variance, it unlikely to be true. $\endgroup$
    – JimB
    Commented Nov 12, 2020 at 17:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.