Advertisement
gasaichan

Untitled

Nov 17th, 2019
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const l = [0.7, 0.3, 0.1, 0.65, 0.2, 0.1, 0.12, 0.4];
  2. const lPow = -4;
  3. const m = [1, 1.2, 0.9, 1.8, 2.6, 1.8, 1, 1.6];
  4. const mPow = -1;
  5. const r = [650, 720, 1900, 680, 1080, 608, 732, 2000];
  6.  
  7. /**
  8.  * Интенсивность отказов
  9.  */
  10. const intens = l.reduce((sum, e) => (sum += e * 10 ** lPow), 0);
  11.  
  12. /**
  13.  * Наработка на отказ
  14.  */
  15. const t = 1 / intens;
  16.  
  17. /**
  18.  * Коэффициент готовности системы
  19.  */
  20. const mc =
  21.   intens /
  22.   l.reduce(
  23.     (sum, e, index) => (sum += ((e * 10 ** lPow) / m[index]) * 10 ** mPow),
  24.     0
  25.   );
  26.  
  27. const k = mc / (intens + mc);
  28.  
  29. for (let i = 10; i <= 100; i += 10) {
  30.   const K = k + k * Math.exp(-Math.pow(intens + mc, i));
  31.   console.log(`t: ${i}, K: ${K}`);
  32. }
  33.  
  34. const leftSide =
  35.   (k + k * Math.exp(-Math.pow(intens + mc, t))) *
  36.   t *
  37.   r.reduce((sum, e, index) => (sum += e * l[index] * Math.pow(10, lPow)), 0);
  38.  
  39. const rightSide =
  40.   t *
  41.   r.reduce((sum, e, index) => (sum += e * l[index] * Math.pow(10, lPow)), 0);
  42.  
  43. console.log(`Интенсивность отказов: ${intens}`);
  44. console.log(`Наработка на отказ: ${t}`);
  45. console.log(`Коэффициент готовности системы ${k}`);
  46. console.log(`Оценка слева: ${leftSide}`);
  47. console.log(`Оценка справа: ${rightSide}`);
  48.  
  49. console.log(`Риск системы: ${(rightSide + leftSide) / 2}`);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement