|
|
楼主 |
发表于 2007-6-20 17:07:19
|
显示全部楼层
更详细的求助了
请帮忙用有限元法做个同步电机电机磁场的模型相关程序(基于MATLAB)如下:% 1:air-gap, 2:culasse stator, 3: fer rotor,
1 f" m4 S/ B) g7 f% 4-7: stator conductor, 28 - 29: rotor conductor; `2 t% x5 c+ K: x# {
) }0 d E. U r" L7 E& S$ ktic; clear;clc; close all;, L! R O& d2 E+ e
% e0 {9 W, |' p w1 |. U. P0 f0 X# ^* a1 `
1 l- y- [& w) O% F: t
% ------------- Draw the geometry of stator, rotor et air-gap --------------6 [0 I* G/ I" e: q7 J" B
& A6 x, d: S, b( ^9 F
entref=1e-3; % air-gap depth) g1 W! O1 `& ?& T9 H$ X `, g
Rs=39.385e-3; % radius of (rotor+airgap)
* {) N' K8 V- r- {9 PRr=Rs-entref; % radius of rotor
- v5 S% K( H/ o* D4 J1 PRc=71.75e-3; % radius of stator* q$ ^$ ?2 {9 _& _* Q
. e' t8 e0 ]7 J+ R
Nb=140; % number of turns per phase
4 C( M: c; G, m( b& `; q' E8 PLong=0.125; % longitude of machine in rotation axis direction4 n& }9 `) l- s+ ^2 v# y3 C. K) z3 `
p=1; % ??& s' G/ f' }" [8 C
f=50; % ??
5 k% _* L8 [" I; b' o! N. d' w) A% f# c& o0 Y' q$ q' |
beta=35*pi/180; beta=beta/p; % culasse rotor- q& t; Z8 d0 W' b' D& d- R
beta1=50*pi/180; beta1=beta1/p; % epanouissement polaire
/ d& U3 [' K# F1 e p4 A: Q: Y3 J4 S/ O" G2 s
dessinP1; % a sub-programme to draw the geometry of the machine section with the parameters defined above0 D( v/ a! G$ r+ @" \) h3 v" I) K
% --------------$ V" A* C2 X; \1 O" q
# {( a6 L: L$ k; w
" g' S; I5 H( N# z' m% ------------- Rotor positioning and initial mesh --------------
! c+ n$ a- }# B- ^1 X, D ]; ^$ p* H* B- U4 h& ?( a
aa=-30*pi/180; % initial angle of rotor0 Q9 W- r$ x4 B1 g% @1 Q( b
gr=groto(gr,(aa)); % rotating the rotor to the angle specified above using the sub-programme 'groto'
. E. S e) T: d$ ], wg=[gsf gr]; % stator + rotor given the whole machine geometry. r- p4 Z% Q4 }" x8 _" ]
limites; % a sub-programme defining the bondary condition7 S- Y e. u5 b$ r" E. N9 s
[p,e,t]=initmesh(g); % initial mesh for the partial differential equation resolution6 ]% i8 P% r4 M1 I
; L$ j( ^) K6 x% A$ x2 z, l2 P % ------------- mesh refine if necessary ------------
0 J. x' o3 X) O3 h% [p,e,t]=refinemesh(g,p,e,t,[1 30]);: j, \% H1 v6 w
% pdegplot(g); axis equal, hold on ; pdemesh(p,e,t), hold off
" ?$ J9 a; |5 e5 x6 T% pause
! }$ A& @, e( y6 H0 k/ U! n% -------------------------------------
- S. d3 j5 H: T) R# @3 U& U* h! ~+ n% @
/ ]1 \: W0 [$ {3 f
- G* h3 O5 o5 M& L0 {! c* {" J' o0 a: \$ h* d* s0 `( _- o
% ------------- specification of parameters required for calculation -------
3 @, S# [2 c4 {! R kexc=0; 6 _; m8 X) ~' s: O* Q6 [: q- }
sigmaexc=kexc*5e6; % conductivity of rotor coil conductor
1 l/ ]3 S: ~1 {8 T5 i nuo=1/(4e-7*pi); % inverse of permeability of vacuum 6 a$ k/ Z1 b% V6 M; G" A4 D
murs=500; murr=500; % relative permeability of stator and rotor7 V, v! ?0 u8 L% ?( B& L2 v9 s; i5 S
# }; t+ W: J, S8 m9 @4 H ks=1; kr=0; % ks=1 or 0: stator excited or not; kr=1 or 0: rotor excited or not.
( ~* g1 }" ^9 T4 E$ v * a; v' g, X( h6 b
Jex1=0; Jex11=0;
$ H2 x$ V+ p2 S1 Y" T+ E Jex2 = 10e6*ks; Jex21 = -Jex2;3 W0 S) M! c5 h5 n7 j
Jex3 = 0; Jex31 = 0;
" C8 x1 D) t$ d# A6 F% Jex3=10e6*ks; Jex31=-Jex3; % current density of phase a (stator)
6 e! b# V# Z% Q( B. [- ?9 ^% Jex1=-Jex3/2; Jex11=-Jex1; % current density of phase b (stator)5 [6 r t* U% A0 Q( f' e/ X
% Jex2=-Jex3/2; Jex21=-Jex2; % current density of phase c (stator)1 r) s* F4 A6 v# b+ K% B5 V
Jexr1=10e6*kr; Jexr2=-Jexr1; % current density of rotor excitation
/ `$ [8 d% w: x, [/ H7 D1 z4 i
- Q3 r3 N N N6 S" D! A garnissageP1; % a sub-programme for the giving the current density and permeability at each mesh element0 q- V- }& G) F2 v( O
% ------------- 2 ^! a% I% i7 F1 g6 y' E
4 X9 ~) e2 F5 g/ @" u- l
. ] P! @8 h0 u5 n5 w3 L1 E
% {. D* w0 L) S) i+ |* ^/ \
% ------------- resolution of the partial differential equation and figure ploting ---------* e9 y' V' N, l: e
9 D' O& X: s' ]* q% x# @- N3 L
u=assempde(bond,p,e,t,nu,0,J); % resolution of the partial differential equation
5 ^8 X6 l0 K1 b! S0 V% x% U=ASSEMPDE(B,P,E,T,C,A,F) assembles and solves the PDE problem -div(c*grad(u))+a*u=f
! P# c3 |4 i! M% j# j/ f( o. ~/ s" r* O
figure (1), pdemesh(p,e,t), axis equal, title ('Mesh of the machine section')2 i5 Q: S( l6 j* M
figure (2), pdegplot(g); axis equal; hold on; pdecont(p,t,full(real(u)),30), hold off, title('Magnetic field distribution'), % plots using 30 levels.
" M% s+ C2 M; b" J% ------------------------------
; A) r. E2 M! O& Q) z
8 j+ {- ?6 g) Y2 S: h+ g
( z% r3 M: V2 t4 Y& m$ l" c( z1 N1 |. X
% -------------- calculation of the energy stocked in the machine (energy sum in the magnetic field) --------------------
' O1 P# R- o$ y# ~2 S6 }! l: \* D7 H5 A$ I* k
% [ux,uy]=pdegrad(p,t,u);
1 r& f5 V+ [7 b" ^" |- \3 [( o7 x% bx=uy;
6 Z; x& Y' w+ ~ U- k2 w6 A* X! z. f3 W% by=-ux;
# j4 _+ }/ W9 F% for i=1:length(bx);/ \2 L9 v4 p$ k6 k
% b(i)=(bx(i)^2+by(i)^2)^.5;0 ^4 G$ Z1 w- g# n
% end; W% s' H/ N7 Q) N, T
% nu_e=1/(4e-7*pi);" v5 h7 w+ _: n* m+ u# w# s
% nu_c=nu_e;
2 {) e: _4 a! E, c" W- h% nu_s=1/500*nu_e;0 Z5 s, {5 [9 y$ r
% nu_r=1/500*nu_e;
5 |4 a* F, Y3 }: C' I0 u% h=sparse(1,ntrg);
7 R+ c E/ M& v( H* s! R8 \3 d% ind_e=find(t(4,:)==2);
) a- s- H/ C) _% ind_s=find(t(4,:)==1);
0 x1 m9 e H- @% ind_r=find(t(4,:)==3);
" N8 L) l4 f8 H7 |7 a. \* R1 S- C% ind_c=find((t(4,:)>=4) & (t(4,:)<=27));% T0 o" j1 M4 U* h$ @; f# N
% h(ind_e)=nu_e*b(ind_e)';
) T4 j; }) |% Y, w$ g$ |6 B) K% h(ind_s)=nu_s*b(ind_s);
9 D/ M4 Z6 n2 O7 W8 w: N% h(ind_r)=nu_r*b(ind_r);
/ l. `) u6 j2 s: C1 Y3 H% D% h(ind_c)=nu_c*b(ind_c)';
/ _/ h8 w' ^) R) y2 S% aire=pdetrg(p,t);% a1 P2 F; p# O+ z8 L
% vol_trg=Long*aire;
! {0 W. q' K, y% energ_elem_e=1/2*(h(ind_e).*b(ind_e)').*vol_trg(ind_e);
* O) U% h+ A' [. o" q! \% energ_tot_e=sum(energ_elem_e);
& ]- t+ y& |8 x; t) ^/ p" ~% energ_elem_s=1/2*(h(ind_s).*b(ind_s)').*vol_trg(ind_s);
- U% u( ^/ J1 u/ n1 V% energ_tot_s=sum(energ_elem_s);. R1 D- K0 w$ d$ F0 W( H$ B: V, U- ~
% energ_elem_r=1/2*(h(ind_r).*b(ind_r)').*vol_trg(ind_r);
, @9 h4 C( P0 f: T! i% energ_tot_r=sum(energ_elem_r);
: g; o( X }" I7 H% energ_elem_c=1/2*(h(ind_c).*b(ind_c)').*vol_trg(ind_c);
( X' c% X4 r+ g# g$ {% energ_tot_c=sum(energ_elem_c);
( `0 b, T1 q! G& M% energ_total=energ_tot_e+energ_tot_s+energ_tot_r+energ_tot_c;& f1 f6 C& m- }( g, L& P
% enr=energ_total;
8 B9 d* t* E1 n3 V( i1 E, K- ~# s" T/ w# n5 b6 u9 s
toc; |
|