Advertisement
sunu

Scilab hw2 cari_UdAC

Oct 12th, 2016
149
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //scilab
  2.  
  3. //function hw2(ACrms_in, UdAV, UdAC)
  4. function hw2(ACrms_in, UdAV, UcRMS_acdc)
  5.  
  6.     printf("Nilai RMS AC masukan (sumber): %3.3f \n", ACrms_in)
  7.     printf("Nilai rata-rata DC keluaran half-wave: %3.3f \n", UdAV)
  8.  
  9. //  printf("Nilai RMS AC keluaran half-wave: %3.3f \n", UdAC)
  10.     printf("Nilai RMS AC+DC keluaran half-wave: %3.3f \n", UcRMS_acdc)
  11.  
  12.  
  13. //  UcRMS_acdc=sqrt((UdAV^2)+(UdAC^2))
  14. //  printf("Nilai tegangan RMS ac+dc keluaran half-wave rectifier: %3.3f \n", UcRMS_acdc)
  15.  
  16.     UdAC=sqrt((UcRMS_acdc^2)-(UdAV^2))
  17.     printf("Nilai tegangan RMS ac keluaran half-wave rectifier: %3.3f \n", UdAC)
  18.  
  19.     ratio1=UdAV/ACrms_in;
  20.     printf("Nilai perbandingan tegangan rata-rata (dc) keluaran terhadap nilai RMS AC masukan: %3.3f \n", ratio1)
  21.  
  22.     ratio2=UcRMS_acdc/ACrms_in;
  23.     printf("Nilai perbandingan tegangan rms ac+dc keluaran terhadap nilai RMS masukan: %3.3f \n", ratio2)
  24.  
  25.     vin_peak = UdAV*%pi;
  26.     printf("Nilai tegangan puncak (Vpeak) masukan berdasarkan tegangan rata-rata keluaran (%3.3f) : %3.3f \n", UdAV, vin_peak)
  27.  
  28.     rect_ratio = ((vin_peak/%pi)^2/(0.5*vin_peak)^2)*100;
  29.     printf("Nilai rectification ratio: %3.3f %% \n", rect_ratio)
  30.  
  31.     form_factor = (UcRMS_acdc)/(UdAV);
  32.     printf("Nilai form factor (FF): %3.3f \n", form_factor)
  33.  
  34.     ripple_factor1 = sqrt((form_factor^2)-1);
  35.     printf("Nilai ripple factor (RF) cara 1: %3.3f \n", ripple_factor1)
  36.  
  37.     ripple_factor2 = UdAC / UdAV;
  38.     printf("Nilai ripple factor (RF) cara 2: %3.3f \n", ripple_factor2)
  39. endfunction
  40.  
  41. //hw2(49,21.2,26.2)
  42. //hw2(12.021,5.4113,6.555)
  43. hw2(12.021,5.4113,8.5)
Advertisement
RAW Paste Data Copied
Advertisement