The problem which I noticed is as follow. I am simulating a DC-DC power converter and I want to calculated the average current of a switch while I am making a sweep of two values. For calculation of the current I use the following equations:
Id = range(Isw.it, 4.5ms, 5ms)
Iavg = average(Id)
both equations are in one equation block. I noticed that the Iavg has only one value for both sweeps instead for two values for each sweep. Is that a normal behaviour or I made a mistake somewhere.
Yes, this is a bug. Up to now, the simulation engine can’t handle the different dependency. But the GUI can. So, you can either write the equation directly into the diagram, or chose “Export=no” in the equation block and then simulate again.
Unfortunately, I could not managed to make it work. I tried with Export=no in the equation, but then the value of the Id is not visible in the table (I am trying to print the values in the table). When I write the equations average(Id) in the table I get one value also. i guess the problem is in range function as I see Id as a single vector. But anyway, it is important that you know that there is a bug.
Yes, the range() function makes the trouble, because it creates a new dependency.
But it works, if you write “average(range(Isw.it, 4.5ms, 5ms))” directly into the diagram.
It also works with “Export=no” in an equation component. But then, the equation must be in the same document like the diagram. I.e. if you use a different document for the diagrams than for the schematic, place the equation together with the diagrams. “Export=no” is not necessary then.