Hi Patrick,
1) You can use Events to implement such dicrete changes. Please see this page for details: https://www.mathworks.com/help/simbio/ug/event-object.html. "time" indicates simulation time and you can use that in your event trigger. For example, you an write your event trigger as time >= stage1EndTime, and event function as A=0; B=0; C=<somevalue> . Events are triggered when a condition becomes true from false, so you would need to write your time trigger with a "time >=" instead of "time <=".
2) You can use Initial Assignment rules to initialize quantity values and set them to be equal. You could write initial assignments as: kf2 = kf1; kf3 = kf1; kf4 = kf1. For example:
m = sbiomodel('m')
paramlist = {'kf1', 'kf2', 'kf3', 'kf4'}
for i:1:length(paramlist)
addparameter(m, paramlist{i})
end
addrule(m, 'kf2 = kf1', 'initialAssignment')
addrule(m, 'kf3 = kf1', 'initialAssignment')
addrule(m, 'kf4 = kf1', 'initialAssignment')
3) If I understand your third question correctly, you would like to estimate rate constants for rxn 1, 2, 4 individually per A/B pair group and pool the rate constants for rxn 3 across all groups. You can do this using a category specific fit. Please see this example: https://www.mathworks.com/help/simbio/ug/estimate-category-specific-PK-parameters-in-a-hierarchical-model.html#EstimateCategorySpecificPKParametersMultipleIndividualsExample-12
If you're using the Model Analyzer app, you can configure the Estimated Parameters table's Category Variable column.
Fulden