- #1
tomg10000
- 3
- 0
Hi,
I am trying to write a short MATLAB program that plots concentration vs distance (oxygen sag curve from two different bod sources in a river). I know the equation I am using is:
C= Cs - [(kd*Mo)*(exp(-x*kr/u)-exp(-x*ka/u))/(Q*ka-kr)] - (Cs-Co)*exp(-x*ka/u) - [(kd*Mo)*(exp(-(x-L)*kr/u)-exp(-(x-L)*ka/u))/(Q*ka-kr)].
Its very long and I am having trouble getting it to work in MATLAB form.
Can someone used to MATLAB give me some hints how to make this work?
I know how to execute a plot by plot(x,C) but the equation is giving me trouble.
Any help would be greatly appreciated.
Thanks.
I am trying to write a short MATLAB program that plots concentration vs distance (oxygen sag curve from two different bod sources in a river). I know the equation I am using is:
C= Cs - [(kd*Mo)*(exp(-x*kr/u)-exp(-x*ka/u))/(Q*ka-kr)] - (Cs-Co)*exp(-x*ka/u) - [(kd*Mo)*(exp(-(x-L)*kr/u)-exp(-(x-L)*ka/u))/(Q*ka-kr)].
Its very long and I am having trouble getting it to work in MATLAB form.
Can someone used to MATLAB give me some hints how to make this work?
I know how to execute a plot by plot(x,C) but the equation is giving me trouble.
Any help would be greatly appreciated.
Thanks.