How to do a convolution on a graph?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Here what I've done. I want to plot the G graph that receive a concentration that already been diffuse.
%% do not edit this: urlwrite('http://web.mit.edu/20.305/www/part_composition_setup.m', ... 'part_composition_setup.m'); rehash; part_composition_setup('v6');
%% feel free to edit below: T_max = 10; % simulation length A_levels = 100; % how to vary A in linear B_levels = 100; % how to vary B in linear D_levels = 100; % how to vary D in linear E_levels = 100; % how to vary F in linear Q= 2; %Protein concentration at r=0 t= 3; %Time D= 4;%Diffusion coefficient xdistance=5; ydistance=3; r=sqrt(xdistance^2)+(ydistance^2);%Euclidean distance H=(Q/sqrt(4*pi*D*t))*exp((-r^2)/4*D*t);% Flick's Law
% parameters for the A n_A = 2; % Hill coefficient for A K_A = 10; % A binding coefficient A_SS = 70; % steady-state concentration of A
% parameters for the B n_B = 1.5; % Hill coefficient for B K_B = 10; % B binding coefficient B_SS = 70; % steady-state concentration of B
% parameters for the C n_C = 2; % Hill coefficient of C K_C = 5; % C binding coefficient C_gamma = 0.2; % C gamma
K_Cp = 100; % C production rate constant K_Cdp = 1; % C degradation rate constant
% parameters for the D n_D = 2.5; % Hill coefficient for D K_D = 10; % A binding coefficient D_SS = 70; % steady-state concentration of D
% parameters for the E: n_E = 2.2; % Hill coefficient for D K_E = 9; % A binding coefficient
K_Ep = 20; % E production rate constant K_Edp = 1; % E degradation rate constant E_gamma = 0.2; % E gamma E_SS=20;
% parameters for the F n_F = 3; % Hill coefficient for F K_F = 12; % F binding coefficient F_SS = 70; % steady-state concentration of F K_Fdp = 2; K_Fp = 30;
% parameters for the G K_Gp = 30; % G production rate constant K_Gdp = 2; % G degradation rate constant G_gamma = 0.34; % G gamma
K_G = 14; n_G = 4;
chrct = BioSystem(); dCdt = chrct.AddCompositor('XC', 0); % outputC dFdt = chrct.AddCompositor('XF', 0); % outputF dGdt = chrct.AddCompositor('XG', 0); % outputG dDiffusion1dt = chrct.AddCompositor('XDiff1', 0); % Diff dDiffusion2dt = chrct.AddCompositor('XDiff2', 0); % Diff
% linear chrct.AddConstant('A', 0); chrct.AddConstant('B', 0); chrct.AddConstant('C', 0); chrct.AddConstant('D', 0); chrct.AddConstant('E', 0); chrct.AddConstant('F', 0); chrct.AddConstant('G', 0); % chrct.AddConstant('Q', 0); chrct.AddConstant('t', 0); chrct.AddConstant('Dif', 0); chrct.AddConstant('xdistance', 0); chrct.AddConstant('ydistance', 0); chrct.AddConstant('H', 0); %constant concentration chrct.AddConstant('A_SS', A_SS); chrct.AddConstant('B_SS', B_SS); chrct.AddConstant('D_SS', D_SS); chrct.AddConstant('F_SS', F_SS); % hill constants chrct.AddConstant('n_A', n_A); chrct.AddConstant('n_B', n_B); chrct.AddConstant('n_C', n_C); chrct.AddConstant('n_D', n_D); chrct.AddConstant('n_E', n_E); chrct.AddConstant('n_F', n_F); chrct.AddConstant('n_G', n_G); %binding constant for input chrct.AddConstant('K_A', K_A); chrct.AddConstant('K_B', K_B); chrct.AddConstant('K_C', K_C); chrct.AddConstant('K_D', K_D); chrct.AddConstant('K_E', K_E); chrct.AddConstant('K_F', K_F); chrct.AddConstant('K_G', K_G); %production rate of C and E chrct.AddConstant('K_Cp', K_Cp); chrct.AddConstant('K_Cdp', K_Cdp); chrct.AddConstant('K_Ep', K_Ep); chrct.AddConstant('K_Edp', K_Edp); chrct.AddConstant('K_Fp', K_Fp); chrct.AddConstant('K_Fdp', K_Fdp); chrct.AddConstant('K_Gp', K_Gp); chrct.AddConstant('K_Gdp', K_Gdp); chrct.AddConstant('C_gamma', C_gamma); chrct.AddConstant('E_gamma', E_gamma); chrct.AddConstant('G_gamma', G_gamma);
%function y(1)= dCdt; y(2)= dFdt; y(3)= dGdt; y(4)= dDiffusiondt;
%Production of C from A OR B GATE chrct.AddPart(Part('Production of C', dCdt, ... Rate('(A^n_A)/((K_A^n_A)+(A^n_A))+(B_SS^n_B)/((K_B^n_B)+(B_SS^n_B))')));
chrct.AddPart(Part('Degradation of C', dCdt, ... Rate('-K_Cdp * XC')));
%Production of F from D AND E GATE chrct.AddPart(Part('Production of F', dFdt, ... Rate('(E^n_E)/((K_E^n_E)+(E^n_E))*(F_SS^n_D)/((K_D^n_D)+(F_SS^n_D))')));
chrct.AddPart(Part('Degradation of F', dFdt, ... Rate('-K_Fdp * XF')));
%Diffusion chrct.AddPart(Part('Diffusion of chemical', dDiffusion1dt, ... Rate('(XC/sqrt(4*pi*2*2))*exp((r^2)/4*2*2)')));
chrct.AddPart(Part('Diffusion of chemical', dDiffusion2dt, ... Rate('(XF/sqrt(4*pi*2*2))*exp((r^2)/4*2*2)')));
%Production of G from C OR F GATE chrct.AddPart(Part('Production of G', dGdt, ... Rate('(XDiff1^n_C)/((K_C^n_C)+(XDiff1^n_C))+(XDiff2^n_F)/((K_F^n_F)+(XDiff2^n_F))')));
chrct.AddPart(Part('Degradation of G', dGdt, ... Rate('-K_Gdp * XG')));
%bound C_end_levels = zeros(1, length(A_levels)); F_end_levels = zeros(1, length(A_levels)); G_end_levels = zeros(1, length(A_levels));
C_ix = chrct.CompositorIndex('XC'); F_ix = chrct.CompositorIndex('XF'); G_ix = chrct.CompositorIndex('XG');
%plot figure('position', [0, 0, 500, 900])
top1 = subplot(4, 1, 1); title(top1, 'Time behavior of [C]') top2 = subplot(4, 1, 2); title(top2, 'Time behavior of [F]') top3 = subplot(4, 1, 3); title(top3, 'Time behavior of [G]') hold(top1, 'on') hold(top2, 'on') hold(top3, 'on')
for ix = 1:length(A_SS) A = A_SS(ix); B = B_SS(ix); D = D_SS(ix); E = E_SS(ix); chrct.ChangeConstantValue('A', D); chrct.ChangeConstantValue('B', B); chrct.ChangeConstantValue('D', D); chrct.ChangeConstantValue('E', E); [T, Y] = chrct.run([0, T_max]); plot(top1, T, Y(:, C_ix), 'DisplayName', ... sprintf('A = %.1f', A)) plot(top1, T, Y(:, C_ix), 'DisplayName', ... sprintf('B = %.1f', B)) plot(top2, T, Y(:, F_ix), 'DisplayName', ... sprintf('D = %.1f', D)) plot(top3, T, Y(:, F_ix), 'DisplayName', ... sprintf('E = %.1f', E))
C_end_levels(ix) = Y(end, C_ix);
E_end_levels(ix) = Y(end, F_ix);
G_end_levels(ix) = Y(end, G_ix);
end
xlabel(top1, 'Time') xlabel(top2, 'Time') xlabel(top3, 'Time') ylabel(top1, '[C]') ylabel(top2, '[G]') ylabel(top3, '[E]') legend(top1, 'Location', 'eastoutside') legend(top2, 'Location', 'eastoutside') legend(top3, 'Location', 'eastoutside') colormap(top1, jet) colormap(top2, jet) colormap(top3, jet) hold(top1, 'off') hold(top2, 'off') hold(top3, 'off')
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Behavior and Psychophysics finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!