31 lines
797 B
C#
31 lines
797 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BaseCellSimulation.Enzyms.Membrane
|
|
{
|
|
public class KLeakChannel : MembranEnzyme
|
|
{
|
|
public double Permeability = 0.01; // 1/s, diffusionsbasiert
|
|
|
|
public override void ComputeRate(double gradient, EnviromentState env)
|
|
{
|
|
rate = Permeability * gradient;
|
|
}
|
|
|
|
public override void ApplyChanges(CellRessources res, double dt)
|
|
{
|
|
double flux = rate * dt;
|
|
res.Res.Ions.K -= flux; // aus der Zelle raus
|
|
res.Env.K += flux;
|
|
}
|
|
|
|
public override double CalculateGradient(CellRessources res)
|
|
{
|
|
return res.Res.Ions.K - res.Env.K;
|
|
}
|
|
}
|
|
}
|