WICHTIG: Der Betrieb von goMatlab.de wird privat finanziert fortgesetzt. - Mehr Infos...

Mein MATLAB Forum - goMatlab.de

Mein MATLAB Forum

 
Gast > Registrieren       Autologin?   

Partner:




Forum
      Option
[Erweitert]
  • Diese Seite per Mail weiterempfehlen
     


Gehe zu:  
Neues Thema eröffnen Neue Antwort erstellen

Parametern verschiedene Initialwerte?

 

maki
Forum-Anfänger

Forum-Anfänger


Beiträge: 32
Anmeldedatum: 23.03.20
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 13.04.2020, 16:49     Titel: Parametern verschiedene Initialwerte?
  Antworten mit Zitat      
ich bin recht neu in Matlab und versuche die Zellaufzucht von Säugetierzellen in mehreren, nacheinander folgenden Bioreaktoren unterschiedlicher Größe zu simulieren.
Bildlich kann man sich das so vorstellen, wobei die Zellzahl gegenüber der Zeit aufgetragen ist.

In jedem Reaktor ist ein Medium mit gewissen Startkonzentrationen (Glucose, Glutamin). Die Zellen im Reaktor wachsen und verstoffwechseln dabei Glucose und Glutamin.
Die Zellen bleiben so lange im Reaktor, bis explizite Umsaatkriterien erreicht sind. Das kann entweder eine zeitliche Vorgabe sein, oder eine zu erreichende Zellzahl. Sobald ein Kriterium (oder beide) erfüllt ist, erfolgt die Umsaat in einen größeren Bioreaktor.
Die Zellen bleiben entweder eine bestimmte, zeitliche Vorgabe im Reaktor, oder bis sie eine gewisse Zellzahl erreicht haben. Danach wird die Zellkultur in einen größeren Reaktor überführt, somit ändert sich das Volumen, die Startkonzentrationen des Mediums (Glucose und Glutamin) sowie die Zellzahl mit der gestartet wird. Das passiert ca 8 mal, bevor die Zellaufzucht beendet ist.
Bisher habe ich Reaktor 1 simuliert, nun weiß ich allerdings nicht, wie ich für den Beginn des zweiten Reaktors die Zellzahl, Medienkonzentrationen und das Volumen mit einem neuen Startwert beginnen lassen kann.
Ich hoffe die Frage ist verständlich formuliert und jemand kann mir weiterhelfen

Mein bisheriger Code:

Code:
%Cultivation Length
tRange= [0 72];
%%
%Initial values
Xv0 = 0.3*10^6;  % Initial Viable Cell Concentration - cells per mL
Xt0 = 0.5*10^6;  % Initial Total Cell Concentration - cells per mL
cGlc0 = 1;       % Initial Concentration of Glucose - grams per liter
cGln0 = 10;      % Initial Concentration of Glutamine - grams per liter
cLac0 = 1;       % Initial Concentration of Lactate - grams per liter
v0 = 0.25;       % Initial Volume - L
cAmm0=1;         % Initial Concentration of Ammonia - grams per liter
%%
%Vector that contains all the Initial values
c0 = [ Xv0, Xt0, cGlc0, cGln0, cLac0, cAmm0, v0];
%%
%ODE45 function
[t,y] = ode45(@odes, tRange, c0);
%%
if y(1) > 2*10^6
y(7) = 0.5;
else
y(7) = 0.25;
end
 


Mit der Function

