S N in MATLAB Answers
最後のアクティビティ: 2019 年 7 月 12 日

Hi I am trying to perform parameter optimization in SimBiology using optimization function from the optimization toolbox. As an test, I tried to do parameter estimation shown in the 'sbioparamestim' example here - to check if I get the same answers. My code is as follows, the driver file (Estimation_Driver.m) %% Driver to test sbioparamestim using optimization toolbox sbioloadproject('gprotein_norules'); p_array = sbioselect(m1,'Type','parameter'); for index = 1:size(p_array,1) k0(index,1) = p_array(index).Value; end [error] = Objective_func(k0,m1); f = @(k)Objective_func(k,m1); options = optimset('Display','iter'); [k,res_error] = lsqnonlin(f,k0); And the file calculating the error is as follows (Objective_func.m) function [error] = Objective_func(k,m) Gt = 10000; tspan = [0 10 30 60 110 210 300 450 600]'; Ga_frac = [0 0.35 0.4 0.36 0.39 0.33 0.24 0.17 0.2]'; xtarget = Ga_frac * Gt; % Assign the parameters for index = 1:length(k) m.Parameters(index).Value = k(index,1); end [soln_obj] = sbiosimulate(m); [t1,Ga,~] = selectbyname(soln_obj,'Ga'); Ga_sim = interp1(t1,Ga,tspan); error = xtarget - Ga_sim; My question is - why are my answers (below) different than the answers in the example? ans = 0.0100 -0.0000 0.0004 4.0000 0.0040 1.0000 0.0000 0.1100 and the residual is 1.2176e+06 which are different from the values on the 'sbioparamestim' help page, and even the termination message are different :(my message - below): Optimization running. Objective function value: 1217576.5248185194 Local minimum possible. lsqnonlin stopped because the size of the current step is less than the default value of the step size tolerance. and the message when I run using 'sbioparamestim': Local minimum possible. lsqnonlin stopped because the size of the current step is less than the default value of the step size tolerance. Stopping criteria details: Optimization stopped because the norm of the current step, 5.676554e-11, is less than options.TolX = 1.000000e-06. Optimization Metric Options norm(step) = 5.68e-11 TolX = 1e-06 (default) Am I not using the same conditions as in 'sbioparamestim' (I didn't change any of the default conditions in 'lsqnonlin'? More importantly, is this the correct way to use an optimization solver if I don't want to use 'sbioparamestim' (I find it easier to pose my problem this way, for simulating experiments which are much more complex)? Any help here would be useful. Thanks! SN