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

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


--------------------------------------------------------------------------------
import DC
import Circuit


circuit :: ([[Int]],[Double]) -> [Double] -> [Double]
            -> [([[Int]], Double)]
circuit p0 n0 t0 = (res1 1 1 2 100.0 p0 n0 t0) ++ 
                   (res1 2 3 0 100.0 p0 n0 t0) ++ 
                   (res1 3 4 0 1000.0 p0 n0 t0) ++    
                   (vdc1 5 1 0 5.0 p0 n0 t0)++    
                   (ccvs1 6 4 0 2 3 1000.0 p0 n0 t0) 

main = dcOP [0,0,0,0,0,0,0] [0,0,0,0,0,0,0] circuit  
{-
v(1) = 0.0553977447399811
v(2) = 0.0506019355394056
v(3) = 5.0
i(vdc) = -0.00108877165799732
i(vccs) = 1.9183236802302e-05
i(vccs) = 0.00108579579690363
-}

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].