Top Banner
2010 2nd International Corence on Education Technolo and Computer (ICET Development of Visual Circuit Calculation Software Based on MATLAB GUI Jingxiu Lee Department of Computer and Information Engineering Luoyang Institute of Science Technology Luoyang, China e-mail: [email protected] Abstract-MA TLAB has been widely applied in circuit analysis calculation as high-powered value calculation software. Because it is inefficient to calculate by programming, and user must master MATLAB language, so the visual circuit calculation software uses object-oriented graphic technology and GUI to automatically compute and save value solution, resolution and oscillogram. Results of experiments show that this soſtware can calculate accurately and effectively, and be easy to master, greatly improve efficiency of circuit calculation. Kwords-MATLAB; GUIDE; Tabular matr; Visualization; Circuit calculations I. INTRODUCTION Computer-aided circuit analysis has been a powerl and widely used assistant tool of circuit analysis and des . ign accompied with e development of modem elecIcal technology and computer. TLAB has already bee a powerl tool in developing circuit analysis calculatIOn soſtware, which can process scientific calculation, sign calculation and graphic process. Meanwhile it c an figure out some peculiar problems which are out of the ability of Multisim [31 .But now, circuit analysis calculation of MA TLAB mainly aims at particular problems, not for all. From the trends of soſtware development, it is can be seen that iendly user interface has been basic interactive portal. The graphic user interface design tool of TLAB- GUIDE, which supports GUI, can design easily-manipulated and convenient interface with menus and conols. II. CIRCUIT EQUATION Circuit calculation soſtware requires that e computer can automatically found equations and solve em in order to realize ccuit auto-computation. Nowadays, there are many easily-solved circuit analysis methods applied for large complicated circuit. Table matrix can directly calculate brch voltage, branch current and node voltage without any trsfos. In additional, it sees a organ as a branch, so ere is no any limitation of organ types. According to table matrix, table matrix equation is as follows: 11 0 -A-T],U b l , 0 l l �b �b l� r l �b J (I) Weijuan Zhang Department of Computer and Information Engineering Luoyang Institute of Science Technology Luoyang, China e-mail: [email protected] A is related matrix, Yb and Zb are matrix of describing org features, Wb is matrix of describing electric power features, Vb' Ib and Vn respectively is branch voltage, branch current and node voltage. Sub-matrix in coefficient matrix are all square matrices. So e equation above also can be written as TX=B, whose solves is X=T I B. III. SOFTWARE SYSTEM STRUCTURE AND FUNCTION DESIGN Generally, circuit calculation can be included into computation of DC Steady, AC Steady and dynamic circuit. Therefore, the soſtware package composes of DC calculation platform, AC calculation platform and dynamic circuit calculation platfo. Each model can input circuit infoation, display results, save results and provide help. AC circuit and dynamic circuit calculation platfo also can display wavefo to help user observe dynamic changes. There are two methods of data input: one is platform input, the oer is importing om Excel. Results of DC circuit and AC circuit calculation are number, which will be saved in Excel; dynamic circuit calculation results are resolution, which will be saved in text. The scope of wavefo display can be fixed also be adjusted. AC circuit waveform is periodic sinusoidal quantity whose scope is fixed; wavefo of dynamic circuit is non- periodic whose scope can be adjusted to observe waveform widely. IV. SOFTWARE FUNCTION IMPLEMENT Soſtwe nction implements are realized by executg callback nction of controls and menu. The foundation of circuit equation and calculation programme flowchart is illustrated as figure 1. . Because all of ree circuits founded in each calculatIOn model are different, coefficient matrix Yb, Zb are different too. For DC, Yb and Zb respectively represent conductivity and resistance of organ. Meanwhile, model founded by AC is vector model, so Yb and Zb respectively represent admittance and impedance, but for e calculation circuit model founded by dynamic circuit, Yb and Zb respectively represent calculation admittance and calculation impedance. The calculation programme and circuit equations which are coded according to flowchart in figure2, are all saved as .m file for other programme. 978-1-4244-6370-11$26.00 © 2010 IEEE V3-113
3
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 2010 2nd International Conference on Education Technology and Computer (ICETC)

    Development of Visual Circuit Calculation Software Based on MATLAB GUI

    Jingxiu Lee Department of Computer and Information Engineering

    Luoyang Institute of Science Technology Luoyang, China

    e-mail: [email protected]

    Abstract-MA TLAB has been widely applied in circuit analysis calculation as high-powered value calculation software. Because it is inefficient to calculate by programming, and user must master MATLAB language, so the visual circuit calculation software uses object-oriented graphic technology and GUI to automatically compute and save value solution, resolution and oscillogram. Results of experiments show that this software can calculate accurately and effectively, and be easy to master, greatly improve efficiency of circuit calculation.

    Keywords-MATLAB; GUIDE; Tabular matrix; Visualization; Circuit calculations

    I. INTRODUCTION

    Computer-aided circuit analysis has been a powerful and widely used assistant tool of circuit analysis and des.ign accompanied with the development of modem electrIcal technology and computer. MA TLAB has already bee a powerful tool in developing circuit analysis calculatIOn software, which can process scientific calculation, sign calculation and graphic process. Meanwhile it can figure out some peculiar problems which are out of the ability of Multisim[31.But now, circuit analysis calculation of MA TLAB mainly aims at particular problems, not for all. From the trends of software development, it is can be seen that friendly user interface has been basic interactive portal. The graphic user interface design tool of MA TLABGUIDE, which supports GUI, can design easily-manipulated and convenient interface with menus and controls.

    II. CIRCUIT EQUATION

    Circuit calculation software requires that the computer can automatically found equations and solve them in order to realize circuit auto-computation. Nowadays, there are many easily-solved circuit analysis methods applied for large complicated circuit. Table matrix can directly calculate branch voltage, branch current and node voltage without any transforms. In additional, it sees a organ as a branch, so there is no any limitation of organ types.

    According to table matrix, table matrix equation is as follows: 11 0 -A-T],U

    bl ,0 l

    l b b l r l b J (I)

    Weijuan Zhang Department of Computer and Information Engineering

    Luoyang Institute of Science Technology Luoyang, China

    e-mail: [email protected]

    A is related matrix, Yb and Zb are matrix of describing organ features, Wb is matrix of describing electric power features, Vb' Ib and Vn respectively is branch voltage, branch current and node voltage. Sub-matrix in coefficient matrix are all square matrices. So the equation above also can be written as TX=B, whose solves is X=TIB.

    III. SOFTWARE SYSTEM STRUCTURE AND FUNCTION DESIGN

    Generally, circuit calculation can be included into computation of DC Steady, AC Steady and dynamic circuit. Therefore, the software package composes of DC calculation platform, AC calculation platform and dynamic circuit calculation platform.

    Each model can input circuit information, display results, save results and provide help. AC circuit and dynamic circuit calculation platform also can display waveform to help user observe dynamic changes.

    There are two methods of data input: one is platform input, the other is importing from Excel.

    Results of DC circuit and AC circuit calculation are number, which will be saved in Excel; dynamic circuit calculation results are resolution, which will be saved in text.

    The scope of waveform display can be fixed also be adjusted. AC circuit waveform is periodic sinusoidal quantity whose scope is fixed; waveform of dynamic circuit is nonperiodic whose scope can be adjusted to observe waveform widely.

    IV. SOFTWARE FUNCTION IMPLEMENT

    Software function implements are realized by executing callback function of controls and menu.

    The foundation of circuit equation and calculation programme flowchart is illustrated as figure 1. .

    Because all of three circuits founded in each calculatIOn model are different, coefficient matrix Yb, Zb are different too. For DC, Yb and Zb respectively represent conductivity and resistance of organ. Meanwhile, model founded by AC is vector model, so Yb and Zb respectively represent admittance and impedance, but for the calculation circuit model founded by dynamic circuit, Yb and Zb respectively represent calculation admittance and calculation impedance. The calculation programme and circuit equations which are coded according to flowchart in figure2, are all saved as .m file for other programme.

    978-1-4244-6370-11$26.00 2010 IEEE V3-113

  • 2010 2nd International Conference on Education Technology and Computer (ICETC)

    Calculated slip branch number and independent nodes

    Formation of correlation matrix

    Formation ofYb, Zb, and Wb matrix based on component type

    The formation tabular matrix

    Figurel. Flowchart

    Data import is completed by callback function of buttons, which is as follows:

    [FileName PathName ]=uigetfile(C* .xls'),'Choose a File');% set up dialog box for opening file

    str= [PathName FileName];% acquire path and file name shuju=xlsread(str);% read Excel into variable shuju set(handles.editl ,'string',num2str(shuju)); % set edit box

    editl which displays variable shuju guidata(hObject,handles); % update hObject manually Data export is completed by callback function of menu,

    whose results are saved in two ways: the number results in Excel, and the resolution in text. The callback function of Excel is as follows:

    NVV=str2num(get(handles.edit7 ,'string'));% read data into variable NVV

    [ FileName,PathName]=uiputfile( ... ,* .xls','Excels(* .xls ) " ...

    'AC node voltage');% set up dialog box for saving file xlswriteCAC node voltage ',NVV,'range');% saved as

    Excel guidata(hObject,handles ); The callback function of text is as follows: VV=get(handles.editl9,'string'), [FileN ame,PathName ]=uiputfile( ...

    '* .txt','Text(* .txt)', ... 'calculation results')

    fid=fopenC calculation results.txt','w'); fprintf(fid,'%s',VV), guidata(hObject,handles );

    V. VISUAL INTERFACE DESIGN

    GUIDE of MA TLAB provides a convenient and efficient integrate environment, where all of user controls supported by GUI are integrated together, and setup of interface appearance, attributes and behave response methods. GUIDE saves the GUI interface designed by users in FIG file. At the same time, it creates a M file which includes codes of GUI initialization and module interface layout. Therefore, friendly interface can be designed by using various controls and their functions provided by GUIDE.

    VI. ApPLICATION EXAMPLE

    Examplel-Calculation of AC Calculate each branch voltage, current and power. First, mark the node number, branch number; choose

    branch reference direction, seen as figure2. Call-out sine steady circuit calculation platform as

    figure3; input circuit information(or import data).Supposed w=lrad/s, the result as figure3 illustrated is saved in Excel. Oscillogram can be various with different variable, which can be seen in figure 4.

    Figure2. AC calculation example ) .iBtQII!.itW--f fJ:; :I VII!J I.E! *.61

    IliAUfI.! JH xllM!fl!i.;c1lM"

    [email protected] VCCB--7

    itn_--H:;;IIM :

    6 , 3 I 7 , I , '0

    '0 , r t $f-

    I rI-jithl

    [email protected] r JH 111M , '0 I l

    II I

    0."""" 17Z!151 17.954

    -c

    :::J

    o .r:::. () c

    un '0

    -161278 411611l

    2417422

    -2

    A

    :lit.> r ,, 111M 'I 10 I 10Ul$ 3 0."""" 0."""" 5 1712851 6 5.103799 7 17.954

    v II , 17.95444 I

    t.>il-5 If.tl!U-ll O:llt.>

    vill;AI!Ii I@] 0 :l1tiO Imml I I :lit"

    I&n I IIIV; '0 A , 261

    10.31100 I 2.610019 161278 3 3.575259 -161278 1.00w 411611l 5 2.5519

    494766 6 2.5519 l4mn 7 8.977221

    1:M"'" I&n I Pr. 0('1'; '00.37'9 A I' .169

  • 2010 2nd International Conference on Education Technology and Computer (ICETC)

    Example2-Calculation of Dynamic circuit Calculate circuit voltage uc(t) , supposed uc( O)=2V,

    draw its waveform.

    3

    O.5

    5 6

    FigureS. Dynamic circuit calculation example

    4kQ

    Firstly, mark circuit node and branches, seen as figure 5, then input circuit information in figure 6 shows the"dynamic circui calculation platform", choose branch voltage and input serial number 5, finally obtain voltage of branch 5 after pushing "display result" button. The resolution is:

    u cCt ) = 4. 9 8 8+0. 156 0e - 6 3*e x p ( - 275 . 0*t)*(O. 1 9 15 e65*cos(315 4. *t) +O. 809 4e66*s in(315 4. *t))

    After choose suitable scope of waveform, we will see the waveform of uc(t) illustrated in figure7

    This sample is from reference [4],whose oscillogram is fit result of it. Reference [4] adopted PSpice to test waveform of uc(t). PSpice and Multisim only can test voltage waveform, not current waveform. However, current waveform can be obtained by choosing different variables and inputting its corresponding serial number in this simulation platform.

    ) fW:5't!.itl1 ['g(g:[8) I>!