Hello everybody,
Does anyone have experience with integrating LTspice circuitry into Python, i.e. primarily .asc files?
Does anyone happen to know what's wrong with the following code? For example, how can you output the voltage at the output of the circuit?
Thanks for your help!!!
Does anyone have experience with integrating LTspice circuitry into Python, i.e. primarily .asc files?
Does anyone happen to know what's wrong with the following code? For example, how can you output the voltage at the output of the circuit?
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()I am a beginner with Python and until now I have many problems to understand how to realize that. Thanks for your help!!!
Larz60+ write Feb-05-2024, 02:48 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Tags have been added for you on this post. Please use BBCode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Tags have been added for you on this post. Please use BBCode tags on future posts.
