I also got the error
Error using COM.StatConnectorSrv_StatConnector/Init
Error: Object returned error code: 0x80040013
when I first tried this. However, I reinstalled R using the directions on this website:
Making sure that I was running R as an administrator when I typed in the install.package commands. Now it works fine.
29 Nov 2014
Functions for calling the statistical package R from within MATLAB.
There might be an error (I have no access to either Matlab or SimBiology anymore), but it would be different from what you suggest.
See the equation in the reference:
dCT/dt = QT/VT * (CAR - (CT * R/ (f * K) )
or just the input into Thymus:
dCT/dt = QT/VT * CAR
so division by input organ volume
the reason for dividing it by the Thymus volume is to account for the different volumes of arterial blood and thymus. The issue I see is that I multiply with VAR which is nowhere to be found in the reference. Can't remember the reason for that and cannot verify now. If you still think there is an issue with your alleged error, please correct it and reupload to the file exchange. Otherwise please contact arthur.goldsipe [at] mathworks.com (sorry Arthur for pulling you into this, I don't have access to these old things anymore).
well, I'm pretty sure that the model has an error. Here is for example the ode of the model for the change of concentration in thymus:
d(Thymus.Drug)/dt = 1/Thymus*( (1/Thymus*(organismBloodFlowThymus*[Arterial Blood].Drug))*[Arterial Blood] - (1/Thymus*organismBloodFlowThymus*Thymus.Drug*DrugBloodPlasmaRatio/(DrugFractionUnbound*KTissuePartitionThymus*DrugTissueFactor)))*Thymus)
As we can see, the second "1/Thymus" needs to be replaced by "1/[Arterial Blood]", so that it cancels out. This would give "organismBloodFlowThymus*[Arterial Blood].Drug" as the correct input rate in amount/time into thymus (as it is described in the reference).
(Assuming Thymus, [Arterial Blood] are Vol, *.Drug are Conc)
Am I wrong?