[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FEMM] problem with LUA script



I've a problem starting the LUA script file. the following message pops up:
 
error: No current magnetics input in focus
stack traceback:
1:function 'mi_analyze' [C]
2:main of file '...y Documents\DomusPMFSM_modellingNopera\flux.lua' at line 7
 
Attached are my FEM file and Lua script file.
 
Please help.
 
regards,
aaron


Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now
[Format]      =  4.0
[Frequency]   =  0
[Precision]   =  1e-008
[MinAngle]    =  30
[Depth]       =  1
[LengthUnits] =  millimeters
[ProblemType] =  planar
[Coordinates] =  cartesian
[Comment]     =  "Add comments here."
[PointProps]   = 0
[BdryProps]   = 0
[BlockProps]  = 4
  <BeginBlock>
    <BlockName> = "Air"
    <Mu_x> = 1
    <Mu_y> = 1
    <H_c> = 0
    <H_cAngle> = 0
    <J_re> = 0
    <J_im> = 0
    <Sigma> = 0
    <d_lam> = 0
    <Phi_h> = 0
    <Phi_hx> = 0
    <Phi_hy> = 0
    <LamType> = 0
    <LamFill> = 1
    <BHPoints> = 0
  <EndBlock>
  <BeginBlock>
    <BlockName> = "1006 Steel"
    <Mu_x> = 1404
    <Mu_y> = 1404
    <H_c> = 0
    <H_cAngle> = 0
    <J_re> = 0
    <J_im> = 0
    <Sigma> = 0
    <d_lam> = 0
    <Phi_h> = 0
    <Phi_hx> = 0
    <Phi_hy> = 0
    <LamType> = 0
    <LamFill> = 1
    <BHPoints> = 14
      0	0
      0.040000000000000001	23.873249999999999
      0.080000000000000002	39.78875
      0.28000000000000003	79.577500000000001
      0.59999999999999998	119.36620000000001
      0.88	175.07050000000001
      1.2	286.47899999999998
      1.52	795.77499999999998
      1.6799999999999999	3183.0999999999999
      1.8	7957.75
      1.9199999999999999	15915.5
      2.0800000000000001	31831
      2.1640009999999998	56177.410000000003
      2.2000000000000002	79577.5
  <EndBlock>
  <BeginBlock>
    <BlockName> = "Copper"
    <Mu_x> = 1
    <Mu_y> = 1
    <H_c> = 0
    <H_cAngle> = 0
    <J_re> = 0
    <J_im> = 0
    <Sigma> = 58
    <d_lam> = 0
    <Phi_h> = 0
    <Phi_hx> = 0
    <Phi_hy> = 0
    <LamType> = 0
    <LamFill> = 1
    <BHPoints> = 0
  <EndBlock>
  <BeginBlock>
    <BlockName> = "fer3"
    <Mu_x> = 1
    <Mu_y> = 1
    <H_c> = 240000
    <H_cAngle> = 0
    <J_re> = 0
    <J_im> = 0
    <Sigma> = 0
    <d_lam> = 0
    <Phi_h> = 0
    <Phi_hx> = 0
    <Phi_hy> = 0
    <LamType> = 0
    <LamFill> = 1
    <BHPoints> = 8
      0	0
      0.5	8293.8047999999999
      1	41092.033100000001
      1.5	89975.2163
      2	139235.39069999999
      2.5	188847.4234
      3	239929.72150000001
      3.5	285130.95799999998
  <EndBlock>
[CircuitProps]  = 2
  <BeginCircuit>
    <CircuitName> = "coila"
    <TotalAmps_re> = 0
    <TotalAmps_im> = 0
    <CircuitType> = 1
  <EndCircuit>
  <BeginCircuit>
    <CircuitName> = "coilb"
    <TotalAmps_re> = 0
    <TotalAmps_im> = 0
    <CircuitType> = 1
  <EndCircuit>
