Electronics > PCB/EDA/CAD

How do I slice a vector in a Qucs simulation using an equation?


Any Qucs expert here? I'm trying to calculate some circuit parameters in Qucs using user-defined equations from the simulation results. The simulation is a 1001-point transient simulation, the output node is labelled as "out". After the simulation completes, the output voltage versus time is accessible as a vector out.Vt, and one can access the n-th element using the syntax out.Vt[n] in a user-defined equation. For example, out.Vt[500] is the 500th data point.

Now I need to slice this vector, for example, to obtain the first 500 data points. But I don't know the correct syntax for this task. I've already read the documentation, including Short Description of Mathematical Functions, and Measurement Expressions Reference Manual. Unfortunately, none of these documents contain any helpful example.

I've already tried out.Vt[1:500] and out.Vt[1,500]. But I got either an "Invalid" or "Wrong Dependency" error. What is the correct syntax for slicing a vector in Qucs?

I've already posted this question on Stack Exchange and the Qucs mailing list, but so far didn't get any response. Unfortunately Qucs is a dying breed these days due to lack of development and maintenance, despite the fact that it's still a fairly powerful free and open source circuit simulator.

The following in an equation block will give vectors for plotting within a span, the values outside the span are set to 0

Note that the case else :0 must be included.

If you need to create new truncated vectors, there may be a similar way, but I have not tried that.
maybe functions eye() and linspace()
If you can work out how to do that within qucs, I would like to see your method.


[0] Message Index

There was an error while thanking
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod