InitalCommit

This commit is contained in:
WyanMueller
2025-11-16 10:30:26 +01:00
parent 8b0b73bba8
commit d2e409d10f
73 changed files with 3209 additions and 0 deletions
@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BaseCellSimulation.Enzyms.Lysosome
{
public class GenericLysosomalEnzyme : InternalEnzym
{
public GenericLysosomalEnzyme()
{
Vmax = 0.2;
Km = 0.1;
}
double redoxRatio = 0.0;
public override void ComputeRate(Resources res)
{
// --- Grundrate basierend auf Protein-Waste ---
rate = Michaelis_Menten(res.Protein.Waste, Vmax, Km);
// --- Energieabhängigkeit ---
double energyCharge = (res.Energy.ATP + 0.5 * res.Energy.ADP) /
(res.Energy.ATP + res.Energy.ADP + res.Energy.AMP + 1e-9);
rate *= Math.Clamp(energyCharge, 0.0, 1.0);
// --- Redoxabhängigkeit ---
redoxRatio = res.Energy.NAD / (res.Energy.NAD + res.Energy.NADH + 1e-9);
rate *= Math.Clamp(redoxRatio, 0.0, 1.0);
// --- pH-Abhängigkeit ---
double acidFactor = 1.0 - 0.5 * Math.Clamp(res.Ions.Protons / 1.0, 0.0, 1.0);
rate *= acidFactor;
// --- Stressfaktor bei hohen ROS ---
double stressPenalty = res.Ions.ROS > 1.0 ? 0.5 : 1.0;
rate *= stressPenalty;
}
public override void ApplyChanges(CellRessources Resources, double dt)
{
var res = Resources.Res;
var ca = Resources.Res.Ca;
ComputeRate(res);
double degraded = Math.Min(res.Protein.Waste, rate * dt);
if (degraded <= 0.0)
return;
// --- Protein-Abbau ---
res.Protein.Waste -= degraded;
// --- Energieverbrauch & minimale Rückgewinnung ---
double atpUsed = degraded * 0.15;
double atpRecovered = degraded * 0.03 * ((res.Energy.ATP + 0.5 * res.Energy.ADP) /
(res.Energy.ATP + res.Energy.ADP + res.Energy.AMP + 1e-9));
Resources.ConsumeATP(atpUsed);
res.Energy.ATP += atpRecovered;
// --- NAD+ → NADH Redoxreaktion ---
double nadUsed = degraded * 0.08;
double actualNadUsed = Math.Min(nadUsed, res.Energy.NAD);
res.Energy.NAD -= actualNadUsed;
res.Energy.NADH += actualNadUsed;
// --- Aminosäuren-Recycling ---
double recyclingEfficiency = 0.4 + 0.3 * ((res.Energy.ATP + 0.5 * res.Energy.ADP) /
(res.Energy.ATP + res.Energy.ADP + res.Energy.AMP + 1e-9));
res.Protein.AminoAcids += degraded * recyclingEfficiency;
// --- Sekundäre Effekte: ROS, Heat, Protonen ---
res.Ions.ROS += degraded * (1.0 - redoxRatio) * 0.01;
res.Heat += degraded * 0.05;
res.Ions.Protons += degraded * 0.005;
// --- Kalziumleckage als Stresssignal ---
ca.CytosolicCa += degraded * 0.00002;
// --- Lysosomenaktivität für Feedback ---
ca.LysosomeActivity = Math.Clamp(rate / Vmax, 0.0, 1.0);
}
}
}