I need help with matlab I have asked this several times befo
I need help with matlab. I have asked this several times before but seem to not be getting the idea across. I will provide the equations and the txt file.
simply put..... what i need to do is use the values in the txt file to enter into the equations to find Kr and D. The txt file has the values printed in the order from top to bottom, Do, Lo, S, H, V, Kd.
here are the txt files and equations.
What i need to do is have three functions. one of them called Function myHW7, one named Function Kr = rearation(....), and the last is for the function D = deoxygen(...).
the Kr function obviously evaluates the equation for Kr. and the D function will then evaluate for D with the t = times from 0 to 250 in half steps. Once those are evaluated i need to plot a graph of D vs the time steps. I know the assignment listing is jumbled but this is all i need help with.
here is what is given to us.
Here is what i have so far.
Ignore the VarName1 it will be changed to PollutionData
I do not know what more information i can give.
5.0 1.0 0000197 20.0 0.055 0.2Solution
>> format long
>> [x]=textread(\'list.txt\',\'%f\');
>> x
x =
5.000000000000000
1.000000000000000
0.000019700000000
20.000000000000000
0.055000000000000
0.200000000000000
>> Do=x(1);
>> Lo=x(2);
>> S=x(3);
>> H=x(4);
>> V=x(5);
>> Kd=x(6);
>> t=0:1:10;
>> Kr=power(V*S,0.5)/power(H,1.5)
Kr =
1.163776181230738e-005
>> D=((Kd*Lo)/(Kr-Kd))*(exp(-Kd*t)-exp(-Kr*t))+Do*exp(-Kr*t)
D =
Columns 1 through 2
5.000000000000000 5.181209968535632
Columns 3 through 4
5.329559485893646 5.451005141459819
Columns 5 through 6
5.550423778147746 5.631808217228715
Columns 7 through 8
5.698427504269070 5.752958107407189
Columns 9 through 10
5.797591333417596 5.834121272546016
Column 11
5.864016801650426
>>

