No BSD License  

Highlights from
Advanced Mathematics and Mechanics Applications Using MATLAB, 3rd Edition

image thumbnail

Advanced Mathematics and Mechanics Applications Using MATLAB, 3rd Edition

by

 

14 Oct 2002 (Updated )

Companion Software (amamhlib)

[u,z]=tempstdy(theta,r)
function [u,z]=tempstdy(theta,r)
%
% [u,z]=tempstdy(theta,r)
% ~~~~~~~~~~~~~~~~~~~~~~
% Steady state temperature distribution in a 
% circular cylinder of unit radius with 
% piecewise linear boundary values 
% described in global array ubdry. 
global ubdry

thft=2*pi/(1024)*(0:1023); n=100; 
ufft=interp1(pi/180*ubdry(:,1),...
             ubdry(:,2)/1024,thft);
c=fft(ufft); z=exp(i*theta(:))*r(:)';
u=-real(c(1))+2*real(...
   polyval(c(n:-1:1),z)); 

Contact us