consider the Boltzmann sigmoid function which is used to simulate a more realist
ID: 2249763 • Letter: C
Question
consider the Boltzmann sigmoid function which is used to simulate a more realistic steplike function, as shown below. The general form is given by
S(t) = a + b / ( 1 + e ^ ( c ( T - 1 ) ) )
where a, b, c, T are constant. Constants a and b determine the initial and final values, c determines the rate of transition, and T is the time at which S = (a+b)/2
For a second order system where 0 = 1 rad/s and = 0.15, write a MATLAB code to run the following cases. For each case, plot the response, calculate rise time, peak time, and settling time. (1) Ideal step response; (2) a = 0, b = 1, c = 6, =0.1; (3) a = 0, b = 1, c = 60, =1;
Explanation / Answer
function [parameter,stat]=sigm_fit(x,y,fixed_params,initial_parameter,plot_flag) % Optimization of parameters of the sigmoid function % % Syntax: % [parameter]=sigm_fit(x,y) % % that is the same that % [parameter]=sigm_fit(x,y,[],[],[]) % no fixed_parameter, automatic initial_parameter % % [parameter]=sigm_fit(x,y,fixed_parameter) % automatic initial_parameter % [parameter]=sigm_fit(x,y,[],initial_parameter) % use it when the estimation is poor % [parameter]=sigm_fit(x,y,fixed_parameter,initial_parameter,plot_flag) % % parameter = [min, max, x50, slope] % % if fixed_parameter=[NaN, NaN , NaN , NaN] % or fixed_parameter=[] % optimization of "min", "max", "x50" and "slope" (default) % % if fixed_parameter=[0, 1 , NaN , NaN] % optimization of x50 and slope of a sigmoid of ranging from 0 to 1 % % % Additional information in the second output, STAT % [parameter,stat]=sigm_fit(x,y,fixed_parameter,initial_parameter,plot_flag) % % % Example: % %% generate data vectors (x and y) % fsigm = @(parameter,xval) parameter(1)+(parameter(2)-parameter(1))./(1+10.^((parameter(3)-xval)*parameter(4))) % parameter=[0 1 5 2]; % "min", "max", "x50", "slope" % x=0:0.1:10; % y=fsigm(param,x) + 0.1*randn(size(x)); % % %% standard parameter estimation % [estimated_params]=sigm_fit(x,y) % % %% parameter estimation with forced 0.2 fixed min % [estimated_params]=sigm_fit(x,y,[0.5 NaN NaN NaN]) % % %% parameter estimation without plotting % [estimated_parameter]=sigm_fit(x,y,[],[],0) % % % warning off x=x(:); y=y(:); if narginRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.