function [dVariablesdt] = odes(t,Variables)
Xv  =   Variables(1);
Xt  =   Variables(2);
cGlc=   Variables(3);
cGln=   Variables(4);
cLac=   Variables(5);
cAmm=   Variables(6);
V   =   Variables(7);
    %%
    %Cell growth and Cell death
    Klys = 1;                   %                Constant for Cell Lysing
    my_max = 0.028;             % [h^-1]         Maximum Specific Growth Rate -                
    my_d_min = 0.0005;          % [h^-1]         Minimum Specific Death Rate -                
    my_d_max = 0.005;           % [h^-1]         Maximum Specific Death Rate -                
    tlag = 24;                  % [h]            Duration of the Lag Phase -                    
    alag = 0.1;                 % [1 is 100%]    Correction Factor for Lag Phase
    %%
    %Substrate rates
    kGlc = 10;                  %[mmol/L]        Monod Kinetic Constant for Glucose Uptake    
    kGln = 2.5;                 %[mmol/L]        Monod Kinetic Constant for Glutamine Uptake  
    KsGlc = 0.03;               %[mmol/L]        Monod Kinetic Constant for Glucose          
    KsGln = 0.03;               %[mmol/L]        Monod Kinetic Constant for Glutamine      
    qGlc_max = 1.8*10^-10;      %[mmol/cells *h] Maximum Cell-specific Glucose Uptake Rate  
    qGln_max = 0.8*10^-10;      %[mmol/cells *h] Maximum Cell-specific Glutamine Uptake Rate
    %%
    %Metabolite rates
    qAmm_uptake_max = 4*10^-12; %[mmol/cells *h] Maximum Cell-specific Ammonia Uptake Rate  
    qLac_uptake = 1.2*10^-11;   %[mmol/cells *h] Maximum Cell-specific Lactate Uptake Rate  
    YAmm_Gln = 0.7;             %[mmol/mmol]     Kinetic production Constant for Ammonia by consuming Glutamine  
    YLac_Glc = 0.3;             %[mmol/mmol]     Kinetic production Constant for Lactate by consuming Glucose  
    Fsample = 0;                %[L]             Sample Volume
    kAmm = 0.5;                 %                Correction Factor for Ammonia uptake
    %cAmm = 1;                   %[g/L]           Concentration of Ammonia
    %cGlc = 10;                  %[g/L]           Concentration of Glucose
    %cGln = 10;                  %[g/L]           Concentration of Glutamine
    %cLac = 1;                   %[g/L]           Concentration of Lactate
    %%
    %Variables
    my = my_max * cGlc/(cGlc + KsGlc) * cGln/(cGln + KsGln) - (1 - t/tlag) * alag * my_max;     %Cell specific growth rate
    my_d = my_d_min + my_d_max * KsGlc/(KsGlc + cGlc) * KsGln/(KsGln + cGln);                   %Cell specific death rate
    qGlc = qGlc_max * cGlc/(cGlc + kGlc)* (my/(my + my_max)+0.5);                               %Glucose Updake Rate
    qGln = qGln_max * cGln/(cGln + kGln);                                                       %Glutamine Uptake Rate
    qLac = YLac_Glc * qGlc * cGlc/cLac - qLac_uptake * (my_max - my)/my_max;                    %Lactate production Rate
    qAmm = YAmm_Gln * qGln * cGln/cAmm - kAmm * qAmm_uptake_max * (my_max - my)/my_max;         %Lactate production Rate
    %%
    %Differential Equations
    dXvdt   = Xv * (my - my_d);              % Equation 1 - dXv/dt
    dXtdt   = Xv *my - Klys*(Xt - Xv);       % Equation 2 - dXt/dt
    dcGlcdt = -1.0 * Xv * qGlc;              % Equation 3 - dcGlc/dt
    dcGlndt = -1.0 * Xv * qGln;              % Equation 4 - dcGln/dt
    dLacdt  = Xv * qLac;                     % Equation 5 - dcLac/dt
    dcAmmdt = Xv * qAmm;                     % Equation 6 - dcAmm/dt
    dVdt    = Fsample;                       % Equation 7 - dV/dt
   
    [dVariablesdt]=[dXvdt;dXtdt;dcGlcdt;dcGlndt;dLacdt;dcAmmdt;dVdt];
   

end

Viele Grüße

Bild1.jpg
 Beschreibung:

Download
 Dateiname:  Bild1.jpg
 Dateigröße:  54.21 KB
 Heruntergeladen:  245 mal
Private Nachricht senden Benutzer-Profile anzeigen


Harald
Forum-Meister

Forum-Meister


Beiträge: 24.448
Anmeldedatum: 26.03.09
Wohnort: Nähe München
Version: ab 2017b
     Beitrag Verfasst am: 13.04.2020, 17:17     Titel:
  Antworten mit Zitat      
Hallo,

ich gehe davon aus, dass die Reaktoren voneinander unabhängig sein sollen.

Grundsätzlich dann nach dem Muster:
Code:
% einzelne Werte festlegen für feste Parameter
festerParam1 = Wert1;
festerParam2 = Wert2;
...
% Vektoren festlegen für variable Parameter
variablerParam1 = [Wert11, Wert12, ..., Wert1n];
variablerParam2 = [Wert21, Wert22, ..., Wert2n];
...
% Simulation in einer for-Schleife
for k = 1:n
    % Simulation mit festerParam1, festerParam2, variablerParam1(k), variablerParam2(k)
    % entscheidend: feste Parameter ohne Index, variable Parameter mit Index
end


Grüße,
Harald
_________________

1.) Ask MATLAB Documentation
2.) Search gomatlab.de, google.de or MATLAB Answers
3.) Ask Technical Support of MathWorks
4.) Go mad, your problem is unsolvable ;)
Private Nachricht senden Benutzer-Profile anzeigen
 
maki
Themenstarter

Forum-Anfänger

Forum-Anfänger


Beiträge: 32
Anmeldedatum: 23.03.20
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 17.04.2020, 09:52     Titel:
  Antworten mit Zitat      
