Qucs / qucs

Qucs Project official mirror
http://qucs.sourceforge.net/
GNU General Public License v2.0
1.15k stars 213 forks source link

Component mutualx does not seem available in the GUI #54

Closed guitorri closed 9 years ago

guitorri commented 10 years ago

See: https://github.com/Qucs/qucs/blob/master/qucs-core/src/components/mutualx.h https://github.com/Qucs/qucs/blob/master/qucs-core/src/components/mutualx.cpp

This component is documented on the technical manual, but not available on the Qucs GUI.

ra3xdh commented 10 years ago

Can you provide netlist definitions for this component?

guitorri commented 10 years ago

I will give it a thought. I don't understand how the component is supposed to be used in the first place...

For the record, the available Mutual and 3 Mutual have these schematic/netlist definitions:

  <MUT Tr1 1 250 140 -29 38 0 0 "1 mH" 0 "1 mH" 0 "0.9" 0>
  <MUT2 Tr2 1 250 310 -29 78 0 0 "1 mH" 0 "1 mH" 0 "1 mH" 0 "0.9" 0 "0.9" 0 "0.9" 0>
MUT:Tr1 _net0 _net1 _net2 _net3 L1="1 mH" L2="1 mH" k="0.9"
MUT2:Tr2 _net4 _net5 _net6 _net7 _net8 _net9 L1="1 mH" L2="1 mH" L3="1 mH" k12="0.9" k13="0.9" k23="0.9"

Somehow for the mutualx, the schematic/netlist need to be parametric with the number of inductors.

guitorri commented 10 years ago

QucsStudio seems to have the mutualx. Maybe we can backport it...

yodalee commented 10 years ago

pity that qucsstudio isn't free software lol

guitorri commented 10 years ago

The author of QucsStudio is one of the original authors of Qucs... I might be wrong, but the GUI can be considered as a fork from Qucs and it should also be under GPL. As a derivative work it should not be an issue if we backport his improvements. See discussion in pull #15. We tried to contact him for his consent, so far he did not reply. His core solver seems to be new and not available as source.

ra3xdh commented 9 years ago

I began implementation of this component. Netlist definition could be find Inside qucs-core/src/components/mutualx.cpp Netlist format uses vector L to store inductors values and vector k to strore coupling coefficients matrix. The example of proper netlist entry for mutualx is here:

MUTX:Tr1 _net0 gnd n1 gnd gnd n2 L="[1 mH;1 mH;1 mH]" k="[1.0;0.9;0.9;0.9;1.0;0.9;0.9;0.9;1.0]"

k vector contains also coupling coefficients for self-inductances. These coefficients values should be always set to 1.0.

I backported some sources from QucsStudio to implement this component. Now it is available at https://github.com/ra3xdh/qucs/tree/mutualx

ra3xdh commented 9 years ago

Mutualx is now ready for testing. Here is example schematic and simulation results. mutx1 mutx2 Simulation results are correct. What should I add or remove?

guitorri commented 9 years ago

@ra3xdh it is looking great, thank you for looking into it!

If I may suggest an icon similar to the others, please have it in attachment (png bitmap with transparent background). mutualx

There seems to be a typo on your name on the license headers.

Is there a way to dynamically enlarge/reduce the list or parameters depending on the number of coils? If I start with 3 and want 4, first I have to set 4 press OK then edit the component properties again to modify the new parameters. In this case L4 will take the previous value of k12... I hope it makes sense.

ra3xdh commented 9 years ago

MutualX is based on MultiViewComponent. EqnDefined device is similar dynamically changed component. Its behavior is similar. If we change the number of branches properties list is not updated until OK button is pressed. There may be bug outside component. I will check it.

ra3xdh commented 9 years ago

All is fixed now. Property list is updated properly after Apply button is pressed. componentdialog.cpp was changed. Ready for pull request.

guitorri commented 9 years ago

Merged. No big deal but you forgot to add mutual to the Makefile.am. I fixed it for you. I find it helpful to watch the Travis CI status to see if it is building OK.