Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/escomma/ex22.hs

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


--------------------------------------------------------------------------------
import DC
import Circuit
import Print
import Time
import CPUTime

import Array

circuit :: ESim -> [Device]      
circuit z0 = (trf1 1 0 1 2 0 0.430 z0) ++
             (vsrc6 2 1 0 pwl v0 z0) ++
             (res1 3 1 0 1e15 z0) ++
             (trf1 4 1 0 3 0 0.430 z0) ++
             (dio1 5 4 3 z0) ++
             (dio1 6 4 2 z0) ++
             --(cap1 7 4 0 (2 * (2200.0e-6)) z0) ++
             --(res1 7 4 3 1e8 z0) ++
             --(res1 8 4 2 1e8 z0) ++
             (res1 7 5 0 1.2 z0) ++
             (vsrc1 8 4 5 0.0 z0) ++
             (cap1 9 4 0 (220 * (1.0e-6)) z0)       

v0 = defaultVStep
           
op_out = opPrint m
i0 = opvalue m                       
m = dcOP1 [] [] circuit

f = 20000.0
per = 1 / f
  
z = dcTran1 (per / 16) (2 * per) i0 i0  circuit   
tr_out = trPrint [0,1,2,3,4,7,8] z  


main = do op_out
          tr_out 
          
          
pwl = [ (0.0,0.0),
        (400.0,per*0.05),
        (400.0,per*0.4),
        (0.0,per*0.80), 
        (0.0, per)                  
      ]
              
          
          
          

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.