clcclear allr=0.05;l=0.01;st=0.0001;v=220;Kf=18;j=3;Tl=60;i=0;w=0;I=[];W=[];t=[];for dt=0:0.0001:1 I=[I i]; t=[t dt]; W=[W w]; i=i+(((v-r*i)-(Kf*w)/l)*st); w=w+((((Kf*i)-Tl)/j)*st);endplot(t,W,'linewidth',4)xlabel('time (sec)','fontsize','18','fontweight','b');ylabel('SPEED (rpm)','fontsize','22','fontweight','b');title('Dynamic model of separately excited dc motor under constant excitation');axis([0 0.1 0.5])gri;dplot(t,I,'linewidth',4)xlabel('time (sec)','fontsize','18','fontweight','b');ylabel('current (A)','fontsize','22','fontweight','b');title('current response of rl circuit');axis([0 0.1 0.5])
MATLAB: What is the error with that code
dynamic modeling of separately excited dc motor
Best Answer