% Tok, napetost, moc in energija na tuljavi Im=1; Um=0.5; x=0:0.01:2*pi; axis auto fi=-pi/2; %TULJAVA i=Im*sin(x); u=Um.*sin(x-fi); P=0; p=i.*u; plot(x,i,':',x,u,'--','LineWidth',2); hold on plot([0 2*pi], [0 0],'Color','b','LineStyle','--') legend('Tok','Napetost') xlabel('Cas ') ylabel('Tok, Napetost') axis tight hold off %% Moc, Energija figure plot(x,i,':','LineWidth',2); hold on plot(x,u,'g','LineWidth',2) plot(x,p,'r','LineWidth',3) plot([0 2*pi], [P P],'Color','k','LineStyle','-') text(6.5,P,'P'); W=i.^2 area(x,W,'LineWidth',2) colormap summer alpha(.1) xlabel('Cas ') legend('Tok', 'Napetost','Moc', 'Energija') plot([0 2*pi], [0 0],'Color','b','LineStyle','--') axis tight hold off