Matlab help please - Programmers Heaven

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

#### Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Posts: 2Member
Hi, I am trying to run an mfile, I have derived an equationa n conditions which must be met....the m file is below.

function dc=dcdt(t,c)
K=0.125;
c0=0.125;
vmax=5;
if t<30;
f0=10; % the volumetric flow rate of rice mixture and amylase in mL
fhcl=3.5; % units mL
f1=0; % in the first half hour no chyme is pumped out
V = 17.5+f0*t+fhcl*t; % food in mouth initiates cephalic phase hence the 17.5 in mL
R=vmax*c/(K*c);
z=f0/(f0+fhcl);
tau=V/(f0+fhcl);
elseif t>30;
f0=0;
fhcl=3.5;
f1=5;
tex=t-30;
V=387.5+fhcl*tex-f1*tex;
R=vmax*c/(K*c);
z=f0/(f0+fhcl);
tau=V/(f0+fhcl);
end
dc=((z*c)+((R)*V)-c0)/tau;

I have defined random c0, vmax and k values because i am get to determine thier true value. The file when invoked does give me a graph, however the graph isnt right. I am meant to be getting a rapid increase with a peak then slow decrase. But all i get is a linear curve. Would someone be able help me with this? Btw the file is along run using the rk4.