Skip to main content
1-Visitor
April 5, 2012
Solved

Importing SPICE data

  • April 5, 2012
  • 3 replies
  • 9700 views

I am using 5SPICE (5SPICE is an inexpensive SPICE program I use but it doesn't have any processing power beyond presenting the waveforms at various points in the circuit.) to do some circuit analysis and exported the data after clean up to Excel 2010. However, Excel can no longer handle time based data. So I am attempting to transfer the data to Mathcad 15 or Prime 1 or 2. It seems that Excel converted the data to scientific notation so I'll have to go back to the 5SPICE data file and start over.

I'm looking at a 5 millisecond window but it has over 8,000 data points. The task is to calculate the rms current in the input capacitor of a switched mode circuit. I could do it manually by integrating the area but that's not very accurate and I want to try several variations in the switching time, load current, components etc. I'm fairly new to Mathcad and thought this would be a good learning experience. Boy was I right about that.

While this is a switchmode circuit it is not a power supply and actually operates at 250 Hz so the 5 ms window only gives me the rise and fall for one cycle.

Is there anyone out there with experience in this type of data acquisition. This would actually be similar to processing the information from a DAQ system and as I get further along I'll probably want to try that too.

The answer is probably in the user's guide but I haven't found it as yet.

Thanks for any help.

Best answer by RichardJ

The attached worksheet shows to to get the same answer as you get in Excel. However, Mathcad is much more powerful than Excel and there is a much better way to integrate vectors of data. You should calculate an interpolating function and integrate that. In most cases the best choice of interpolating function is a cubic spline (this is not always the case though. Go to "Help", "E-books", "Data Analysis Extension Pack", and under "Application Examples" look at "Numerical Integration of Data).

3 replies

1-Visitor
April 5, 2012

In Mathcad 15 look at "insert, Object, Probe Document" to see if that will help you any.

There doesn't seem to be any information in the help files.

Norm

Mr.E1-VisitorAuthor
1-Visitor
April 5, 2012

Norm,

Thanks for your advice. I'll give it a try.

Larry

1-Visitor
April 6, 2012

What do you mean by "Excel can no longer handle time based data"?

Mr.E1-VisitorAuthor
1-Visitor
April 7, 2012

Michael,

My problem with Excel was graphing a time based set of data. The graph wizard is gone and I simply couldn't get a reasonable plot. Searching online the common response was that Excel had changed and it was now very difficult to deal with time-based data. I didn't pursue it any further. I just switched to Mathcad. I tried Prime 2.0 but it isn't suited to what I'm trying to do.

Fortunately, my data is in 8,126 even increments of time. I can of course do a numerical integration and get where I want to go but I would also like to plot my data. Besides, Mathcad is more suited to the task. I have been able to import and plot the data and am now working on the integration of the current squared. The advantage of Mathcad over Excel is that you can write the equations directly without converiting to cell manipulation.

I started with Mathcad to help recover a lot of the math I've lost over the last 50 years. Just a little side note, I took my third or fourth course in calculus from none other than Theodore Kaczinski. I was a year older than him since I was working my way through school. I started school in 1959 and I believe this was about 1964. He was probably the best math instructor I had at The University of Michigan. I had held him on a pedestal through the years and it was terrible to learn that he was the Unabomber.

1-Visitor
April 7, 2012

I agree that you should go with Mathcad whenever possible.

I just didn't understand what you meant about Excel. It probably can do what you need, but why bother?

Mathcad can accomplish in a few lines what takes spreadsheet gymnastics in Excel.