0
\$\begingroup\$

I am trying to run LTSpice transient simulations automatically using Matlab. Currently, I am using a simple RLC circuit before applying my code to my needs.

I want to 1: set the initial conditions of the LTSpice file (capacitor V and inductor I), 2: run the simulation over a period of time, and 3: set the next frame's initial conditions using the final values from the simulation.

Essentially, I want my simulation results using Matlab to be comparable to having a sinusoidal input voltage over a .tran analysis. How can I approach this? I want to set the initial conditions by using the .ic command and looping through each line of the netlist, but I am having trouble importing the data from LTSpice. How can I achieve this?

Voltage Spike
93k53 gold badges93 silver badges243 bronze badges
asked Oct 25, 2024 at 0:10
\$\endgroup\$
2
  • \$\begingroup\$ There is already a few posts like this \$\endgroup\$ Commented Oct 25, 2024 at 1:17
  • \$\begingroup\$ I don’t understand what you mean by looping through the netlist and importing data to Matlab. It’s also not clear what you need to use Matlab for and in what capacity. \$\endgroup\$ Commented Oct 25, 2024 at 15:13

1 Answer 1

1
\$\begingroup\$

The short answer is you can run lt spice from the command line. To find out how it works check the help file you can run .asc or netlists. If I were you I would just modify the net list open it up as a text file in Matlab do whatever modification you need save it then run LT spice from the command line. If you need to look at an output file you can save that and then open that up and matlab as a text file.

answered Oct 26, 2024 at 16:04
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.