GithubHelp home page GithubHelp logo

peterfeicht / ltspice2matlab Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 17.0 2.2 MB

LTspice2Matlab - Import LTspice data into MATLAB

License: BSD 2-Clause "Simplified" License

MATLAB 53.20% Gnuplot 18.66% AGS Script 28.14%

ltspice2matlab's People

Contributors

peterfeicht avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ltspice2matlab's Issues

Add support for non-binary LTspice XVII files

When adding support for UTF-16 encoded LTspice XVII files I completely forgot about non-binary files, which would encode the data as UTF-16 as well. This is not supported right now and should be added.

Note: MATLAB's fopen function doesn't support UTF-16 officially, though it has been reported to work nonetheless.

Reading stuck on .raw file and not recovering

Issue seems to appear only when Pseudo Transient is used for finding the operating point, and is consistent when I use .option commands 'noopiter', 'gminsteps = 0' and 'itl6 = 0' in my simulation. The function is consistently getting stuck in the loop around line 502 and does not leave it even after few hours (as I left it running overnight).

Error while using function

Recent updated function has unidentified variable or function "tolower"
Actually it should be "lower"

Handle missing time/source values for stepped simulations

The attached .raw file contains four steps of a DC Sweep (.dc) simulation from two separate .step commands. The number of data points is not divisible by 4, because in some of the steps the last source value is missing.

I have no idea why LTspice would save the data this way, but we should try to handle this case nonetheless. I also don't know whether this can occur for Transient (.tran) simulations, but the handling is the same in any case.

Unable to load .raw data with spice list directive

Hello,

I am able to load the .raw file when I run a basic .tran command. However, when I include a .step directive in the simulation I get the following error from MATLAB:

Error using reshape
Size arguments must be real integers.

Error in LTspice2Matlab (line 531)
raw_data.variable_mat = reshape(raw_data.variable_mat, mat_size(1), mat_size(2) / num_steps, num_steps);

Error in test (line 6)
sr = LTspice2Matlab(path);

Any help would be greatley appreciated.

Thank You,

Ethan

flag "double" will allow to also import NGSPICE raw files

Currently the "double" flag is not recognized. This flag signifies that all data is double precision (The LTspice default is that for .TRAN time is float64 and all other data is float32). This format can occur when numdgt is set above 8, however, it also is seen for NGSPICE raw files.
I've added a diff that recognizes 'double'. (Note that there can be problems when the data is not from a .TRAN simulation.)

The same diff also shows a modification for when selected_vars is a string when calling LTspice2Matlab. In that case the program directly returns the data for the indicated trace. The old behavior is that selected_vars returns the index needed to retrieve the data for the trace but not the data itself. Currently it only works for one trace.

I attached the modified MATLAB file just for convenience.

-marcel
lt2m.txt
LTspice2Matlab.txt

New version of ltspice2matlab does not work with Octave 4.0.0

Gentlemen,
after update to the original code of ltspice2matlab it stopped working in Octave 4.0.0.
I fixed it on my local PC, I had to revert to the old-fashioned style of string look-up.
Also newline constant has not been recognized by Octave. I would like to send you the updated code for tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.