e593.m

来自「matlab算法集 matlab算法集」· M 代码 · 共 47 行

M
47
字号
%------------------------------------------------------------------------
% Example 5.9.3: Industrial High-Temperature Oven 
%------------------------------------------------------------------------

% Initialize 

   clc
   clear
   m = 100;              % maximum iterations 
   n = 4;                % polynomial degree 
   p = 200;              % number of plot points 
   tol = 1.e-6;          % error tolerance 
   T = 293.15;           % ambient temperature (K) 
   u = 21;               % heater current 	
   alpha = 50;
   beta = 2.0e-7;
   gamma = 800;
   xmin = 1000;
   xmax = 1200;
   c = zeros (n+1,1);	% polynomial coefficients 
   z = zeros (n,1);	% polynomial roots 
   x = zeros (p,1);
   Y = zeros (p,2);
	
% Initialize coefficients 

   fprintf ('Example 5.9.3: Industrial High-Temperature Oven\n');
   c(1) = -beta; 
   c(4) = -alpha;
   c(5) = alpha*T + beta*T^4 + gamma*u^2;
   show ('Coefficients',c)

% Display function 

   for i = 1 : p
      x(i) = xmin + (i-1)*(xmax - xmin)/(p-1);
      Y(i,1) = polyval(c,x(i))/1000;
   end
   graphxy (x,Y,'The Oven Function f','x (^oK)','f(x)/1000')
  
% Compute and display roots 
 
   z = roots (c);
   show ('Roots',z)
%------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?