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

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


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


circuit :: ([[Int]],[[Double]]) -> [([[Int]], Double)]
circuit z0 = (res1 1 1 0 50.0 z0) ++ 
             (res1 2 1 3 50000.0 z0) ++ 
             (res1 3 1 2 50.0 z0) ++    
             (res1 4 3 2 5000.0 z0) ++            
             (vdc1 5 3 0 5.0 z0)++    
             (vccs1 6 0 1 1 2 (0.2/50) z0) ++
             (vccs1 7 2 1 1 0 (0.98/50) z0)  

z = dcOP [] [] circuit 
main = opPrint z 

{-
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 webmaster@9p.io.