Code covered by the BSD License  

Highlights from
A Graphical User Interface for Solving Delay Differential Equations and doing Local Search

image thumbnail

A Graphical User Interface for Solving Delay Differential Equations and doing Local Search

by

 

A GUI for solving a set of delay differential equations (DDEs) and local search for best solutions

dde_auto_fit
function dde_auto_fit


% reinitialize
filename = 'knockout_RNA_div_500.tex';
coeff_init = [log10(36.5546),log10(3.84799e-4),log10(111.496),log10(50.6322)]; % V0 logged, beta logged, p logged, delta logged
coeff_lb = [log10(1.1),log10(1e-5),log10(10),log10(1)]; % V0 logged, beta logged, p logged, delta logged
coeff_ub = [log10(1000),log10(1e-3),log10(1000),log10(60)]; % V0 logged, beta logged, p logged, delta logged
fid_filename = importdata(filename);
v_data = fid_filename.data(:,2)';
jv_time_vector = fid_filename.data(:,1)';


%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot initial guess    %
%%%%%%%%%%%%%%%%%%%%%%%%%

target = 2.3e5; infected1 = 0; infected2 = 0; gamma = 44.43;  
time_phase = jv_time_vector(1,end);
% tic
V0 = coeff_init(1); beta = coeff_init(2); p = coeff_init(3);
delta = coeff_init(4); tau = 0.25;
ddecall_tcl(target,infected1,infected2,V0,beta,p,delta,gamma,tau,...
            time_phase,jv_time_vector,filename,1,1,1,1)
% toc


% matlabpool open
options = optimset('UseParallel','always');
ode_call = @(coeff_array,t) ddecall_tcl(target,infected1,infected2,...
                                        coeff_array(1),coeff_array(2),...
                                        coeff_array(3),coeff_array(4),...
                                        gamma,tau,time_phase,...
                                        jv_time_vector,filename,0,1,1,1);

coeff = lsqcurvefit(ode_call,coeff_init,[1:time_phase],v_data,coeff_lb,...
                    coeff_ub,options)

% plot the best solution
V0 = coeff(1);
beta = coeff(2);
p = coeff(3);
delta = coeff(4);

ddecall_tcl(target,infected1,infected2,V0,beta,p,delta,gamma,tau,...
            time_phase,jv_time_vector,filename,1,1,1,1)

Contact us