Posts

Numerical Code for 2D -Transient heat conduction equation

%% Given Values clear all; L=1;                     %edge length A=0.01;                  %area under consideration alpha=9.7e-05;           %thermal diffusivity aluminium n=input('grid size');    %enter grid size dx=L/n; dy=dx; dt=dx/100; x=linspace(0,1,n); y=linspace(1,0,n); time=input('enter time');%enter time t=zeros(n,n); t(:,:)=200;              %initial condition %% Linear boundary condition t(1,:)=linspace(300,320,n); t(:,1)=linspace(300,330,n); t(n,:)=linspace(330,270,n); t(:,n)=linspace(320,270,n); %% solving f.d.e convrg=1; ts=0; tol=1e-06; while ts<=time && convrg>=tol     %convergence criterion     tpast=t;     for i=2:n-1              for j=2:n-1;                 ...

Spur Gear Design//Numerical code for safe design of gear.

Image

NUMERICAL CODE FOR DESIGN OF SPUR GEAR IN MATLAB

Numerical Code for design of spur gear in Matlab. zp =input('no of teeth on pinion='); zg =input('no of teeth on gear='); p=input('enter the value of power transmitted='); np =input('enter the rpm of pinion='); cs =input('enter the value of service factor='); sutp =input('ultimate tensile strength of pinion='); sutg =input( 'ultimate tensile strength of gear='); fs =input('enter the factor of safety='); yp =0.484-(2.85/ zp ); yg =0.484-(2.85/ zg ); sigbp = sutp *(1/3); sigbg = sutg *(1/3); ng = zp / zg * np ; if ( sigbp * yp )<( sigbg * yg )     n= np;z = zp;sut = sutp ;     sigb = sigbp ;     y= yp ;     disp ('Pinion is weak. Designing acc. to pinion'); else     n= ng;z = zg;sut = sutg ;     sigb = sigbg ;  y= yg ;     disp ('Gear is weak. Designing acc. to gear'); end v=5; cv =3/(3+v); Mt=(60000000*p)/(2*pi*n); m...