I am building a model that requires a user defined kinetic law. My code: Mobj = sbiomodel('u_PA_parameter_generation'); %create model object comp_obj = addcompartment(Mobj, 'plasma'); %create compartment object Robj2 = addreaction(Mobj, 'PLS + Pro_u_PA -> PLS + u_PA'); %create reaction object abskineticlawObj2 = sbioabstractkineticlaw('reaction_2','PLS*Pro_u_PA^ci*keff_PLS'); %create kinetic law sbioaddtolibrary(abskineticlawObj2) %add kinetic law to the library. The last line above is the causing my problem. In the absence of sbioaddtolibrary function I get an error: 'Error using SimBiology.Reaction/addkineticlaw The kinetic law named 'abskineticlawObj2' does not exist in the user-defined library. Use SBIOADDTOLIBRARY to add to the library before using it.' ...and when I do as the error suggests (adding the sbioaddtolibrary line above) I get a different error: 'Error using SimBiology.Root/addtolibrary The kinetic law 'reaction_2' already exists as a user-defined. Rename by changing the Name property or re-create by using SBIOABSTRACTKINETICLAW.' Since these errors are basically a paradox I was wondering if anyone knew if this is a problem with the software or is there a problem with my code. The rest of the reaction is listed below: Kobj2= addkineticlaw(Robj2, 'abskineticlawObj2'); Pobj2a = addparameter(Kobj2, 'keff_PLS',40); %This rate needs a hill coefiscient!!! Pobj2b = addparameter(Kobj2, 'ci',2); set(Kobj2, 'ParameterVariableNames','keff_PLS'); set(Kobj2, 'ParameterVariableNames','ci') Thanks