Академический Документы
Профессиональный Документы
Культура Документы
A. Code1
x=[1:0.5:50]
y=x.^2
figure
plot(x,y)
1
B. Code2
x=[0.2:pi/4:50]
y=sin(x)
figure
plot(x,y,'b')
2
C. Code3
x=[0.2:pi/4:50]
y=sin(x-pi/4)
figure
plot(x,y,'-g')
3
D. Code4
x=[0.2:pi/4:50]
y=x.^2
w=sin(x)
z=sin(x-pi/4)
t=cos(x-pi/4)
figure
subplot(4,1,1)
plot(x,y,'.r')
subplot(4,1,2)
plot(x,w,'*b')
subplot(4,1,3)
plot(x,z,'-g')
subplot(4,1,4)
plot(x,t,'+m')
4
E. Code5
x=[0.2:pi/4:50]
y=x.^2
w=sin(x)
z=sin(x-pi/4)
t=cos(x-pi/4)
figure
subplot(2,2,1)
plot(x,y,'.r')
subplot(2,2,2)
plot(x,w,'*b')
subplot(2,2,3)
plot(x,z,'-g')
subplot(2,2,4)
plot(x,t,'+m')
5
F. Code6
x=[0.2:pi/4:50]
y=x.^2
w=sin(x)
z=sin(x-pi/4)
t=cos(x-pi/4)
figure
subplot(2,3,1)
plot(x,y,'.r')
subplot(2,3,2)
plot(x,w,'*b')
subplot(2,3,3)
plot(x,z,'-g')
subplot(2,3,5)
plot(x,t,'+m')
6
G. Code7
x=[0.2:pi/4:50]
y=x.^2
w=sin(x)
z=sin(x-pi/4)
t=cos(x-pi/4)
figure
subplot(2,3,1)
plot(x,y,'.r')
subplot(2,3,2)
plot(x,w,'*b')
subplot(2,3,3)
plot(x,z,'-g')
subplot(2,3,[4,6])
plot(x,t,'+m')
7
H. Code8
[x,y]=meshgrid(1:0.5:10,1:0.5:20)
z=x.^2+y.^2
figure
contour(x,y,z)
untiteled20
x=[30,40,60,100,120,180,240,300]
y=[1.2,0.9,0.87,0.62,0.45,0.22,0.22,0.22]
figure
plot(x,y)
untiteled17
e=[0.2:pi/6:10]
f=sin(e-(pi/4))
figure
plot(e,f)
grid
8
TP2
Exercise:
Laboratory scale of batch absorption of arsenic removal using laterite were
conducted for 24h to reach equilibrium. Table below show the data collection
during experiment. The volume of arsenic solution was 100ml.
9
Answer
10
B. Calculate q of arsenic of each condition plot those data in subplot (function
with Ce).
Code
x=(a(:,2)-a(:,4)).*(0.1)./a(:,6)
w=(a(:,3)-a(:,5)).*(0.1)./a(:,7)
y=a(:,4)
z=a(:,5)
figure
subplot(2,1,1)
plot(y,x,'*g')
subplot(2,1,2)
plot(z,w,'+b')
11
C. Find the absorption isotherm that fit to those data and plot in subplot.
• Linear isotherm
Code
m=[0.0030;0.0146;0.0204;0.0602;0.0798;0.0936;0.0964;0.0982;0.098
6;0.0996;0.0998;0.0998;0.0998]
k=[0.0042;0.0172;0.0343;0.0588;0.0782;0.0875;0.0933;0.0985;0.099
1;0.0993;0.0995;0.0995;0.0995]
u=[4.85;4.27;3.98;1.99;1.01;0.32;0.18;0.09;0.07;0.02;0.01;0.01;0
.01]
v=[9.58;8.28;6.57;4.12;2.18;1.25;0.67;0.15;0.09;0.07;0.05;0.05;0
.05]
n=1
p=polyfit(u,m,n)
a=p(1)
b=p(2)
x=u
q=polyfit(v,k,n)
e=q(1)
d=q(2)
z=v
ymodel=a*x+b
wmodel=e*z+d
figure
subplot(2,1,1)
plot(u,m,'*r',u,ymodel)
subplot(2,1,2)
plot(v,k,'*g',v,wmodel)
12
13
• Langmuir isotherm
Code
m=[0.0030;0.0146;0.0204;0.0602;0.0798;0.0936;0.0964;0.0982;0.098
6;0.0996;0.0998;0.0998;0.0998]
k=[0.0042;0.0172;0.0343;0.0588;0.0782;0.0875;0.0933;0.0985;0.099
1;0.0993;0.0995;0.0995;0.0995]
u=[4.85;4.27;3.98;1.99;1.01;0.32;0.18;0.09;0.07;0.02;0.01;0.01;0
.01]
v=[9.58;8.28;6.57;4.12;2.18;1.25;0.67;0.15;0.09;0.07;0.05;0.05;0
.05]
n=1
h=u./m
g=v./k
p=polyfit(u,h,n)
a=p(1)
b=p(2)
x=u
q=polyfit(v,g,n)
e=q(1)
d=q(2)
z=v
ymodel=a*x+b
wmodel=e*z+d
figure
subplot(2,1,1)
plot(u,h,'*r',u,ymodel)
subplot(2,1,2)
plot(v,g,'*g',v,wmodel)
14
15