Skip to content

Commit

Permalink
Add exploratory code for Octave conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrisvetlov committed Mar 6, 2024
1 parent b4488c5 commit 90f581e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions WorkSpace/Dmitri/Nov2SSITExample.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
clear all
addpath(genpath('../../src'));

Model = SSIT;
Model = SSIT('Empty');
Model.species = {};
Model.initialCondition = [];
Model.propensityFunctions = {};
Expand Down Expand Up @@ -36,10 +36,10 @@
stoichForward([i,i+1])=[-1,1];
% Model = Model.addReaction(['alpha',num2str(i),'*E',num2str(i)],stoichForward);
Model = Model.addReaction(['alph*E',num2str(i)],stoichForward);

stoichBackward = zeros(size(Model.species,1),1);
stoichBackward([i,i+1])=[1,-1];
Model = Model.addReaction(['bet*E',num2str(i+1),'*',num2str(i)],stoichBackward);
Model = Model.addReaction(['bet*E',num2str(i+1),'*',num2str(i)],stoichBackward);

stoichProduction = zeros(size(Model.species,1),1);
stoichProduction(end)=1;
Expand Down
9 changes: 7 additions & 2 deletions WorkSpace/Dmitri/benchmarks.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
clear all
addpath(genpath('../../src'));

%% Random Matrix
M = 5;
Ns = 6;
Nsim = 5;
Nar = floor(logspace(2,3,Ns));
Nar = floor(logspace(1,2,Ns));
timeExpm =nan*ones(Nsim,Ns);
timeExpokit =nan*ones(Nsim,Ns);
diff_expm_expokit =nan*ones(Nsim,Ns);
Expand All @@ -16,7 +18,10 @@

for j = 1:Nsim
A = rand(N,N);
thr = min(maxk(A,5));
%% MATLAB version
%thr = min(maxk(A,5));
%% Octave version
thr = Asorted
A(A<thr)=0;
A = sparse(A);
A = A - diag(sum(A));
Expand Down

0 comments on commit 90f581e

Please sign in to comment.