Hakunin

Mata2_Vezba4

Apr 25th, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.86 KB | None | 0 0
  1.                                             DIFERENCIJALNE JEDNACINE - Vezba 4
  2.  
  3. y'+f(x)*y=g(x) {linearna diferencijalna jednacina}
  4.  
  5. dsolve('dif.jed','promenljiva') {opste resenje}
  6. dsolve('dif.jed','uslov','promenljiva') {partikularno resenje}
  7.  
  8. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  9.  
  10.  
  11.  
  12. >> syms x
  13. >> dsolve('Dy=x*y','x')
  14.  
  15. ans =
  16.  
  17. C2*exp(x^2/2)
  18.  
  19. >> dsolve('Dy=x*y','y(0)=1','x')
  20.  
  21. ans =
  22.  
  23. exp(x^2/2)
  24.  
  25.  
  26. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  27.  
  28. {y'=2(2x-y)}
  29.  
  30. >> syms y
  31. >> dsolve('Dy=2*(2*x-y)','x')
  32.  
  33. ans =
  34.  
  35. 2*x + C3/exp(2*x) - 1
  36.  
  37. >> dsolve('Dy=2*(2*x-y)','y(0)=1','x')
  38.  
  39. ans =
  40.  
  41. 2*x + 2/exp(2*x) - 1
  42.  
  43. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  44.  
  45. {x^2*y'=y*(x+y)}
  46.  
  47. >> syms x
  48. >> dsolve('x^2*Dy=y*(x+y)','x')
  49.  
  50. ans =
  51.  
  52.                0
  53.  x/(C2 - log(x))
  54.  
  55. >> dsolve('x^2*Dy=y*(x+y)','y(1)=1/log(2)','x')
  56.  
  57. ans =
  58.  
  59. x/(log(2) - log(x))
  60.  
  61. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  62.  
  63.  
  64. >> syms R C E1
  65. >> dsolve('E1=R*C*Du2+u2','t')
  66.  
  67. ans =
  68.  
  69. E1 - C2/exp(t/(C*R))
  70.  
  71. >> dsolve('E1=R*C*Du2+u2','u2(0)=0','t')
  72.  
  73. ans =
  74.  
  75. E1 - E1/exp(t/(C*R))
  76.  
  77. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  78.  
  79. {odbrana vezbi}
  80.  
  81. >> syms L R
  82. >> dsolve('L*Dil+2*R*il=0','t')
  83.  
  84. ans =
  85.  
  86. C2/exp((2*R*t)/L)
  87.  
  88. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  89.  
  90. {primer 5 strana 106}
  91.  
  92. >> syms L R E1
  93. >> dsolve('L*Dil+2*R*il-E1=0','t')
  94.  
  95. ans =
  96.  
  97. (E1 - C2/exp((2*R*t)/L))/(2*R)
Add Comment
Please, Sign In to add comment