Skip to content

Commit

Permalink
fixes for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian.froehlich committed Sep 5, 2016
1 parent 8e3f5d5 commit 264a42a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 50 deletions.
32 changes: 6 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,6 @@ index.html

AMICI.mlappinstall

examples/example_1/simulate_model_example_1.m

examples/example_2/simulate_model_example_2.m

examples/example_3/simulate_model_example_3.m

examples/example_4/simulate_model_example_4.m

examples/example_5/simulate_model_example_5.m

examples/example_6/simulate_model_example_6.m

examples/geneExpression/simulate_geneExpression.m

examples/example_1/html/*

examples/example_2/html/*

examples/example_3/html/*

examples/example_4/html/*

examples/example_5/html/*

examples/example_6/html/*

*.mat

mtoc/makeExampleDoc.m
Expand Down Expand Up @@ -170,3 +144,9 @@ examples/example_dirac_adjoint/dxdotdp_model_dirac_adjoint.m
examples/example_adjoint/J_model_adjoint.m

examples/example_adjoint/dxdotdp_model_adjoint.m

examples/example_jakstat_adjoint_hvp/simulate_model_jakstat_adjoint_hvp.m

examples/example_dirac_adjoint_hessVecProd/simulate_model_dirac_adjoint_hessVecProd.m

examples/example_adjoint_hessian/simulate_model_adjoint_hessian.m
2 changes: 1 addition & 1 deletion @amimodel/amimodel.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

% counter that allows enforcing of recompilation of models after
% code changes
compver = 16;
compver = 18;
end

properties ( GetAccess = 'public', SetAccess = 'public' )
Expand Down
23 changes: 7 additions & 16 deletions @amimodel/makeEvents.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function makeEvents( this )
trigger{ievent} = sym(symchar);
end
end

% update to prevent dirac functions.
for ievent = 1:nevent
dtriggerdt(ievent) = diff(trigger{ievent},sym('t')) + jacobian(trigger{ievent},this.sym.x)*this.sym.xdot(:);
Expand Down Expand Up @@ -242,23 +242,14 @@ function makeEvents( this )

this.event = amievent.empty();


if(~isfield(this.sym,'Jz'))
this.sym.Jz = sym(0);
for iz = 1:length([this.event.z])
this.sym.Jz = this.sym.Jz + sym(['log(2*pi*sigma_z_' num2str(iz) '^2) + ((z_' num2str(iz) '-mz_' num2str(iz) ')/sigma_z_' num2str(iz) ')^2']);
end

% update events
for ievent = 1:nevent
this.event(ievent) = amievent(trigger{ievent},bolus{ievent}(:),z{ievent});
% do not add a (:) after z{ievent} this will transform an
% [ empty sym ] into Empty sym: 0-by-1 which will lead to a
% zero entry if we apply [this.event.z]
this.event(ievent) = this.event(ievent).setHflag(hflags(:,ievent));

this.event(ievent) = amievent(trigger{ievent},bolus{ievent}(:),z{ievent});
% do not add a (:) after z{ievent} this will transform an
% [ empty sym ] into Empty sym: 0-by-1 which will lead to a
% zero entry if we apply [this.event.z]
this.event(ievent) = this.event(ievent).setHflag(hflags(:,ievent));
end

end

if(~isfield(this.sym,'sigma_z'))
Expand All @@ -271,7 +262,7 @@ function makeEvents( this )
if(~isfield(this.sym,'Jz'))
this.sym.Jz = sym(0);
for iz = 1:length([this.event.z])
this.sym.Jz = this.sym.Jz + sym(['log(2*pi*sdz_' num2str(iz) '^2) + ((z_' num2str(iz) '-mz_' num2str(iz) ')/sdz_' num2str(iz) ')^2']);
this.sym.Jz = this.sym.Jz + sym(['log(2*pi*sigma_z_' num2str(iz) '^2) + ((z_' num2str(iz) '-mz_' num2str(iz) ')/sigma_z_' num2str(iz) ')^2']);
end
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% simulate_model_adjoint_hessian.m is the matlab interface to the cvodes mex
% which simulates the ordinary differential equation and respective
% sensitivities according to user specifications.
% this routine was generated using AMICI commit 8e3f5d50faeacd3f16d95839fea1182ef5417611 in branch stable in repo https://github.com/FFroehlich/AMICI.
%
% USAGE:
% ======
Expand Down Expand Up @@ -71,8 +72,8 @@
% 1: Hermite (DEFAULT for problems without discontinuities)
% 2: Polynomial (DEFAULT for problems with discontinuities)
% .ordering ... online state reordering.
% 0: AMD reordering
% 1: COLAMD reordering (default)
% 0: AMD reordering (default)
% 1: COLAMD reordering
% 2: natural reordering
%
% Outputs:
Expand Down Expand Up @@ -218,6 +219,7 @@
sol.sx = bsxfun(@times,sol.sx,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.sy = bsxfun(@times,sol.sy,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.sz = bsxfun(@times,sol.sz,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.srz = bsxfun(@times,sol.srz,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.ssigmay = bsxfun(@times,sol.ssigmay,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.ssigmayz = bsxfun(@times,sol.ssigmaz,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% simulate_model_dirac_adjoint_hessVecProd.m is the matlab interface to the cvodes mex
% which simulates the ordinary differential equation and respective
% sensitivities according to user specifications.
% this routine was generated using AMICI commit 8e3f5d50faeacd3f16d95839fea1182ef5417611 in branch stable in repo https://github.com/FFroehlich/AMICI.
%
% USAGE:
% ======
Expand Down Expand Up @@ -71,8 +72,8 @@
% 1: Hermite (DEFAULT for problems without discontinuities)
% 2: Polynomial (DEFAULT for problems with discontinuities)
% .ordering ... online state reordering.
% 0: AMD reordering
% 1: COLAMD reordering (default)
% 0: AMD reordering (default)
% 1: COLAMD reordering
% 2: natural reordering
%
% Outputs:
Expand Down Expand Up @@ -229,6 +230,7 @@
sol.sx = bsxfun(@times,sol.sx,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.sy = bsxfun(@times,sol.sy,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.sz = bsxfun(@times,sol.sz,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.srz = bsxfun(@times,sol.srz,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.ssigmay = bsxfun(@times,sol.ssigmay,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.ssigmayz = bsxfun(@times,sol.ssigmaz,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
end
Expand Down
1 change: 1 addition & 0 deletions examples/example_events/model_events_syms.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
% set the parametrisation of the problem options are 'log', 'log10' and
% 'lin' (default).
model.param = 'log10';

%%
% STATES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function example_jakstat_adjoint_hvp()

% compile the model
[exdir,~,~]=fileparts(which('example_jakstat_adjoint_hvp.m'));
% amiwrap('model_jakstat_adjoint_hvp','model_jakstat_adjoint_hvp_syms',exdir,2)
amiwrap('model_jakstat_adjoint_hvp','model_jakstat_adjoint_hvp_syms',exdir,2)
num = xlsread(fullfile(exdir,'pnas_data_original.xls'));

D.t = num(:,1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
% simulate_model_jakstat_adjoint_hvp.m is the matlab interface to the cvodes mex
% which simulates the ordinary differential equation and respective
% sensitivities according to user specifications.
% this routine was generated using AMICI commit 8e3f5d50faeacd3f16d95839fea1182ef5417611 in branch stable in repo https://github.com/FFroehlich/AMICI.
%
% USAGE:
% ======
Expand Down Expand Up @@ -71,8 +72,8 @@
% 1: Hermite (DEFAULT for problems without discontinuities)
% 2: Polynomial (DEFAULT for problems with discontinuities)
% .ordering ... online state reordering.
% 0: AMD reordering
% 1: COLAMD reordering (default)
% 0: AMD reordering (default)
% 1: COLAMD reordering
% 2: natural reordering
%
% Outputs:
Expand Down Expand Up @@ -226,6 +227,7 @@
sol.sx = bsxfun(@times,sol.sx,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.sy = bsxfun(@times,sol.sy,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.sz = bsxfun(@times,sol.sz,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.srz = bsxfun(@times,sol.srz,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.ssigmay = bsxfun(@times,sol.ssigmay,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
sol.ssigmayz = bsxfun(@times,sol.ssigmaz,permute(theta(options_ami.sens_ind),[3,2,1])*log(10));
end
Expand Down

0 comments on commit 264a42a

Please sign in to comment.