KETA01 Tenta 2013-03-16 Carmen Arévalo

Contents

Uppfift 1

format shortg
A=[1       0        0   0  0  0  0    1  0  0
   0       1        0   0  0  0  0    1  1  0
   0       0        1   0  0  0  0    0 -1  1
   0       0        0   1  0  0  0   -1  0  1
   0       0        0   0  1  0  0   -1 -1  0
   0       0        0   0  0  1  0    0  0 -1
   -1/3000 0        0   0  0  0  0    0  0  0
   0       -1/6000  0   0  0  0  0    0  0  0
   -1       -1     -1  -1 -1 -1  1    0  0  0
   0       0        1   0  0  0 -0.01 0  0  0];
b=[3000;6000;0;0;0;0;2/3-1;1/2-1;0;0];
disp('The result is given in the following order: anilin, etanol, eten, water, dietylanilin, netylanilin')
x=A\b

S=sum(x(1:6))
disp('the composition (percentage) in the given order is')
comp=x(1:6)/S*100
The result is given in the following order: anilin, etanol, eten, water, dietylanilin, netylanilin

x =

         1000
         3000
       90.909
       1090.9
         3000
       909.09
       9090.9
         2000
         1000
       909.09


S =

       9090.9

the composition (percentage) in the given order is

comp =

           11
           33
            1
           12
           33
           10

Uppgift 2

type convertemp.m

fprintf('\n Resultat:\n')
[F,C]=convertemp(25);
fprintf('25 C är %4.2f F\n',F)
[F,C]=convertemp(100);
fprintf('100 F är %4.2f C\n',C)
function [F,C] = convertemp( x )
%CONVERTEMP converts Fahrenheit to Celsius and C to F
C=5*(x-32)/9;
F=9*x/5+32;

 Resultat:
25 C är 77.00 F
100 F är 37.78 C

Uppgift 3

P=56; R=0.08206;T=450;
f=@(V) P-R*T./(V-0.31566*R)+12717*R^2./(V.*(V+0.31566*R)*sqrt(T));
% f is not defined for negative values of V or for V=0.31566*R=0.0259
V=linspace(0.07,0.7);
y=f(V);
figure
plot(V,y), grid
disp('Molarvolymen (L/g-mol) är')
V=fzero(f,0.5)
Molarvolymen (L/g-mol) är

V =

      0.56981