%RTD_VvsT
%
%This program calculates the RTD resistance as a function of temperature.
%R = R0 * (1 + A * T + B * T^2)
%It then calculates the output voltage of the signal conditioner.
%
%Zachary Wolf, 2/11/09

%Input parameters
r0 = 100;               %Resistance at 0C (ohm)
a = 3.9083e-3;          %Linear factor (ohm / C)
b = -5.775e-7;          %Quadratic factor (ohm / C^2)
tf = 0.05;              %Electronics transfer function (V / C)

%Calculate the resistance as a function of temperature
t = 0 : 25;
%t = 19 : .1 : 21;
%t = 0 : 1 : 100;
r = r0 * (1 + a * t + b * t.^2);

%Calculate the output voltage at each temperature
v = tf * t;

%Display the results
for ii = 1 : length(t)
    msg = sprintf('T = %7.3f C, R = %8.3f ohm, V = %7.4f V', t(ii), r(ii), v(ii));
    disp(msg);
end

%Done