48 this =
this@models.pcd.BasePCDSystem(model);
51 this.
f= models.pcd.CoreFun2D(
this);
62 if ~isempty(varargin) && isa(varargin[1],
" PlotManager ")
72 h = pm.nextPlot([model.
SaveTag " _outputplot "],...
73 sprintf(
" Output plot for model %s ",model.
Name),
" Time ",
" Caspase-3 Concentration ");
75 semilogy(h,t,y,
" r ",
" LineWidth ",2);
83 if ~isempty(varargin) && isa(varargin[1],
" PlotManager ")
94 this.plot2DState(model, t, y, pm);
96 this.plot1DState(model, t, y, pm);
111 x0(2*m+1:end) = 1e-9;
113 this.
x0= dscomponents.ConstInitialValue(
x0);
124 d1idx = find(abs((1:d) - d/2) <= d/2 * p);
129 d2idx = find(abs((1:d) - d/2) <= d/2 * p);
133 [d1,d2] = meshgrid(d1idx,d2idx);
137 C(ca3(sel)) = 1/length(sel);
148 idxmat = zeros(this.
Dims);
150 sel = idxmat(:,round(this.
Dims(2)/2));
151 sel = [sel; sel+m; sel+2*m; sel+3*m];
156 idx = round(linspace(1,length(t),150));
160 states = [
" alive ",
" unstable ",
" dead "];
164 doplot(y(1:m,:),
" c8 ",
" Caspase-8 (x_a) ",1);
165 doplot(y(m+1:2*m,:),
" c3 ",
" Caspase-3 (y_a) ",2);
166 doplot(y(2*m+1:3*m,:),
" pc8 ",
" Pro-Caspase-8 (x_i) ",3);
167 doplot(y(3*m+1:end,:),
" pc3 ",
" Pro-Caspase-3 (y_i) ",4);
169 function doplot(y, tag, thetitle, pnr)
170 di = abs(this.
Model.SteadyStates(:,pnr)-y(end));
171 reldi = di ./ (this.
Model.SteadyStates(:,pnr)+eps);
172 reldistr =
Utils.implode(reldi," , "," %2.3e ");
173 if any(reldi > .1) || any(reldi < 10)
175 tit = sprintf("
Model '%s', %s concentrations\nCell state at T=%d: %s\n%s ", model.Name, thetitle,...
176 max(t),states[
id],reldistr);
178 tit = sprintf("
Model '%s', %s concentrations\n%s ", model.Name, thetitle,reldistr);
180 h = pm.nextPlot(tag,tit," Time [s] "," Cell slice ");
181 surf(
h,
X,
Y,y," EdgeColor "," none ");
196 b = [min(xa(:)) max(xa(:)); min(ya(:)) max(ya(:));...
197 min(xi(:)) max(xi(:)); min(yi(:)) max(yi(:))];
200 hlpf = figure(" Visible "," off "," MenuBar "," none "," ToolBar "," none ");
201 hlpax = newplot(hlpf);
204 caps = [" Caspase-8 "," Caspase-3 "," Pro-Caspase-8 "," Pro-Caspase-3 "];
206 h = pm.nextPlot(sprintf(" PCD2D_plot1D_%d ",p),...
207 sprintf("
Model '%s', %s concentrations ", model.Name, caps[p]),...
208 " Left to right "," Bottom to Top ");
210 ar = get(gca," DataAspectRatio ");
211 set(h," DataAspectRatio ",[ar(1)/2 ar(2:3)]);
213 set(h," Box "," on "," GridLineStyle "," none ");
215 set(h," CLimMode "," manual "," CLim ",b(p,:));
218 zlabel(h,sprintf(" %s concentration ",caps[p]));
219 colorbar(" peer ",h);
226 x = a(1,1):this.h:a(1,2);
227 y = a(2,1):this.h:a(2,2);
228 [X,Y] = meshgrid(x,y);
230 step = round(length(t)/40);
231 for idx=1:step:length(t)
232 h1 = doplot(xa(:,idx),ax(1));
233 h2 = doplot(ya(:,idx),ax(2));
234 h3 = doplot(xi(:,idx),ax(3));
235 h4 = doplot(yi(:,idx),ax(4));
236 set(gcf," Name ",sprintf(" Plot at t=%
f ",t(idx)));
245 function
hs = doplot(zd, ax)
254 hs = surf(hlpax,X,Y,V);
255 set(
hs," Parent ",ax);
256 set(hs," FaceColor "," interp "," EdgeColor "," none ");
char Name
The name of the Model.
Collection of generally useful functions.
PCDSystem2D The programmed cell death model for 2D geometry.
h
Spatial stepwidth (in unscaled size units!) is set in subclasses.
function varargout = plot(models.BaseFullModel model,double t,matrix< double > y, varargin)
The base class for any KerMor detailed model.
Model
The Model this System is attached to.
hs
scaled spatial stepwidth
Dims
The system's dimensions.
reshape
hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape ...
function varargout = plotState(models.BaseFullModel model,double t,matrix< double > y, varargin)
LinearCoreFun(A)
No system reference needed for constant linear core fun.
PlotManager: Small class that allows the same plots generated by some script to be either organized a...
dscomponents.AInitialValue x0
Function handle to initial state evaluation.
function newSysDimension()
Custom updates for new system dimension.
logical LeaveOpen
Flag indicating if the plots should be left open once the PlotManager is deleted (as variable) ...
A variable number of input arguments.
static function [ A , idxmat ] = laplacemat(h, d1, d2)
Computes a 2D diffusion sparse matrix with zero neuman boundary conditions.
delete
Handle object destructor method that is called when the object's lifecycle ends.
dscomponents.LinearOutputConv C
The output conversion Defaults to an LinearOutputConv instance using a 1-matrix, which just forwards ...
dscomponents.ACoreFun f
The core f function from the dynamical system.
logical Plot2D
Flag that indicates if the plot command yields a 2D plot or a 1D slice over time plot.
MatUtils: Matrix utility functions.
Omega
The spatial width/area/region (in unscaled size units!)
PCDSystem2D(models.BaseFullModel model)
PCDSYSTEM The 2D dynamical system of the Programmed Cell Death Model by Markus Daub.
dscomponents.LinearCoreFun A
Represents a linear or affine-linear component of the dynamical system.
Diff
Relative diffusion coefficients ([d2/d1, d3/d1, d4/d1])
char SaveTag
A custom tag that can be used as a prefix to files for corresponding model identification.
A variable number of output arguments.