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

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


--------------------------------------------------------------------------------
import DC
import Circuit
import Print
import System

import Array

circuit :: ESim -> [Device]      
circuit z0 = (trf1 1 1 0 2 0 0.148 z0) ++
             (vsrc2a 2 1 0 650.0 f z0) ++
             (res1 3 1 0 1e15 z0) ++
             (trf1 4 1 0 0 3 0.148 z0) ++
             (dio1 5 4 3 z0) ++
             (dio1 6 4 2 z0) ++
             (cap1 7 4 0 (2 * (1.0e-6)) z0) ++
             (res1 8 4 3 1e6 z0) ++
             (res1 9 4 2 1e6 z0) ++
             (res1 10 5 0 4.8 z0) ++   
             (vsrc1 11 4 5 0.0 z0)     
           
              

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

f = 20000.0
per = 1 / f 

z = dcTran1 (per/8) (2*per) i0 i0 circuit   
tr_out = trPrint [0,1,2,3,4,7,8] 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 [email protected].