Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/escomma/ex20.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 = (vsrc3a 1 1 0 pwl z0) ++
             (res1 2 1 2 1e-6 z0) ++
             (res1 3 2 0 100.0 z0) ++
             (cap1 4 2 0 2.0e-1 z0)
           

pwl = [ (3.0,0.0),
        (4.0,per*0.2),
        (4.0,per*0.5),
        ((0.0),per*0.80), 
        (0.0, per)                  
      ]
              
empty_parm = (ESim (SimInfo OP [] [] [] 0) 0 0 [] []) 
op_out = opPrint m
i0 = opvalue m                       
m = dcOP1 [] [] circuit

f = 20000.0
per = 1 / f
  
z = dcTran1 (per / 64) (2 * per) i0 i0  circuit   
tr_out = trPrint [0,1,2] z


main = do op_out
          tr_out 
          
          
          

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.