[NumPoints] = 138
-25.439803999999999	0.099902000000000005	0	0
-17.739180000000001	1.0461339999999999	0	0
-16.21292	2.4700669999999998	0	0
-16.1981	2.5655299999999999	0	0
25.439803999999999	-0.099902000000000005	0	0
17.739180000000001	-1.0461339999999999	0	0
16.21292	-2.4700669999999998	0	0
16.1981	-2.5655299999999999	0	0
-17.341918	18.613206999999999	0	0
-12.809568000000001	12.316162	0	0
-12.819167999999999	10.228828999999999	0	0
-12.879208999999999	10.153146	0	0
17.341918	-18.613206999999999	0	0
12.809568000000001	-12.316162	0	0
12.819167999999999	-10.228828999999999	0	0
12.879208999999999	-10.153146	0	0
5.7402509999999998	-13.858193	0	0
4.0648549999999997	-11.290569	0	0
5.4803129999999998	-8.0640359999999998	0	0
13.858193	5.7402509999999998	0	0
11.290569	4.0648549999999997	0	0
8.0640359999999998	5.4803129999999998	0	0
-5.7402509999999998	13.858193	0	0
-4.0648549999999997	11.290569	0	0
-5.4803129999999998	8.0640359999999998	0	0
-4.1875240919558845	11.010945109163465	0	0
-13.858193	-5.7402509999999998	0	0
-11.290569	-4.0648549999999997	0	0
-8.0640359999999998	-5.4803129999999998	0	0
-5.7402509999999998	-13.858193	0	0
-4.2416980000000004	-11.225327999999999	0	0
-4.1513479999999996	-8.8220639999999992	0	0
13.858193	-5.7402509999999998	0	0
11.225327999999999	-4.2416980000000004	0	0
8.8220639999999992	-4.1513479999999996	0	0
5.7402509999999998	13.858193	0	0
4.2416980000000004	11.225327999999999	0	0
4.1513479999999996	8.8220639999999992	0	0
-13.858193	5.7402509999999998	0	0
-11.225327999999999	4.2416980000000004	0	0
-8.8220639999999992	4.1513479999999996	0	0
18.379244	3.282117	0	0
24.775327000000001	5.7772649999999999	0	0
28.120798000000001	7.0866579999999999	0	0
25.460163000000001	13.884527	0	0
22.114692000000002	12.575134	0	0
15.724195999999999	10.065712	0	0
17.050298999999999	6.6733580000000003	0	0
0.099902000000000005	25.439803999999999	0	0
1.0461339999999999	17.739180000000001	0	0
2.4700669999999998	16.21292	0	0
2.5655299999999999	16.1981	0	0
-0.099902000000000005	-25.439803999999999	0	0
-1.0461339999999999	-17.739180000000001	0	0
-2.4700669999999998	-16.21292	0	0
-2.5655299999999999	-16.1981	0	0
18.613206999999999	17.341918	0	0
12.316162	12.809568000000001	0	0
10.228828999999999	12.819167999999999	0	0
10.153146	12.879208999999999	0	0
-18.613206999999999	-17.341918	0	0
-12.316162	-12.809568000000001	0	0
-10.228828999999999	-12.819167999999999	0	0
-10.153146	-12.879208999999999	0	0
-7.0866579999999999	28.120798000000001	0	0
-5.7772649999999999	24.775327000000001	0	0
-28.120798000000001	-7.0866579999999999	0	0
-24.775327000000001	-5.7772649999999999	0	0
7.0866579999999999	-28.120798000000001	0	0
5.7772649999999999	-24.775327000000001	0	0
-13.884527	25.460163000000001	0	0
-12.575134	22.114692000000002	0	0
-25.460163000000001	-13.884527	0	0
-22.114692000000002	-12.575134	0	0
13.884527	-25.460163000000001	0	0
12.575134	-22.114692000000002	0	0
3.282117	-18.379244	0	0
10.065712	-15.724195999999999	0	0
6.6733580000000003	-17.050298999999999	0	0
-18.379244	-3.282117	0	0
-15.724195999999999	-10.065712	0	0
-17.050298999999999	-6.6733580000000003	0	0
-3.282117	18.379244	0	0
-12.386954239629866	26.046301759262263	0	0
-10.065712	15.724195999999999	0	0
-6.6733580000000003	17.050298999999999	0	0
-7.3391179816445966	16.790047178126795	0	0
15.111632	-2.3934470000000001	0	0
15.802654	2.407562	0	0
15.111632	2.3934470000000001	0	0
2.3934470000000001	15.111632	0	0
-2.407562	15.802654	0	0
-2.3934470000000001	15.111632	0	0
-15.111632	2.3934470000000001	0	0
-15.802654	-2.407562	0	0
-15.111632	-2.3934470000000001	0	0
-2.3934470000000001	-15.111632	0	0
2.407562	-15.802654	0	0
2.3934470000000001	-15.111632	0	0
9.472137	12.015349000000001	0	0
13.238498999999999	8.9589259999999999	0	0
12.721484999999999	8.5002250000000004	0	0
-12.015349000000001	9.472137	0	0
-8.9589259999999999	13.238498999999999	0	0
-8.5002250000000004	12.721484999999999	0	0
-9.472137	-12.015349000000001	0	0
-13.238498999999999	-8.9589259999999999	0	0
-12.721484999999999	-8.5002250000000004	0	0
12.015349000000001	-9.472137	0	0
8.9589259999999999	-13.238498999999999	0	0
8.5002250000000004	-12.721484999999999	0	0
-23.307821629059937	10.195050314143913	0	0
-15.025482525804287	6.5722804886807511	0	0
23.30782162905993	-10.195050314143925	0	0
15.025482525804287	-6.5722804886807529	0	0
-2.7553642961003488e-015	-15	0	0
-3.6738190614671318e-016	-2	0	0
1.8096541049320387	-0.85155858313014599	0	0
15	0	0	0
2	0	0	0
0.85155858313014565	1.8096541049320389	0	0
9.1845476536678294e-016	15	0	0
1.2246063538223773e-016	2	0	0
-1.8096541049320392	0.85155858313014499	0	0
-15	1.8369095307335659e-015	0	0
-2	2.4492127076447545e-016	0	0
-0.85155858313014587	-1.8096541049320387	0	0
0.82320940839087053	1.8227249572924467	0	0
10.195050314143909	23.307821629059937	0	0
6.5722804886807564	15.025482525804286	0	0
-10.195050314143902	-23.307821629059941	0	0
-6.572280488680752	-15.025482525804287	0	0
26.569450756396932	-11.621716159991109	0	0
11.621716159991092	26.56945075639694	0	0
-26.56945075639694	11.621716159991095	0	0
-11.621716159991083	-26.569450756396943	0	0
-5.8846874303341927	14.123047147724938	0	0
2.3999999999999999	16.280000000000001	0	0
[NumSegments] = 95
0	1	-1	0	0	9
1	2	-1	0	0	9
2	3	-1	0	0	9
4	5	-1	0	0	0
5	6	-1	0	0	0
6	7	-1	0	0	0
8	9	-1	0	0	9
9	10	-1	0	0	9
10	11	-1	0	0	9
12	13	-1	0	0	0
13	14	-1	0	0	0
14	15	-1	0	0	0
16	17	-1	0	0	1
17	18	-1	0	0	1
19	20	-1	0	0	1
20	21	-1	0	0	1
22	23	-1	0	0	1
23	25	-1	0	0	1
25	24	-1	0	0	1
26	27	-1	0	0	1
27	28	-1	0	0	1
29	30	-1	0	0	1
30	31	-1	0	0	1
32	33	-1	0	0	1
33	34	-1	0	0	1
35	36	-1	0	0	1
36	37	-1	0	0	1
38	39	-1	0	0	1
39	40	-1	0	0	1
41	42	-1	0	0	0
42	43	-1	0	0	0
43	44	-1	0	0	0
44	45	-1	0	0	0
45	46	-1	0	0	0
46	47	-1	0	0	0
47	41	-1	0	0	0
48	49	-1	0	0	0
49	50	-1	0	0	0
50	51	-1	0	0	0
52	53	-1	0	0	8
53	54	-1	0	0	8
54	55	-1	0	0	8
56	57	-1	0	0	0
57	58	-1	0	0	0
58	59	-1	0	0	0
60	61	-1	0	0	8
61	62	-1	0	0	8
62	63	-1	0	0	8
64	65	-1	0	0	0
66	67	-1	0	0	0
68	69	-1	0	0	0
70	71	-1	0	0	0
72	73	-1	0	0	0
74	75	-1	0	0	0
76	69	-1	0	0	0
68	74	-1	0	0	0
75	77	-1	0	0	0
77	78	-1	0	0	0
78	76	-1	0	0	0
79	67	-1	0	0	0
66	72	-1	0	0	0
73	80	-1	0	0	0
80	81	-1	0	0	0
81	79	-1	0	0	0
82	65	-1	0	0	0
64	83	-1	0	0	0
83	70	-1	0	0	0
71	84	-1	0	0	0
84	86	-1	0	0	0
86	85	-1	0	0	0
85	82	-1	0	0	0
87	6	-1	0	0	0
41	88	-1	0	0	0
88	89	-1	0	0	0
90	50	-1	0	0	0
82	91	-1	0	0	0
91	92	-1	0	0	0
93	2	-1	0	0	0
79	94	-1	0	0	0
94	95	-1	0	0	0
96	54	-1	0	0	0
76	97	-1	0	0	0
97	98	-1	0	0	0
99	58	-1	0	0	0
46	100	-1	0	0	0
100	101	-1	0	0	0
102	10	-1	0	0	0
84	103	-1	0	0	0
103	104	-1	0	0	0
105	62	-1	0	0	0
80	106	-1	0	0	0
106	107	-1	0	0	0
108	14	-1	0	0	0
77	109	-1	0	0	0
109	110	-1	0	0	0
[NumArcSegments] = 66
111	0	23.400000000000006	5	0	0	9
112	3	14.624989999999997	5	0	0	9
113	4	23.399999999999977	5	0	0	0
114	7	14.624989999999968	5	0	0	0
8	111	23.400000000000006	5	0	0	9
11	112	14.624989999999997	5	0	0	9
12	113	23.399999999999977	5	0	0	0
15	114	14.624989999999968	5	0	0	0
115	16	22.5	5	0	0	1
18	34	30.600000000000023	5	0	0	1
116	117	64.800000000000011	5	0	0	1
118	19	22.5	5	0	0	1
21	37	30.599999999999994	5	0	0	1
119	120	64.799999999999997	5	0	0	1
121	22	22.5	5	0	0	1
24	40	30.600000000000009	5	0	0	1
122	123	64.800000000000011	5	0	0	1
124	26	22.5	5	0	0	1
28	31	30.600000000000023	5	0	0	1
125	126	64.800000000000011	5	0	0	1
29	115	22.5	5	0	0	1
126	116	25.199999999999989	5	0	0	1
32	118	22.5	5	0	0	1
117	119	25.199999999999989	5	0	0	1
35	121	22.5	5	0	0	1
120	127	0.89432025645195501	5	0	0	0
127	122	24.305679743548048	5	0	0	1
38	124	22.5	5	0	0	1
123	125	25.199999999999989	5	0	0	1
128	48	23.400000000000006	5	0	0	0
129	51	14.624990000000011	5	0	0	0
130	52	23.399999999999977	5	0	0	8
131	55	14.624989999999968	5	0	0	8
56	128	23.399999999999999	5	0	0	0
59	129	14.624990000000004	5	0	0	0
60	130	23.400000000000006	5	0	0	8
63	131	14.624989999999997	5	0	0	8
132	43	37.769457999999986	5	0	0	0
133	64	37.769458	5	0	0	0
134	66	37.769457999999986	5	0	0	0
135	68	37.769457999999986	5	0	0	0
44	133	37.769458	5	0	0	0
70	134	37.769458	5	0	0	0
72	135	37.769457999999986	5	0	0	0
74	132	37.769457999999986	5	0	0	0
87	89	18	5	0	0	0
90	92	18	5	0	0	0
93	95	18	5	0	0	0
96	98	18	5	0	0	0
101	99	18	5	0	0	0
104	102	18	5	0	0	0
107	105	18	5	0	0	0
110	108	18	5	0	0	0
22	38	45.000001999999995	5	0	0	1
26	29	45.00000399999999	5	0	0	1
16	32	45.000001999999995	5	0	0	1
19	35	45.00000399999999	5	0	0	1
102	93	29.25	5	0	0	0
95	107	24.750000999999997	5	0	0	0
105	96	29.25	5	0	0	0
98	110	24.750000999999997	5	0	0	0
108	87	29.25	5	0	0	0
89	101	24.750000999999997	5	0	0	0
99	90	29.25	5	0	0	0
92	136	13.62015726177807	5	0	0	0
136	104	11.129843738221931	5	0	0	0
[NumHoles] = 2
0	0	0
36	13.4	0
[NumBlockLabels] = 23
7.7000000000000002	9.0999999999999996	1	-1	0	0	1	1
-8.8000000000000007	8.0999999999999996	1	-1	0	0	1	1
-8.8000000000000007	-9.1999999999999993	1	-1	0	0	1	1
9.0999999999999996	-7.7999999999999998	1	-1	0	0	1	1
10.699999999999999	25.199999999999999	2	-1	0	0	0	1
-9	22.300000000000001	4	-1	0	21.374692140000001	4	1
-24.199999999999999	14	2	-1	0	0	2	1
-21.800000000000001	-9.1999999999999993	4	-1	0	291.37469213999998	7	1
-10.9	-24.300000000000001	2	-1	0	0	0	1
24	-14.199999999999999	2	-1	0	0	0	1
21.100000000000001	8.5	4	-1	0	111.37469213999999	5	1
8.5	-23.300000000000001	4	-1	0	201.37469214000001	6	1
-19.600000000000001	9.1999999999999993	3	-1	2	0	9	1
-8.8000000000000007	-19.899999999999999	3	-1	1	0	8	1
-6.7999999999999998	15.300000000000001	1	-1	0	0	3	1
15.5	6.4000000000000004	1	-1	0	0	3	1
14.199999999999999	-6.7999999999999998	1	-1	0	0	3	1
5.4000000000000004	-15.9	1	-1	0	0	3	1
-5.7999999999999998	-14.800000000000001	1	-1	0	0	3	1
-15.9	-4.5999999999999996	1	-1	0	0	3	1
-15.300000000000001	4.4000000000000004	1	-1	0	0	3	1
-10.57	10.859999999999999	1	-1	0	0	3	1
2	4.2999999999999998	2	-1	0	0	1	1
showconsole()
clearconsole()
print("Calculate flux per unit stack length")
open('zip004.fem')
handle=openfile("fluxperstack.txt","a")
for n=0,20,1 do
    mi_analyze(0)
    mi_loadsolution()
    mo_seteditmode('area')
mo_clearblock()
    mo_groupselectblock(8)
    a1=mo_blockintegral(1)
    mo_groupselectblock(9)
    a2=mo_blockintegral(1)
    csa=mo_blockintegral(9)
stack=17.5e-3
    flux=(a1-a2)/csa*stack
write(handle,flux,"\n")
    print(n*90/20,flux)
    mi_seteditmode("group")
    mi_selectgroup(1)
    mi_moverotate(0,0,90/20)
 mo_close()
end
closefile(handle)