function [hustota,viskozita,lambda_spaliny] = hustota_viskozita(temp_K,p,y0_CO2,y0_O2,y0_H2O)
% Vypocet hustoty a vizkozity plynu
%   hustota - uvazujeme idealni plyn
%   viskozita - Zdroj: J.W. Moore, Fyzikální chemie.1. SNTL Praha, 1979. 974 s.

% Molekulové hmotnosti [kg/kmol]

Mw_CO2 = 44.00995;
Mw_O2 = 31.99879;
Mw_H2O = 18.015;
Mw_N2 = 28.0134;

% Prepocet molarnich zlomku na zjednodusenou smes

y_CO2 = y0_CO2;
y_O2 = y0_O2;
y_H2O = y0_H2O;
y_N2 = 1 - (y_CO2+y_O2+y_H2O);

% Molekulova hmotnost smesi [kg/kmol]

Mw = Mw_N2*y_N2+Mw_O2*y_O2+Mw_CO2*y_CO2+Mw_H2O*y_H2O;

% Teplota a tlak

T = temp_K; % [K]
P = p; % [Pa]

% Teplotni zavislosti viskozit (ve tvaru A+B*T+C*T^2)
%   ZDROJ: http://www.kayelaby.npl.co.uk/general_physics/2_2/2_2_3.html -
%   uprava VB(xls)

viskozitaT_CO2 = -1.140E-06+5.900E-08*T-1.708E-11*T^2; % [Pa.s]
viskozitaT_O2 = 3.608E-06+6.252E-08*T-1.774E-11*T^2; % [Pa.s]
viskozitaT_H2O = - 3.360E-07+3.218E-08*T+6.559E-12*T^2; % [Pa.s]
viskozitaT_N2 = 3.355E-06+5.333E-08*T-1.603E-11*T^2; % [Pa.s]

% Vypocet viskozity - Zdroj: J.W. Moore, Fyzikální chemie.1. SNTL Praha,
% 1979. 974 s. % [Pa.s]

viskozita = 1/(y_CO2/viskozitaT_CO2+y_O2/viskozitaT_O2+y_H2O/viskozitaT_H2O+y_N2/viskozitaT_N2); % [Pa.s]

% Teplotni zavislosti tepelnych vodivosti plynu (ve tvaru A+B*T+C*T^2+D*T^3)
%   ZDROJ: http://uchi.vscht.cz/uploads/etabulky/tepvodplyn.html
%   ZDROJ: http://www.engineersedge.com/heat_transfer/thermal-conductivity-gases.htm
%   - pro vodu
%   uprava VB(xls)

tep_vodivostT_CO2 = -7.2139E-03+8.0140E-05*T+5.4760E-09*T^2-1.0526E-11*T^3; % [W.m-1.K-1]
tep_vodivostT_O2 = -3.2720E-04+9.9650E-05*T-3.7426E-08*T^2+9.7301E-12*T^3; % [W.m-1.K-1]
tep_vodivostT_H2O = 3.2600E-02+6.6330E-06*T+8.0000E-09*T^2-3.3330E-12*T^3; % [W.m-1.K-1]
tep_vodivostT_N2 = 3.9180E-04+9.8140E-05*T-5.0660E-08*T^2+1.5035E-11*T^3; % [W.m-1.K-1]

% k=SUM(yiki(Mi)^(1/3))/SUM(yi(Mi)^(1/3)) - ZDROJ:PERRY - http://www.eng-tips.com/viewthread.cfm?qid=230518
citatel = y_CO2*tep_vodivostT_CO2*Mw_CO2^(1/3)+y_O2*tep_vodivostT_O2*Mw_O2^(1/3)+y_H2O*tep_vodivostT_H2O*Mw_H2O^(1/3)+y_N2*tep_vodivostT_N2*Mw_N2^(1/3);
menovatel = y_CO2*Mw_CO2^(1/3)+y_O2*Mw_O2^(1/3)+y_H2O*Mw_H2O^(1/3)+y_N2*Mw_N2^(1/3);
lambda_spaliny = citatel/menovatel;

% hustota plynu  [kg/m^3]
R_kmol = 8314.3; % univerzalni plynová konstanta [J.kmol-1.K-1]

hustota = P*Mw/R_kmol/T; % [kg/m^3]

end

