%RTD_RvsT
%
%This program calculates the RTD resistance as a function of temperature.
%R = R0 * (1 + A * T + B * T^2)
%
%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)

%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);

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

%Done