# Problems with Pspice simulation results

#### d19b

Joined Dec 18, 2015
15
Hi everyone,
I'm working with Orcad Capture and Pspice 16.3 and I have two different issues I want to discuss with you:
1) the first one concerns problems I'm frequently experiencing with Pspice's simulation results. I'm working with the following circuit:

that is a triangle waveform generator in which I've put a memristor replacing one of the resistor of the Schmitt Trigger. The circuit is quite simple, maybe except for the differential equation (defined in memristor model implementation) the tool is required to solve in order to guarantee the correct simulation of the memristor behaviour in the circuit. Once I am able to simulate the circuit avoiding the convergence problems the differential equation involve, I've noticed that many of the simulation results depend on the time simulation I've chosen: for example the period of the output waveform is 97ms when I simulate the circuit for 5 seconds and it magically become 105ms when I increase that time up to 8 seconds and 116ms with 12 seconds of simulation. I know that the tool work with some approximation algorithms but I think that the difference I got among the different results is not negligible! How is that possible? Any possible explications?

2) the second issue also concern simulation results: in another circuit what I expect to find as output is a waveform with time-varible period and time-variable peak, that is a waveform with period and peak that increases or decreases proceeding in the time simulation of the circuit. Since among mesurement results I can only select and display a single value for each variable of the simulated waveform there is a way in Pspice or exporting the results in other tools/software to analitically verify the change of period/peak with time simulation?

Thank you for your attention.

#### dannyf

Joined Sep 13, 2015
2,197
The biggest factor in using simulation is to understand its limitations. Simulation is helpful only if you know what it cannot do.

In this case, yes, finding a local stable solution can be dependently on the timing steps used, and timing steps can be dependent on your choice of simulation horizons. To avoid that, you can pick fixed timing steps -> this may yield longer simulation time.

#### mvaseem

Joined Jan 31, 2014
48
1) As dannyf noted, you can tighten the max time step value so as to force the simulator to take small steps, this would help in increasing accuracy but at the cost of performance.
You can also try tightening various tolerances RELTOL, ABSTOL, VNTOL for better accuracy.
16.3 is quite old version of Pspice, you should be using the latest 16.6 version. Typically many enhancements keep on happening in software algorithms.

2) You can export the waveform data points in text format and process that in xls etc. The requirement is not very clear. Can you elaborate by attaching image of the waveform.

#### d19b

Joined Dec 18, 2015
15
1) Ok, I understand that a more accurate result involve a modify in maximum time step and so a reduction of performances with longer time simulation. Thus I have to decide if optimize the accuracy or the speed of simulation.

2) I can try to give a clearer explanation of what I meant:

This the case of an output waveform in which the peak value changes with time simulation: I can decide to check how this maximum change with time for example using the Max_range option in mesurement results, but on the one hand I will get a fragmentary trend and, on the other hand, anyway the change is visible just observing the figure.

In this case instead what I expect is that the period of the two waveforms changes with time simulation (it doesn't matter if increasing or decreasing so far), but I cannot check it by simply observing the trend of the waveform because the variation I expect should be very slow, so I would like to maybe export the waveform to other tools or maybe continue using Pspice in order to understand the relation between period and time simulation (for example with the goal of obtaining an analitical relation between them). What I cannot do is simply use the period or period_range options from the mesurement results because I cannont know which range to check.
I hope you could understand my request better.

Thank you.

#### mvaseem

Joined Jan 31, 2014
48
I think now I understand the intent.
May be you can do following-
Use a global parameter lets say "par". Use this parameter inside "run time" in simulation settings as - {par}.
Also perform parametric sweep on this parameter, for the range you want your run time to be varied.
Run simulation. This would create multi-section output file, corresponding to each parameter sweep.
Now create measurement - Period_XRange - For the time range common in all sections.
This would give you time period for all sections where each section would correspond to different run time.

One thing to note - Only 16.6 and higher versions of Pspice support parameter to be specified inside "run time" field. This would not work on 16.3 version.

#### d19b

Joined Dec 18, 2015
15
Sorry, I cannot get a different version of Orcad, I'm now working with the 16.3 version, do you have an alternative solution compatible with my version?

#### Apoorva Mahajan

Joined Apr 2, 2016
1
I think now I understand the intent.
May be you can do following-
Use a global parameter lets say "par". Use this parameter inside "run time" in simulation settings as - {par}.
Also perform parametric sweep on this parameter, for the range you want your run time to be varied.
Run simulation. This would create multi-section output file, corresponding to each parameter sweep.
Now create measurement - Period_XRange - For the time range common in all sections.
This would give you time period for all sections where each section would correspond to different run time.

One thing to note - Only 16.6 and higher versions of Pspice support parameter to be specified inside "run time" field. This would not work on 16.3 version.
I tried this with ORCAD 16.6 bt still doesn't work... Could you help me ?