
Hallo allerseits,
Hat jemand Erfahrung mit der Einbindung in Python von LTspice-Schaltung, also primär von .asc Dateien?
Weiß zufällig jemand was an dem folgenden Code falsch ist? Wie kann man z.B. die Spannung am Ausgang der Schaltung ausgeben?
----------------------
import pyltspice
circuit = pyltspice.Circuit.from_file("test12Vtransistor.asc")
circuit.set_analysis_type("tran")
circuit.set_time_range(0, 10ms) # 10ms Simulationsdauer
circuit.set_step_size(1ms) # 1ms Schrittweite
circuit.simulate()
time = circuit.get_time()
import matplotlib.pyplot as plt
plt.plot(time, voltage)
plt.xlabel("Zeit (ms)")
plt.ylabel("Spannung (V)")
plt.title("Simulationsergebnisse")
plt.grid(True)
plt.show()
------------------------------
Hat jemand Erfahrung mit der Einbindung in Python von LTspice-Schaltung, also primär von .asc Dateien?
Weiß zufällig jemand was an dem folgenden Code falsch ist? Wie kann man z.B. die Spannung am Ausgang der Schaltung ausgeben?
----------------------
import pyltspice
circuit = pyltspice.Circuit.from_file("test12Vtransistor.asc")
circuit.set_analysis_type("tran")
circuit.set_time_range(0, 10ms) # 10ms Simulationsdauer
circuit.set_step_size(1ms) # 1ms Schrittweite
circuit.simulate()
time = circuit.get_time()
import matplotlib.pyplot as plt
plt.plot(time, voltage)
plt.xlabel("Zeit (ms)")
plt.ylabel("Spannung (V)")
plt.title("Simulationsergebnisse")
plt.grid(True)
plt.show()
------------------------------