|
|
楼主 |
发表于 2007-6-20 17:07:19
|
显示全部楼层
更详细的求助了
请帮忙用有限元法做个同步电机电机磁场的模型相关程序(基于MATLAB)如下:% 1:air-gap, 2:culasse stator, 3: fer rotor, 3 Y2 R o0 F& m9 R8 _ F- E
% 4-7: stator conductor, 28 - 29: rotor conductor
7 E" [6 c4 |, R L | F. c. _! e2 G
tic; clear;clc; close all;
' G* n0 Q: A3 ]1 c0 ?+ y9 [' A8 f1 l
! Z* P5 | H( @6 |1 }
4 S6 K" V7 R: ^$ s
% ------------- Draw the geometry of stator, rotor et air-gap --------------7 _# Y) a; O: V D' \3 I
! u; Q6 A0 j) s6 i# v* a4 g( tentref=1e-3; % air-gap depth
- V& D8 \$ {- c' z: sRs=39.385e-3; % radius of (rotor+airgap) ) ~2 T; T7 m, E
Rr=Rs-entref; % radius of rotor
7 _$ e( B. }) d, } Z0 ~Rc=71.75e-3; % radius of stator) N! u0 Q( j/ _0 I/ G" O$ a
4 f7 u9 A( o( S# t: w0 @Nb=140; % number of turns per phase* z3 D' d3 v( q" ~3 j( ]/ J
Long=0.125; % longitude of machine in rotation axis direction4 {- y4 `) B4 k: u) T4 Q v
p=1; % ??+ Z1 F; e7 T$ S0 @0 S* o
f=50; % ??. T* [4 f4 M9 t
$ l0 r& B& z, ?beta=35*pi/180; beta=beta/p; % culasse rotor! ^5 d7 g1 Z1 h' ]1 }% `( c
beta1=50*pi/180; beta1=beta1/p; % epanouissement polaire
/ f3 q4 e( L* I+ r4 ^7 r8 |/ W3 D' W' J$ `* O+ w
dessinP1; % a sub-programme to draw the geometry of the machine section with the parameters defined above. i: n/ ]% V( y% @
% --------------
3 J9 G0 b, B; P H7 J6 C9 X% }3 F7 N+ ^0 M6 Y C
4 O" r$ [, ~( W" \. x5 i; c
% ------------- Rotor positioning and initial mesh --------------
2 a3 \& x6 h; |- T+ g2 y4 T" A& }( ]% a: o3 F
aa=-30*pi/180; % initial angle of rotor0 `: ^" |+ Q' P1 ~+ {$ N& T# Q
gr=groto(gr,(aa)); % rotating the rotor to the angle specified above using the sub-programme 'groto'
, I& A8 e6 L; O* @+ L6 S: Zg=[gsf gr]; % stator + rotor given the whole machine geometry
$ `( c( s/ ~: Zlimites; % a sub-programme defining the bondary condition
* U/ c% n7 R3 |/ {[p,e,t]=initmesh(g); % initial mesh for the partial differential equation resolution
! @- I c* c. `7 v4 M8 e
! |9 m p* n* ^9 ^1 p( Z' F& g+ j % ------------- mesh refine if necessary ------------
3 @7 \; I; h( L6 G% [p,e,t]=refinemesh(g,p,e,t,[1 30]);
4 x! P( U5 `/ d; G4 q% o; w6 V0 x% pdegplot(g); axis equal, hold on ; pdemesh(p,e,t), hold off
9 C3 Y. b' d: W5 V) v' u2 g* K- _( K% pause9 e, U1 i/ P. D5 }; R
% ------------------------------------- W3 a4 H- [4 T. [8 V
6 V) O) s& e; ^4 q. O
: V6 D9 Q9 a; W7 z
. r5 O+ G/ F3 F6 [- H% ------------- specification of parameters required for calculation -------/ e4 ?1 M$ r6 f: H1 e
kexc=0;
7 n: }( K& P& O sigmaexc=kexc*5e6; % conductivity of rotor coil conductor
2 i5 n0 @1 h' q6 s nuo=1/(4e-7*pi); % inverse of permeability of vacuum ) x. c8 x# V% d' B" k' o, X' J+ b( S: V
murs=500; murr=500; % relative permeability of stator and rotor
) O. R3 J, G1 a Z% z; u: Z ( e) ^* O4 U. F) G$ j( C+ O. q6 K
ks=1; kr=0; % ks=1 or 0: stator excited or not; kr=1 or 0: rotor excited or not.# e* a& a4 L4 g! b" \7 p& q
8 C5 Z% \3 H5 L7 d1 `
Jex1=0; Jex11=0;
- q! e8 v# K, K/ z! ? Jex2 = 10e6*ks; Jex21 = -Jex2;
1 I% K& p. x# }8 `" m( M' e Jex3 = 0; Jex31 = 0; e7 j8 r6 B; F; u
% Jex3=10e6*ks; Jex31=-Jex3; % current density of phase a (stator)7 n7 P0 I8 j3 g" V$ ^: ]) W- ?* M
% Jex1=-Jex3/2; Jex11=-Jex1; % current density of phase b (stator)& p9 V, W# } c
% Jex2=-Jex3/2; Jex21=-Jex2; % current density of phase c (stator)
2 M5 B9 _8 x( M Jexr1=10e6*kr; Jexr2=-Jexr1; % current density of rotor excitation
( U* O3 F) w" }7 B
1 ]$ J! N; j. w' g garnissageP1; % a sub-programme for the giving the current density and permeability at each mesh element* L5 z, N5 l. R, A
% -------------
0 o g" Y0 i" {! {! z$ U
% X% A6 O* \- }% @2 F. c
X, K. w$ B8 [. ?+ q! `
. K ^" P5 d& I3 L% ------------- resolution of the partial differential equation and figure ploting ---------3 Q% }! z) k6 B! @' [. y
9 Y# u) A. H& r K1 a; |u=assempde(bond,p,e,t,nu,0,J); % resolution of the partial differential equation) k7 T4 `$ G5 L/ Y- W
% U=ASSEMPDE(B,P,E,T,C,A,F) assembles and solves the PDE problem -div(c*grad(u))+a*u=f
. F7 Z: B4 K5 h
7 y, L. E# M: I# i; Tfigure (1), pdemesh(p,e,t), axis equal, title ('Mesh of the machine section')
8 d/ `- E3 y" H$ v+ z' o2 d7 E( Z# yfigure (2), pdegplot(g); axis equal; hold on; pdecont(p,t,full(real(u)),30), hold off, title('Magnetic field distribution'), % plots using 30 levels.4 o5 R$ E4 @! M0 g6 a W
% ------------------------------
* v4 b' r! A; J
+ d e% Q5 i4 Q7 @0 P" w
4 r. ]4 C1 Y( k+ X+ G k! h
/ T, {) s) o# \$ K% -------------- calculation of the energy stocked in the machine (energy sum in the magnetic field) --------------------
2 B3 h; q; }7 g% ]) r# P( g3 N5 r
2 {& L6 g, F5 L2 T# z% [ux,uy]=pdegrad(p,t,u);
# |6 A6 p7 A9 z% bx=uy;5 A$ f9 z% c7 H' o. L4 U
% by=-ux;6 ^% `2 @: W) s9 _+ b
% for i=1:length(bx); V! s$ Y/ n" K( s! ?
% b(i)=(bx(i)^2+by(i)^2)^.5;0 Q' o- l' C& f
% end
( s: r# W8 d' s2 h% f% nu_e=1/(4e-7*pi);
, i8 @* D; W, _( `& U% nu_c=nu_e;
3 F, z1 h, O7 A, Y8 e% nu_s=1/500*nu_e;
+ J; [" @2 d1 \8 X; ^/ ~% nu_r=1/500*nu_e;
' v2 K+ ]: ^$ a" @" N% h=sparse(1,ntrg);
7 h1 l' P+ A% X. x% ind_e=find(t(4,:)==2);/ Q6 K( J0 ^( a7 g, b
% ind_s=find(t(4,:)==1);
" V' f/ V( N8 J' a5 r3 J4 H% ind_r=find(t(4,:)==3);
( i5 |. n7 J4 T" A. P. J% G$ ^( J J% ind_c=find((t(4,:)>=4) & (t(4,:)<=27));
$ m! E& S& d k$ e% h(ind_e)=nu_e*b(ind_e)';
\0 Z6 E+ p5 S5 r9 k M) g% H% h(ind_s)=nu_s*b(ind_s);
5 J! }' v# s. |" y% h(ind_r)=nu_r*b(ind_r);% \! e/ i( ^7 ~6 t
% h(ind_c)=nu_c*b(ind_c)';- ~# w- G0 e' ?
% aire=pdetrg(p,t);4 Q( c+ x! K# X
% vol_trg=Long*aire;
+ ]- E' k6 m! v t% energ_elem_e=1/2*(h(ind_e).*b(ind_e)').*vol_trg(ind_e);4 l& T# Z0 R# p$ s/ b
% energ_tot_e=sum(energ_elem_e);' l8 b J4 {& w& T6 d" M1 h% F: C! v
% energ_elem_s=1/2*(h(ind_s).*b(ind_s)').*vol_trg(ind_s);
7 y* ~+ E9 I+ y" M6 ~" S: k3 b6 c3 l% energ_tot_s=sum(energ_elem_s);' b0 Y8 J! m; D3 j
% energ_elem_r=1/2*(h(ind_r).*b(ind_r)').*vol_trg(ind_r);! t/ l7 m/ F. t( i
% energ_tot_r=sum(energ_elem_r);
. u+ u: S" ^- f% energ_elem_c=1/2*(h(ind_c).*b(ind_c)').*vol_trg(ind_c);" f' a' f7 e1 H. G' G% L
% energ_tot_c=sum(energ_elem_c);
1 H3 T+ V, o9 `& X9 j: E% energ_total=energ_tot_e+energ_tot_s+energ_tot_r+energ_tot_c;
! W) w7 A' [% P* r% U" j% enr=energ_total;
: L( @1 T& O2 R) {$ c! h2 g+ O% ^! h, V% I
toc; |
|