(1) procedure NLSF-MULTIPLE INITIAL CONDITIONS |
// Boundaries for initial condition generation |
(2) LB1 = −1, −1, −15, 0; |
(3) UB1 = 9, 9, −3, 1; |
// Boundaries for lsqcurvefit function |
(4) LB2 = 0, 0, 0, 0; |
(5) UB2 = inf, inf, inf, inf; |
// Setting up vector for initial conditions |
(6) 0 = zeros(20, 4); |
(7) [] = size(0); |
// Setting lsqcurvefit stopping conditions |
(8) options = optimset(“lsqcurvefit”); |
(9) options.MaxFunEvals = 1000; |
(10) options.TolX = ; |
(11) options.TolFun = ; |
// Generating array of initial conditions |
(12) for = 1:1:length(0) do |
(13) for = 1:1: do |
(14) 0() = LB1() + (UB1() − LB1()).rand(); |
(15) end for |
(16) 0() = 10.0(); |
(17) () = 10.0(); |
(18) 0() = 10.0(); |
(19) MinLSE = inf; |
(20) for = 1:1: do |
(21) [ModelParameters, LSE] = lsqcurvefit(@ModelOneImpedance, 0(), , , LB2, UB2, options); |
(22) if LSE < MinLSEdo |
(23) BestModelParameters = ModelParameters; |
(24) MinLSE = LSE; |
(25) end if |
(26) end for |
(27) end for |
(28) end procedure |
(29) function MODELONEIMPEDANCE(ModelParameters, ) |
(30) ; |
(31) = ModelParameters(); |
(32) = ModelParameters(); |
(33) = ModelParameters(); |
(34) alpha = ModelParameters(); |
(35) = + ./(.(alpha1); |
(36) return abs(); |
(37) end function |