Home Forums Bug Reports yvalue() and xvalue() don’t work in subcircuits Reply To: yvalue() and xvalue() don’t work in subcircuits

#7725
username
Participant

    Hi Carsten,

    I want to model the Coilcraft 1206CS series in this example and later the AxxT/BxxT with the Transmission Line model.

    In AWR MWO and similar tools I also always use interp1() to linearly interpolate the model. This is useful, as you said, for certain types of optimization algorithms. Since the only two functions in the built-in help that might help at least a little are the nearest neighbor functions aka x/yvalue(), I settled for that.

    The C++ models are reasonably okay, but the built-in template does not even compile due to typecast errors. Nevertheless, I managed to implement an SPDT and an SPST switch that can also respond to a specific bit. Like the AWR MWO SPDT switch.
    But with the coilcraft models you would run into other problems. It is not possible to use an array as parameter input for the model. At least if you look at the get functions from “qucsstudio_library.h”. There is only getNumber(), no array or list etc. This would mean that you would have to hardcode the array in the C code. That’s a shame, because Coilcraft only uses two types of models, the one from my first post and the transmissionline one. So the reusability would not be very good.
    The second problem is that you would also have to write your own interp1() and findNearestNeighbor() function for it. Mayby some thing like https://stackoverflow.com/questions/9394867/c-implementation-of-matlab-interp1-function-linear-interpolation

    So all in all not great. Would be much happier if the xvalue() and yvalue() function worked as intended.