Forum Replies Created
-
AuthorPosts
-
The function to read in a text file is a great idea!
I simply selected the entire table in the PDF file provided by Coilcraft with the cursor and transferred it to an empty Notepad++ only using ctrl+c/v. Then I used the “Find and Replace” function to replace spaces with ‘,’ and saved the whole thing as a .csv.
From there, I used Matlab/Octave to create the schematic equation you can see in the first post. Because I’m lazy and didn’t want to manually type out the table from Coilcraft, plus it would be very error prone.
So what I’m saying is that I already have a readable text file with the arrays, which is super easy to create with Notepad++ and requires no programming skills. So this should be easy for everyone else. So a .csv passing function for array parameters in “qucsstudio_library.h” would be a useful addition for C++ models.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-interpolationSo all in all not great. Would be much happier if the xvalue() and yvalue() function worked as intended.
I have zipped the attachments. *.sch seems not to be allowed.
Attachments:
-
AuthorPosts