Danke, das hat funktioniert.


Im bisherigen Code ist es so verankert, dass nach 72h die neue Schleife beginnt. Wie kann ich es erweitern, dass die neue Schelife startet, wenn entweder 72h ODER eine gewisse Zahl X erreicht ist?
Private Nachricht senden Benutzer-Profile anzeigen
 
Harald
Forum-Meister

Forum-Meister


Beiträge: 24.448
Anmeldedatum: 26.03.09
Wohnort: Nähe München
Version: ab 2017b
     Beitrag Verfasst am: 17.04.2020, 10:22     Titel:
  Antworten mit Zitat      
Hallo,

was soll eine gewisse Zahl erreichen? Das y, das das Ergebnis von ode45 ist?
In dem Fall kannst du das über Events machen:
https://www.mathworks.com/help/matl.....h/ode-event-location.html

Übrigens: dieser Code sieht für mich sehr merkwürdig aus:
Code:
if y(1) > 2*10^6
y(7) = 0.5;
else
y(7) = 0.25;
end

Da y eine Matrix ist, kann ich mir nicht vorstellen, dass der Code das macht, was du möchtest. Möchtest du hier auf die 1. bzw. 7. Spalte zugreifen?
Dir muss auch bewusst sein, dass die Änderungen hier nachträglich sind und nicht das Lösen der DGL an sich beeinflussen.

Grüße,
Harald
_________________

1.) Ask MATLAB Documentation
2.) Search gomatlab.de, google.de or MATLAB Answers
3.) Ask Technical Support of MathWorks
4.) Go mad, your problem is unsolvable ;)
Private Nachricht senden Benutzer-Profile anzeigen
 
maki
Themenstarter

Forum-Anfänger

Forum-Anfänger


Beiträge: 32
Anmeldedatum: 23.03.20
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 17.04.2020, 12:25     Titel:
  Antworten mit Zitat      
Der Code ist etwas veraltet,
Zitat:
if y(1) > 2*10^6
y(7) = 0.5;
else
y(7) = 0.25;
end
wurde entfernt und eine Schleife eingebaut

daher hier der neue Code:

Code:
%Initial values einzelner Stufen
        Xv0   = [0.3*10^6 ,0.3*10^6    ,0.3*10^6    ,0.3*10^6    ,0.4*10^6    ,0.4*10^6    ,0.25*10^6   ,0.3*10^6    ,0.38*10^6];% ,0.3*10^6]; % Initial Viable Cell Concentration - cells per mL
        Xt0   = [0.3*10^6 ,0.3*10^6    ,0.3*10^6    ,0.3*10^6    ,0.4*10^6    ,0.4*10^6    ,0.25*10^6   ,0.3*10^6    ,0.38*10^6];% ,0.3*10^6]; % Initial Total Cell Concentration - cells per mL
        cGlc0 = [4.5       ,4.5          ,4.5             ,4.5         ,4.5          ,4.5          ,4.5          ,4.5          ,4.5]; %       ,5]; % Initial Concentration of Glucose - grams per liter
        cGln0 = [0.9      ,0.9        ,0.9          ,0.9          ,0.9          ,0.9          ,0.9          ,0.9          ,0.9];%        ,0.9]; % Initial Concentration of Glutamine - grams per liter
        cLac0 = [1        ,1           ,1           ,1           ,1           ,1           ,1           ,1           ,1];  %      ,1]; % Initial Concentration of Lactate - grams per liter
        cAmm0 = [1        ,1           ,1           ,1           ,1           ,1           ,1           ,1           ,1];    %     ,1]; % Initial Concentration of Ammonia - grams per liter
        v0    = [0.125    ,0.5         ,1           ,1           ,2           ,20          ,100         ,400         ,2000];%      ,12000]; % Initial Volume - L
       
%%
%ODE45 function
n = 9; %Anzahl an Stufen
%Laufdauer
t=0;
y=[0,0,0,0,0,0,0];
Laufdauer =[0 72;72 144 ;144 216;216 288;288 360;360 432;432 504;504 576;576 648];%648 1392]; %Laufdauer der einzelnen Stufen
for k = 1:n
    tRange= Laufdauer(k,:);  
    c0 = [ Xv0(k); Xt0(k); cGlc0(k); cGln0(k); cLac0(k); cAmm0(k); v0(k)]; %Vector that contains all the Initial values  
%%
%ODE45
[tSpeicher,ySpeicher] = ode15s(@Model, tRange, c0);
 
 t = vertcat(t,tSpeicher);
 y= vertcat(y,ySpeicher);
end


