Monday, February 10, 2014

exercises on rate, R code

MM = function(x, Km, Vmax) {
 ret = Vmax /(1 + (Km/x)^10);
}
x = seq(-0.1,90, by=0.1);
Km = 40;
Vmax = 45; 
y = MM( x,Km,Vmax);
plot( y ~ x,  type='l', lwd=4, ylab='concentration', xlab='time'); #sigmoid shape transport

#get the rate

dy = NA;
for ( i in 2:length(y)) {
  dy[i]= y[i] - y[i-1]
}
plot( dy ~ x, type='l', lwd=4, ylab='rate', xlab='time')

dy2 = 0.25 - dy

plot( dy2 ~ x, type='l', lwd=4, ylab='rate', xlab='time')

KM2 = 40

Vmax2 = 0.25
y2 = MM( x,KM2,Vmax2);
plot( y2 ~ x,  type='l', lwd=4, ylab='rate', xlab='time'); #sigmoid shape transport

y2b = 0.25 - y2

plot( y2b ~ x,  type='l', lwd=4, ylab='rate', xlab='time'); #sigmoid shape transport

y3 = c(rep(0,40),rep(0.25,40))

x3 = seq(1,80,by=1)
plot( y3 ~ x3, type='l', lwd=4, ylab='rate',xlab='time')

y3b = 0.25 - y3

plot( y3b ~ x3, type='l', lwd=4, ylab='rate',xlab='time')

No comments:

Post a Comment