Test_experiment.py 782 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/python3
  2. # This file was automatically generated from drawio2cbd with the command:
  3. # /home/red/git/DrawioConvert/__main__.py Test.drawio -e Test -Ssfargv -F CBD -E delta=0.1
  4. from Test import *
  5. import numpy as np
  6. from CBD.simulator import Simulator
  7. DELTA_T = 0.1
  8. cbd = Test("Test")
  9. # Run the Simulation
  10. sim = Simulator(cbd)
  11. sim.setDeltaT(DELTA_T)
  12. sim.run(1.4)
  13. s = cbd.getSignal("y")
  14. L = len(s)
  15. print("+------------+------------+------------+------------+")
  16. print("| TIME | VALUE | TAN T | ERROR |")
  17. print("+------------+------------+------------+------------+")
  18. for i in range(L):
  19. t, v = s[i]
  20. a = np.tan(t)
  21. e = a - v
  22. print(f"| {t:10.7f} | {v:10.7f} | {a:10.7f} | {e:10.7f} |")
  23. print("+------------+------------+------------+------------+")