mit dem Funktion:
function [dVariablesdt] = Model(t,Variables)
Xv  =   Variables(1);
Xt  =   Variables(2);
cGlc=   Variables(3);
cGln=   Variables(4);
cLac=   Variables(5);
cAmm=   Variables(6);
v   =   Variables(7);
    %%
    %Cell growth and Cell death
    Klys = 0.01;                % [h^-1]        Constant for Cell Lysing
    my_max = 0.055;             % [h^-1]         Maximum Specific Growth Rate -                
    my_d_min = 0.002;           % [h^-1]         Minimum Specific Death Rate -                
    my_d_max = 0.055;           % [h^-1]         Maximum Specific Death Rate -                
    %tlag = 24;                 % [h]            Duration of the Lag Phase -                    
    %alag = 0.1;                % [1 is 100%]    Correction Factor for Lag Phase
    %%
    %Substrate rates
    kGlc = 0.19;                %[mmol/L]        Monod Kinetic Constant for Glucose Uptake  nach Frahm 2020  
    kGln = 0.3;                 %[mmol/L]        Monod Kinetic Constant for Glutamine Uptake  
    KsGlc = 0.03;               %[mmol/L]        Monod Kinetic Constant for Glucose          
    KsGln = 0.03;               %[mmol/L]        Monod Kinetic Constant for Glutamine      
    qGlc_max = 1.8*10^-8;            %[mmol/cells *h] Maximum Cell-specific Glucose Uptake Rate  
    qGln_max = 0.8*10^-8;           %[mmol/cells *h] Maximum Cell-specific Glutamine Uptake Rate

    %%
    %Metabolite rates
    qAmm_uptake_max = 4*10^-12; %[mmol/cells *h] Maximum Cell-specific Ammonia Uptake Rate  
    qLac_uptake_max = 0.4;      %[mmol/cells *h] Maximum Cell-specific Lactate Uptake Rate  
    YAmm_Gln = 0.4;             %[mmol/mmol]     Kinetic production Constant for Ammonia by consuming Glutamine  
    YLac_Glc = 1.6;             %[mmol/mmol]     Kinetic production Constant for Lactate by consuming Glucose  
    Fsample = 0;                %[L]             Sample Volume
    kAmm = 0.5;                 %                Correction Factor for Ammonia uptake
    %%
    %Variables
    my = my_max * (cGlc/(cGlc + KsGlc)) * (cGln/(cGln + KsGln));% - (1 - t/tlag) * alag * my_max; %Cell specific growth rate
    my_d = my_d_min + my_d_max * (KsGlc/(KsGlc + cGlc)) * (KsGln/(KsGln + cGln));                   %Cell specific death rate
    qGlc = qGlc_max * cGlc/(cGlc + kGlc)* (my/(my + my_max)+0.5);                               %Glucose Updake Rate
    qGln = qGln_max * cGln/(cGln + kGln);                                                       %Glutamine Uptake Rate
    qLac = YLac_Glc * qGlc * cGlc/cLac - qLac_uptake_max * (my_max - my)/my_max;                    %Lactate production Rate
    qAmm = YAmm_Gln * qGln * cGln/cAmm - kAmm * qAmm_uptake_max * (my_max - my)/my_max;         %Lactate production Rate
    %%
    %Differential Equations
    A
    dXtdt   = Xv *my - Klys*(Xt - Xv);       % Equation 2 - dXt/dt
    dcGlcdt = -1.0 * Xv * qGlc;              % Equation 3 - dcGlc/dt
    dcGlndt = -1.0 * Xv * qGln;              % Equation 4 - dcGln/dt
    dLacdt  = Xv * qLac;                     % Equation 5 - dcLac/dt
    dcAmmdt = Xv * qAmm;                     % Equation 6 - dcAmm/dt
    dvdt    = Fsample;                       % Equation 7 - dV/dt
   
    [dVariablesdt]=[dXvdt;dXtdt;dcGlcdt;dcGlndt;dLacdt;dcAmmdt;dvdt];
end


In dem Code bestimmt die Laufdauer, wann die Schleife neu ansetzt. Nun möchte ich neben dem Kriterium noch die Möglichkeit, eine neue Schleife zu beginnen, wenn Xv0 > 1.5*10^3 ist.

Ich habe das Example ballode.m gefunden und werde es darauf basierend mal versuchen.
Private Nachricht senden Benutzer-Profile anzeigen
 
Neues Thema eröffnen Neue Antwort erstellen



Einstellungen und Berechtigungen
Beiträge der letzten Zeit anzeigen:

Du kannst Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.
Du kannst Dateien in diesem Forum posten
Du kannst Dateien in diesem Forum herunterladen
.





 Impressum  | Nutzungsbedingungen  | Datenschutz | FAQ | goMatlab RSS Button RSS

Hosted by:


Copyright © 2007 - 2024 goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks

MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.