This shows you the differences between two versions of the page.
|
magnetic_coupling_factor_lua [2021/09/17 20:22] stanzurek created |
magnetic_coupling_factor_lua [2021/11/04 22:45] (current) stanzurek |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ==== Magnetic coupling factor ==== | ==== Magnetic coupling factor ==== | ||
| - | LUA script for calculating magnetic coupling coefficient between two windings. The windings have to be set up as described in the comments in the code below: | + | LUA script for calculating magnetic coupling coefficient between two windings. The windings have to be set up as described in the comments in the code below. |
| + | |||
| + | | **Download the FEM+LUA files: {{/ | ||
| + | |||
| < | < | ||
| Line 11: | Line 15: | ||
| clearconsole() | clearconsole() | ||
| showconsole() | showconsole() | ||
| + | |||
| + | -- mi_modifycircprop takes three parameters | ||
| + | -- 1st = circuit name to be changed, 2nd = 1 = change current value, 3rd = new current value (A) | ||
| + | -- change the curent value to your own, here it is assume that prim=0.01A, sec=10.0A | ||
| + | |||
| -- Simulate first with only secondary current: | -- Simulate first with only secondary current: | ||
| - | mi_modifycircprop(" | + | mi_modifycircprop(" |
| - | mi_modifycircprop(" | + | mi_modifycircprop(" |
| mi_analyze() | mi_analyze() | ||
| mi_loadsolution() | mi_loadsolution() | ||
| print(mo_getcircuitproperties(" | print(mo_getcircuitproperties(" | ||
| print(mo_getcircuitproperties(" | print(mo_getcircuitproperties(" | ||
| - | i, Vsec, Lsec = mo_getcircuitproperties(" | + | i, Vsec, Lsec = mo_getcircuitproperties(" |
| - | i, Vpri_sec, Lpri_sec = mo_getcircuitproperties(" | + | i, Vpri_sec, Lpri_sec = mo_getcircuitproperties(" |
| -- Simulate next with only primary current: | -- Simulate next with only primary current: | ||
| - | mi_modifycircprop(" | + | mi_modifycircprop(" |
| - | mi_modifycircprop(" | + | mi_modifycircprop(" |
| mi_analyze() | mi_analyze() | ||
| mi_loadsolution() | mi_loadsolution() | ||
| print(mo_getcircuitproperties(" | print(mo_getcircuitproperties(" | ||
| print(mo_getcircuitproperties(" | print(mo_getcircuitproperties(" | ||
| - | i, Vsec_pri, Lsec_pri = mo_getcircuitproperties(" | + | i, Vsec_pri, Lsec_pri = mo_getcircuitproperties(" |
| - | i, Vpri, Lpri = mo_getcircuitproperties(" | + | i, Vpri, Lpri = mo_getcircuitproperties(" |
| -- Calculate and print coupling factor: | -- Calculate and print coupling factor: | ||
| coupling_factor = sqrt(Lsec_pri * Lpri_sec / (Lpri * Lsec)) | coupling_factor = sqrt(Lsec_pri * Lpri_sec / (Lpri * Lsec)) | ||