Exporting csv from Psim, but got wrong time step, how to solve?

When the LOAD FLAG is 0 and SAVE FLAG is 1, it is ok to export csv file from the Psim with correct time step. The time step is 1e-9. But when the LOAD FLAG is 1 and SAVE FLAG is 0, the time step of the csv file is incomplete. For example, the time step in the csv file is 1e-7,1e-7,…,2e-7; it changes with the time step of 1e-7 but not 1e-9. And within the 100 time step, the time instants are same. I donot know how to solve this problem.

Because I want to obtain the steady state waveforms with very short time step, like 1e-9. So actually, I run my simulation with time step of 1e-7 at first, with LOAD FLAG of 0 and SAVE FLAG of 1. After 0.1s, I change the time step to 1e-9 for running in 0.002 seconds, with LOAD FLAG of 1 and SAVE FLAG of 0. Doing that is for avoiding the problem of “out of memory”. After that, I export the csv file from simview, but always got the wrong time step as mentioned above. How can I deal with this problem? Thank you so much!

I export csv file from the PSIM because I want to draw the waveforms in MATLAB

did the “load flag” = 1 simulation run?

Your first settings should be:

When you run the second time you need to make sure that “Total Time” is larger than the original simulation:

With these settings you are going to run 10ms with .1us timestep

Then 10ms -12 ms (2 ms seconds total) with 1ns timestep

Thank you for your response. Actually, I did the same steps as you mentioned, but after I exported the waveforms in COMMA SEPARATED FILE (*.csv) format, the time period shown in the csv file is just like the first picture. The time step is set to 1e-10 in this case. But the time value in the exported csv file doesn’t change, after about 10000 time values, it changes and increases 1e-6. For example, at first, the time value is 0.1 (Terminating time of first stage running), then from No.2 to No.5000, the time values keep the 0.1. No.5001, the time value is 0.100001, it increases 1e-6. The time values in No.5001 to No. 15000 keep 0.100001. Then in No. 15001, the time value is 0.100002, it increases 1e-6. Just like picture 2 in here.

The time value increases 1e-6 every 10000 times, but not increases 1e-10 once.
So that is my problem, I don’t know what matter happens. Thank you very much!

odd. what is the “Print Step” option? it should be 1.

Also you can do this sort of sim with a script, try this. In the demo I am writing to a text file which is tab separated.

loadsave.script (351 Bytes) loadsave.psimsch (13.8 KB)

Thank you very much for your kindness! The PRINT STEP is always 1 in my simulation, as shown in the first picture.

And I know the print step value is related to the saving step, because I have watched your company’s related introduction video in YOUTUBE. And I definately will not set the Print Step value as ‘10000’, right?

I will try your demo later, and I will share the simulation results with you. (By the way, could you please provide this demo with a lower version, Mine is PSim 9.1)

And another thing I want to tell you is that, if in the first stage operation, I directly set the time step as 1e-9, then I export the csv file. The time value in that csv file will be right, just as shown in the second and third picture.


But if I run my simulation with time step of 1 ns, there will emerge the problem of “out of memory”, and the simulation time will be too long.

actually i have not been able to look at your picutres, can you simply post the to the forum?

we do allow for pictures

I have uploaded all the pictures above.

i was able to recreate the issue. When i save as .CSV after the load/save we lose the precision in the output data. However, I saved the data as a text file (which you should be able to load with matlab still) and I am keeping the time precision.

Thank you very much for your concern. And I will try to apply the txt version data to my waveform drawing. Again, thank you so much for your help!