Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. (* Defination of state space matrix *)
  2. A = {{-833.3 ,-25.18} , {5193 ,-7.145}} ;
  3. B = { {303.03},{0}} ;
  4. c={{ 0 , 60/(2*[Pi]) }};
  5. d= {{0}} ;
  6.  
  7. (* Response to 12 volt supply ( Analog ) *)
  8. ssmC= StateSpaceModel[{A, B, c, d } ]
  9. Res=OutputResponse[ssmC , 12 , t ] ;
  10. PlotA=Plot[ {Res}, {t,0, 15 },PlotLabel-> {" step Response "}, PlotRange-> 1500]
  11.  
  12.  
  13.  
  14. (* Response to 12 volt supply (ZOh) *)
  15.  
  16. DssmZoH= ToDiscreteTimeModel [ssmC , 0.020 ,Method -> "ZeroOrderHold"]
  17.  
  18. Res = OutputResponse[DssmZoH ,12*UnitStep[n], n ]
  19.  
  20. PlotB= DiscretePlot[{ Res },{n,0,80} , PlotLegends -> {"ZoH " }, PlotRange-> 1500]
  21.  
  22. (* Response to 12 volt supply (FD) *)
  23. add= {{1,0} , {0,1}} + 0.0020*A
  24. ddd= 0.0020*B
  25. ssmC=StateSpaceModel[{add, ddd , c, d },SamplingPeriod->0.0020 ]
  26. Res6=OutputResponse[ssmC ,12*UnitStep[n], n ] ;
  27. PlotC= DiscretePlot[{ Res6 },{n,0,40} , PlotLegends -> {"Forword diff" }, PlotRange-> 1500]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement