diff --git a/.gitignore b/.gitignore index 66cb575..4758170 100644 --- a/.gitignore +++ b/.gitignore @@ -1,300 +1,300 @@ -# -*.zip -*.rar -*.7z - -# sublime -*.sublime-* - -# codes under development -/_* - -# acm_simc related -*.exe -*.dat -*.pyc -/__pycache__ - -# acm_femm related -/_femm/codes3/log -/_femm/pop -/_femm/run#* -pyrhonen_procedure_s*.tex -*.txt - -# subllime text -*.sublime-project -*.sublime-workspace - -# ----------------------------------------------------- for LaTeX related temporary files - -## Core latex/pdflatex auxiliary files: -*.aux -*.lof -*.log -*.lot -*.fls -*.out -*.toc -*.fmt -*.fot -*.cb -*.cb2 -.*.lb - -## Intermediate documents: -*.dvi -*.xdv -*-converted-to.* -# these rules might exclude image files for figures etc. -*.ps -*.eps -*.pdf - -## Generated if empty string is given at "Please type another file name for output:" -.pdf - -## Bibliography auxiliary files (bibtex/biblatex/biber): -*.bbl -*.bcf -*.blg -*-blx.aux -*-blx.bib -*.run.xml - -## Build tool auxiliary files: -*.fdb_latexmk -*.synctex -*.synctex(busy) -*.synctex.gz -*.synctex.gz(busy) -*.pdfsync - -## Build tool directories for auxiliary files -# latexrun -latex.out/ - -## Auxiliary and intermediate files from other packages: -# algorithms -*.alg -*.loa - -# achemso -acs-*.bib - -# amsthm -*.thm - -# beamer -*.nav -*.pre -*.snm -*.vrb - -# changes -*.soc - -# comment -*.cut - -# cprotect -*.cpt - -# elsarticle (documentclass of Elsevier journals) -*.spl - -# endnotes -*.ent - -# fixme -*.lox - -# feynmf/feynmp -*.mf -*.mp -*.t[1-9] -*.t[1-9][0-9] -*.tfm - -#(r)(e)ledmac/(r)(e)ledpar -*.end -*.?end -*.[1-9] -*.[1-9][0-9] -*.[1-9][0-9][0-9] -*.[1-9]R -*.[1-9][0-9]R -*.[1-9][0-9][0-9]R -*.eledsec[1-9] -*.eledsec[1-9]R -*.eledsec[1-9][0-9] -*.eledsec[1-9][0-9]R -*.eledsec[1-9][0-9][0-9] -*.eledsec[1-9][0-9][0-9]R - -# glossaries -*.acn -*.acr -*.glg -*.glo -*.gls -*.glsdefs -*.lzo -*.lzs - -# uncomment this for glossaries-extra (will ignore makeindex's style files!) -# *.ist - -# gnuplottex -*-gnuplottex-* - -# gregoriotex -*.gaux -*.gtex - -# htlatex -*.4ct -*.4tc -*.idv -*.lg -*.trc -*.xref - -# hyperref -*.brf - -# knitr -*-concordance.tex -# TODO Comment the next line if you want to keep your tikz graphics files -*.tikz -*-tikzDictionary - -# listings -*.lol - -# luatexja-ruby -*.ltjruby - -# makeidx -*.idx -*.ilg -*.ind - -# minitoc -*.maf -*.mlf -*.mlt -*.mtc[0-9]* -*.slf[0-9]* -*.slt[0-9]* -*.stc[0-9]* - -# minted -_minted* -*.pyg - -# morewrites -*.mw - -# nomencl -*.nlg -*.nlo -*.nls - -# pax -*.pax - -# pdfpcnotes -*.pdfpc - -# sagetex -*.sagetex.sage -*.sagetex.py -*.sagetex.scmd - -# scrwfile -*.wrt - -# sympy -*.sout -*.sympy -sympy-plots-for-*.tex/ - -# pdfcomment -*.upa -*.upb - -# pythontex -*.pytxcode -pythontex-files-*/ - -# tcolorbox -*.listing - -# thmtools -*.loe - -# TikZ & PGF -*.dpth -*.md5 -*.auxlock - -# todonotes -*.tdo - -# vhistory -*.hst -*.ver - -# easy-todo -*.lod - -# xcolor -*.xcp - -# xmpincl -*.xmpi - -# xindy -*.xdy - -# xypic precompiled matrices and outlines -*.xyc -*.xyd - -# endfloat -*.ttt -*.fff - -# Latexian -TSWLatexianTemp* - -## Editors: -# WinEdt -*.bak -*.sav - -# Texpad -.texpadtmp - -# LyX -*.lyx~ - -# Kile -*.backup - -# KBibTeX -*~[0-9]* - -# auto folder when using emacs and auctex -./auto/* -*.el - -# expex forward references with \gathertags -*-tags.tex - -# standalone packages -*.sta - -# Makeindex log files +# +*.zip +*.rar +*.7z + +# sublime +*.sublime-* + +# codes under development +/_* + +# acm_simc related +*.exe +*.dat +*.pyc +/__pycache__ + +# acm_femm related +/_femm/codes3/log +/_femm/pop +/_femm/run#* +pyrhonen_procedure_s*.tex +*.txt + +# subllime text +*.sublime-project +*.sublime-workspace + +# ----------------------------------------------------- for LaTeX related temporary files + +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +*.ps +*.eps +*.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs +*.lzo +*.lzs + +# uncomment this for glossaries-extra (will ignore makeindex's style files!) +# *.ist + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Comment the next line if you want to keep your tikz graphics files +*.tikz +*-tikzDictionary + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices and outlines +*.xyc +*.xyd + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# KBibTeX +*~[0-9]* + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +# Makeindex log files *.lpz \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e768b2d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // 使用 IntelliSense 了解相关属性。 + // 悬停以查看现有属性的描述。 + // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "(gdb) Launch", //这个应该是F1中出现的名字 + "preLaunchTask": "Build", //在launch之前运行的任务名,这个名字一定要跟tasks.json中的任务名字大小写一致 + "type": "cppdbg", + "request": "launch", + "program": "${fileDirname}/${fileBasenameNoExtension}.exe", //需要运行的是当前打开文件的目录中,名字和当前文件相同,但扩展名为exe的程序 + "args": [], + "stopAtEntry": false, // 选为true则会在打开控制台后停滞,暂时不执行程序 + "cwd": "${workspaceFolder}", // 当前工作路径:当前文件所在的工作空间 + "environment": [], + "externalConsole": true, // 是否使用外部控制台,选false的话,我的vscode会出现错误 + "MIMode": "gdb", + "miDebuggerPath": "c:/MinGW/bin/gdb.exe", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + }] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..db8b475 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "files.associations": { + "acmsim.h": "c", + "conio.h": "c", + "stdlib.h": "c", + "math.h": "c", + "stdio.h": "c", + "controller.h": "c" + } +} \ No newline at end of file diff --git a/ACMConfig.h b/ACMConfig.h index 6c8024f..03eea6f 100644 --- a/ACMConfig.h +++ b/ACMConfig.h @@ -12,7 +12,7 @@ #define SENSORLESS_CONTROL_HFSI false #define VOLTAGE_CURRENT_DECOUPLING_CIRCUIT False #define SATURATED_MAGNETIC_CIRCUIT False -#define INVERTER_NONLINEARITY false +#define INVERTER_NONLINEARITY true #define TS 0.00025 #define TS_INVERSE 4000 #define TS_UPSAMPLING_FREQ_EXE 0.5 diff --git a/ACMPlot.py b/ACMPlot.py index 3b4101d..1bbc717 100644 --- a/ACMPlot.py +++ b/ACMPlot.py @@ -1,5 +1,6 @@ #coding:u8 -from pylab import plt, mpl, np +from pylab import mpl, np, plt + from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes from mpl_toolkits.axes_grid1.inset_locator import mark_inset # from pprint import pprint @@ -82,6 +83,7 @@ def plot_it(ax, ylabel, d, time=None): (str(idx), df_profiles[key]), # (str(idx), df_profiles[key]), ]), time) + plt.savefig('../img/picture.png') plt.show() quit() diff --git a/ACMSim.h b/ACMSim.h index 031881f..d213f97 100644 --- a/ACMSim.h +++ b/ACMSim.h @@ -4,8 +4,9 @@ /* standard lib */ // #include // bool for _Bool and true for 1 #include // printf #include // bool for _Bool and true for 1 -#include //reqd. for system function prototype -#include // for clrscr, and getch() +// #include //reqd. for system function prototype +// #include // for clrscr, and getch() +#include #include "stdlib.h" // for rand() #include "math.h" #include "time.h" diff --git a/LICENSE.md b/LICENSE.md index f288702..3877ae0 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,674 +1,674 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md index 873f610..82d31af 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,93 @@ -# ACMSIMC_TUT -> AC Machine Simulation in C (Tutorial Version) - -## Introduction -I have used C to simulate motor control and adptive observers for over 4 years now. -This is a tutorial for those who hate using Simulink to simulate ac motor control. -The benefit is that you can directly reuse the codes in DSP based motor drive. - -## Numerial Methods -The numerical integration method is currently RK4, which is quite enough. -DoPri54 will be included in future version (including stiffness detection and variable step numerical integration). - -## Introduction to Current Branches (in time order): -- [IM] vvvf: the skeleton with induction motor simulation and VVVF control. -- [IM] foc: field oriented control (direct/indirect) with basic sensorless control. -- [IM] animate: test the feature of waveform animation like an oscilloscope. -- [PMSM] pmsm: id=0 control for interior permanent magnet synchronous motor. -- [IM] vi_decouple: add voltage-current decoupling circuit for improved control performance during high speed reversal. -- [IM] mras: model reference adaptive system based sensorless control (my 2017-Chen.Huang-Online paper). -- [IM] \_femm: (This branch does not really belong here but I don't want to create a new repository for it...) It is about the design of the induction motor using free softwares as well as fitting the design to the equivalent circuit parameters for further control simulation. -- [IM] saturation: include iron core saturation effect into the induction motor model simulation. -- [Both] inverter_model: simple inverter modeling based on the paper 1996-Choi.Sul-Inverter. -- [Both] **master: contain all the features of the branches mentioned above. The master branch is not updated anymore from this point, because I realized that having both IM and PMSM codes in one place is a silly idea.** -- [PMSM] commissioning_pmsm: (under developing) self-commissioning procedure for permanent magnet motor. -- [PMSM] eemf: sensorless control based on extended emf method proposed by Zhiqian Chen et al. (2003). Sensorless open loop works but closed-loop has problems. -- [PMSM] hfsi-yoon: pulsating type square wave high frequency signal injection method based sensorless control for motor with saliency. -- [PMSM] commissioning_spmsm: self-commissioning procedure for surface mounted permanent magnet synchronous motor. -- [PMSM] spmsm_scvm_harnerfors06: statically compensated voltage model based sensorless control for SPMSM. This branch also includes new dynamic anti-windup and incremental PID regulator. - -(I recommend to use GitKraken to view this repository, so you know clearly which branch is the newest one. Note that master is obsolete. Sorry about my poor code management skills T-T.) - -## Visualization -- The plots are made using package matplotlib. - - In branch animate, I tested the feature of waveform animation with matplotlib. -- You can also try browser based libraries, e.g., plotly_express. - -## Dependency under Windows -- Anaconda 3 (you should be able to call python from cmd.exe) -- MinGW (you should be able to call gcc from cmd.exe) -- FEMM ([femm.info](http://www.femm.info/wiki/HomePage), you do not need this if you are not interested in Finite Element Analysis and motor design) - - PyFEMM (a wrapper for FEMM API; use pip to install this) -- Editor (optional): Sublime Text (preferred) or Visual Studio Code. - -## Dependency under Linux -- FEMM is a Windows-only FEA software. - - Alternative is ElmerFEM for Linux, but it is poorly documented. Please DO NOT try it out unless you are a ドM. -- Others are not tested yet. (Linux users should be able to figure it out...) - -## Compile - -### Compile in Sublime Text -Create a file named "**!C_GCC.sublime-build**" in this folder "C:\Users\yourUserName\AppData\Roaming\Sublime Text 3\Packages\User" with the following content: -```json - { - "working_dir": "$file_path", - "cmd": "gcc -Wall $file_name -o $file_base_name", - "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", - "selector": "source.c", - "variants": - [ - { - "name": "ACMSIMC_TUT", - // "shell_cmd": "gcc $file controller.c observer.c -L. -o $file_base_name && start cmd /c \"${file_path}/${file_base_name}\"" - "shell_cmd": "gcc $file commissioning.c inverter.c controller.c observer.c -L. -o $file_base_name && start cmd /c \"${file_path}/${file_base_name}\"" - } - ] - } -``` -Press down Ctrl + Shift + B to select "ACMSIMC_TUT" and next time you only need to press down Ctrl + B to build. - -### Compile in cmd.exe -Change directory to where main.c is and open the cmd.exe there and type: -```batch -gcc main.c commissioning.c inverter.c controller.c observer.c -I. -L. -o main -``` -Then, double click main.exe to run. -If you have python added to system path, plots will also pop up. - - -## Video Tutorials -For unfamiliar users, I have been creating video tutorials. However, they are currently in Chinese. -> *See [my Bilibili space](https://space.bilibili.com/7132537) (ACTIVELY UPDATED).* -> -> Also take a look at this link to [知乎](https://zhuanlan.zhihu.com/p/64445558) (not acvtively updated). -> -> Also check out [my personal page](https://horychen.github.io) for a list of tutorial videos (not acvtively updated). - -In near future, the English version will be brought about. But I would like to do it in high quality so I procrastinate. - - +# ACMSIMC_TUT +> AC Machine Simulation in C (Tutorial Version) + +## Introduction +I have used C to simulate motor control and adptive observers for over 4 years now. +This is a tutorial for those who hate using Simulink to simulate ac motor control. +The benefit is that you can directly reuse the codes in DSP based motor drive. + +## Numerial Methods +The numerical integration method is currently RK4, which is quite enough. +DoPri54 will be included in future version (including stiffness detection and variable step numerical integration). + +## Introduction to Current Branches (in time order): +- [IM] vvvf: the skeleton with induction motor simulation and VVVF control. +- [IM] foc: field oriented control (direct/indirect) with basic sensorless control. +- [IM] animate: test the feature of waveform animation like an oscilloscope. +- [PMSM] pmsm: id=0 control for interior permanent magnet synchronous motor. +- [IM] vi_decouple: add voltage-current decoupling circuit for improved control performance during high speed reversal. +- [IM] mras: model reference adaptive system based sensorless control (my 2017-Chen.Huang-Online paper). +- [IM] \_femm: (This branch does not really belong here but I don't want to create a new repository for it...) It is about the design of the induction motor using free softwares as well as fitting the design to the equivalent circuit parameters for further control simulation. +- [IM] saturation: include iron core saturation effect into the induction motor model simulation. +- [Both] inverter_model: simple inverter modeling based on the paper 1996-Choi.Sul-Inverter. +- [Both] **master: contain all the features of the branches mentioned above. The master branch is not updated anymore from this point, because I realized that having both IM and PMSM codes in one place is a silly idea.** +- [PMSM] commissioning_pmsm: (under developing) self-commissioning procedure for permanent magnet motor. +- [PMSM] eemf: sensorless control based on extended emf method proposed by Zhiqian Chen et al. (2003). Sensorless open loop works but closed-loop has problems. +- [PMSM] hfsi-yoon: pulsating type square wave high frequency signal injection method based sensorless control for motor with saliency. +- [PMSM] commissioning_spmsm: self-commissioning procedure for surface mounted permanent magnet synchronous motor. +- [PMSM] spmsm_scvm_harnerfors06: statically compensated voltage model based sensorless control for SPMSM. This branch also includes new dynamic anti-windup and incremental PID regulator. + +(I recommend to use GitKraken to view this repository, so you know clearly which branch is the newest one. Note that master is obsolete. Sorry about my poor code management skills T-T.) + +## Visualization +- The plots are made using package matplotlib. + - In branch animate, I tested the feature of waveform animation with matplotlib. +- You can also try browser based libraries, e.g., plotly_express. + +## Dependency under Windows +- Anaconda 3 (you should be able to call python from cmd.exe) +- MinGW (you should be able to call gcc from cmd.exe) +- FEMM ([femm.info](http://www.femm.info/wiki/HomePage), you do not need this if you are not interested in Finite Element Analysis and motor design) + - PyFEMM (a wrapper for FEMM API; use pip to install this) +- Editor (optional): Sublime Text (preferred) or Visual Studio Code. + +## Dependency under Linux +- FEMM is a Windows-only FEA software. + - Alternative is ElmerFEM for Linux, but it is poorly documented. Please DO NOT try it out unless you are a ドM. +- Others are not tested yet. (Linux users should be able to figure it out...) + +## Compile + +### Compile in Sublime Text +Create a file named "**!C_GCC.sublime-build**" in this folder "C:\Users\yourUserName\AppData\Roaming\Sublime Text 3\Packages\User" with the following content: +```json + { + "working_dir": "$file_path", + "cmd": "gcc -Wall $file_name -o $file_base_name", + "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", + "selector": "source.c", + "variants": + [ + { + "name": "ACMSIMC_TUT", + // "shell_cmd": "gcc $file controller.c observer.c -L. -o $file_base_name && start cmd /c \"${file_path}/${file_base_name}\"" + "shell_cmd": "gcc $file commissioning.c inverter.c controller.c observer.c -L. -o $file_base_name && start cmd /c \"${file_path}/${file_base_name}\"" + } + ] + } +``` +Press down Ctrl + Shift + B to select "ACMSIMC_TUT" and next time you only need to press down Ctrl + B to build. + +### Compile in cmd.exe +Change directory to where main.c is and open the cmd.exe there and type: +```batch +gcc main.c commissioning.c inverter.c controller.c observer.c -I. -L. -o main +``` +Then, double click main.exe to run. +If you have python added to system path, plots will also pop up. + + +## Video Tutorials +For unfamiliar users, I have been creating video tutorials. However, they are currently in Chinese. +> *See [my Bilibili space](https://space.bilibili.com/7132537) (ACTIVELY UPDATED).* +> +> Also take a look at this link to [知乎](https://zhuanlan.zhihu.com/p/64445558) (not acvtively updated). +> +> Also check out [my personal page](https://horychen.github.io) for a list of tutorial videos (not acvtively updated). + +In near future, the English version will be brought about. But I would like to do it in high quality so I procrastinate. + + diff --git a/_femm/codes3/utility_moo.py b/_femm/codes3/utility_moo.py index 3ac1964..99d9654 100644 --- a/_femm/codes3/utility_moo.py +++ b/_femm/codes3/utility_moo.py @@ -1,574 +1,574 @@ -import pygmo as pg -from pylab import plt, np -def my_plot_non_dominated_fronts(points, marker='o', comp=[0, 1], up_to_rank_no=None): - # We plot - fronts, _, _, _ = pg.fast_non_dominated_sorting(points) - - # We define the colors of the fronts (grayscale from black to white) - if up_to_rank_no is None: - cl = list(zip(np.linspace(0.1, 0.9, len(fronts)), - np.linspace(0.1, 0.9, len(fronts)), - np.linspace(0.1, 0.9, len(fronts)))) - else: - cl = list(zip(np.linspace(0.1, 0.9, up_to_rank_no), - np.linspace(0.1, 0.9, up_to_rank_no), - np.linspace(0.1, 0.9, up_to_rank_no))) - - fig, ax = plt.subplots() - - count = 0 - for ndr, front in enumerate(fronts): - count += 1 - # We plot the points - for idx in front: - ax.plot(points[idx][comp[0]], points[idx][ - comp[1]], marker=marker, color=cl[ndr]) - # We plot the fronts - # Frist compute the points coordinates - x = [points[idx][comp[0]] for idx in front] - y = [points[idx][comp[1]] for idx in front] - # Then sort them by the first objective - tmp = [(a, b) for a, b in zip(x, y)] - tmp = sorted(tmp, key=lambda k: k[0]) - # Now plot using step - ax.step([c[0] for c in tmp], [c[1] - for c in tmp], color=cl[ndr], where='post') - if up_to_rank_no is None: - pass - else: - if count >= up_to_rank_no: - break - - return ax -def my_2p5d_plot_non_dominated_fronts(points, marker='o', comp=[0, 1], up_to_rank_no=1, no_text=True): - # from pylab import mpl - # mpl.rcParams['font.family'] = ['Times New Roman'] - # mpl.rcParams['font.size'] = 16.0 - - full_comp = [0, 1, 2] - full_comp.remove(comp[0]) - full_comp.remove(comp[1]) - z_comp = full_comp[0] - - # We plot - # fronts, dl, dc, ndr = pg.fast_non_dominated_sorting(points) - fronts, _, _, _= pg.fast_non_dominated_sorting(points) - - # We define the colors of the fronts (grayscale from black to white) - cl = list(zip(np.linspace(0.9, 0.1, len(fronts)), - np.linspace(0.9, 0.1, len(fronts)), - np.linspace(0.9, 0.1, len(fronts)))) - - fig, ax = plt.subplots(constrained_layout=False) - plt.subplots_adjust(left=None, bottom=None, right=0.85, top=None, wspace=None, hspace=None) - - count = 0 - for ndr, front in enumerate(fronts): - count += 1 - - # Frist compute the points coordinates - x_scale = 1 - y_scale = 1 - z_scale = 1 - if comp[0] == 1: # efficency - x_scale = 100 - if comp[1] == 1: # efficency - y_scale = 100 - if z_comp == 1: # efficency - z_scale = 100 - x = [points[idx][comp[0]]*x_scale for idx in front] - y = [points[idx][comp[1]]*y_scale for idx in front] - z = [points[idx][z_comp] *z_scale for idx in front] - - # # We plot the points - # for idx in front: - # ax.plot(points[idx][comp[0]], points[idx][comp[1]], marker=marker, color=cl[ndr]) - - # Then sort them by the first objective - tmp = [(a, b, c) for a, b, c in zip(x, y, z)] - tmp = sorted(tmp, key=lambda k: k[0]) - # Now plot using step - ax.step([coords[0] for coords in tmp], - [coords[1] for coords in tmp], color=cl[ndr], where='post') - - # Now add color according to the value of the z-axis variable usign scatter - scatter_handle = ax.scatter(x, y, c=z, alpha=0.5, cmap='Spectral', marker=marker, zorder=99) #'viridis' - # color bar - cbar_ax = fig.add_axes([0.875, 0.15, 0.02, 0.7]) - cbar_ax.get_yaxis().labelpad = 10 - clb = fig.colorbar(scatter_handle, cax=cbar_ax) - if z_comp == 0: - z_label = r'$-\rm {TRV}$ [Nm/m^3]' - z_text = '%.0f' - elif z_comp == 1: - z_label = r'$-\eta$ [%]' - z_text = '%.1f' - elif z_comp == 2: - z_label = r'$O_C$ [1]' - z_text = '%.1f' - clb.ax.set_ylabel(z_label, rotation=270) - - - if z_comp == 2: # when OC as z-axis - print('-----------------------------------------------------') - print('-----------------------------------------------------') - print('-----------------------------------------------------') - # Add index next to the points - for x_coord, y_coord, z_coord, idx in zip(x, y, z, front): - if no_text: - pass - else: - ax.annotate( z_text%(z_coord) + ' #%d'%(idx), (x_coord, y_coord) ) - else: - # text next scatter showing the value of the 3rd objective - for i, val in enumerate(z): - if no_text: - pass - else: - ax.annotate( z_text%(val), (x[i], y[i]) ) - - # refine the plotting - if comp[0] == 0: - ax.set_xlabel(r'$-\rm {TRV}$ [Nm/m^3]') - elif comp[0] == 1: - ax.set_xlabel(r'$-\eta$ [%]') - elif comp[0] == 2: - ax.set_xlabel(r'$O_C$ [1]') - - if comp[1] == 0: - ax.set_ylabel(r'$-\rm {TRV}$ [Nm/m^3]') - elif comp[1] == 1: - ax.set_ylabel(r'$-\eta$ [%]') - elif comp[1] == 2: - ax.set_ylabel(r'$O_C$ [1]') - ax.grid() - - # plot up to which domination rank? - if up_to_rank_no is None: - pass - else: - if count >= up_to_rank_no: - break - # Y730 - # fig.savefig(r'C:\Users\horyc\Desktop/'+ '2p5D-%d%d.png'%(comp[0],comp[1]), dpi=300) - return ax -def my_3d_plot_non_dominated_fronts(pop, paretoPoints, fea_config_dict, az=180, comp=[0, 1, 2], plot_option=1): - """ - Plots solutions to the DTLZ problems in three dimensions. The Pareto Front is also - visualized if the problem id is 2,3 or 4. - Args: - pop (:class:`~pygmo.population`): population of solutions to a dtlz problem - az (``float``): angle of view on which the 3d-plot is created - comp (``list``): indexes the fitness dimension for x,y and z axis in that order - Returns: - ``matplotlib.axes.Axes``: the current ``matplotlib.axes.Axes`` instance on the current figure - Raises: - ValueError: if *pop* does not contain a DTLZ problem (veryfied by its name only) or if *comp* is not of length 3 - Examples: - >>> import pygmo as pg - >>> udp = pg.dtlz(prob_id = 1, fdim =3, dim = 5) - >>> pop = pg.population(udp, 40) - >>> udp.plot(pop) # doctest: +SKIP - """ - from mpl_toolkits.mplot3d import axes3d - import matplotlib.pyplot as plt - import numpy as np - # from pylab import mpl - # mpl.rcParams['font.family'] = ['Times New Roman'] - # mpl.rcParams['font.size'] = 16.0 - - # if (pop.problem.get_name()[:-1] != "DTLZ"): - # raise(ValueError, "The problem seems not to be from the DTLZ suite") - - if (len(comp) != 3): - raise(ValueError, "The kwarg *comp* needs to contain exactly 3 elements (ids for the x,y and z axis)") - - # Create a new figure - fig = plt.figure(figsize=(12,8)) - ax = fig.add_subplot(111, projection='3d') - - # plot the points - fits = np.transpose(pop.get_f()) - try: - pass - # ax.plot(fits[comp[0]], fits[comp[1]], fits[comp[2]], 'ro') - except IndexError: - print('Error. Please choose correct fitness dimensions for printing!') - - if False: - # Plot pareto front for dtlz 1 - if plot_option==1: # (pop.problem.get_name()[-1] in ["1"]): - - X, Y = np.meshgrid(np.linspace(0, 0.5, 100), np.linspace(0, 0.5, 100)) - Z = - X - Y + 0.5 - # remove points not in the simplex - for i in range(100): - for j in range(100): - if X[i, j] < 0 or Y[i, j] < 0 or Z[i, j] < 0: - Z[i, j] = float('nan') - - ax.set_xlim(0, 1.) - ax.set_ylim(0, 1.) - ax.set_zlim(0, 1.) - - ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10) - plt.plot([0, 0.5], [0.5, 0], [0, 0]) - - # Plot pareto fronts for dtlz 2,3,4 - if plot_option == 2: # (pop.problem.get_name()[-1] in ["2", "3", "4"]): - # plot the wireframe of the known optimal pareto front - thetas = np.linspace(0, (np.pi / 2.0), 30) - # gammas = np.linspace(-np.pi / 4, np.pi / 4, 30) - gammas = np.linspace(0, (np.pi / 2.0), 30) - - x_frame = np.outer(np.cos(thetas), np.cos(gammas)) - y_frame = np.outer(np.cos(thetas), np.sin(gammas)) - z_frame = np.outer(np.sin(thetas), np.ones(np.size(gammas))) - - ax.set_autoscalex_on(False) - ax.set_autoscaley_on(False) - ax.set_autoscalez_on(False) - - ax.set_xlim(0, 1.8) - ax.set_ylim(0, 1.8) - ax.set_zlim(0, 1.8) - - ax.plot_wireframe(x_frame, y_frame, z_frame) - - # https://stackoverflow.com/questions/37000488/how-to-plot-multi-objectives-pareto-frontier-with-deap-in-python - # def simple_cull(inputPoints, dominates): - # paretoPoints = set() - # candidateRowNr = 0 - # dominatedPoints = set() - # while True: - # candidateRow = inputPoints[candidateRowNr] - # inputPoints.remove(candidateRow) - # rowNr = 0 - # nonDominated = True - # while len(inputPoints) != 0 and rowNr < len(inputPoints): - # row = inputPoints[rowNr] - # if dominates(candidateRow, row): - # # If it is worse on all features remove the row from the array - # inputPoints.remove(row) - # dominatedPoints.add(tuple(row)) - # elif dominates(row, candidateRow): - # nonDominated = False - # dominatedPoints.add(tuple(candidateRow)) - # rowNr += 1 - # else: - # rowNr += 1 - - # if nonDominated: - # # add the non-dominated point to the Pareto frontier - # paretoPoints.add(tuple(candidateRow)) - - # if len(inputPoints) == 0: - # break - # return paretoPoints, dominatedPoints - # def dominates(row, candidateRow): - # return sum([row[x] >= candidateRow[x] for x in range(len(row))]) == len(row) - # import random - # print(inputPoints) - # inputPoints = [[random.randint(70,100) for i in range(3)] for j in range(500)] - # print(inputPoints) - # quit() - # inputPoints = [(x,y,z) for x,y,z in zip(fits[comp[0]], fits[comp[1]], fits[comp[2]])] - # paretoPoints, dominatedPoints = simple_cull(inputPoints, dominates) - x = [coords[0]/1000 for coords in paretoPoints] - y = [coords[1] for coords in paretoPoints] - z = [coords[2] for coords in paretoPoints] - - # from surface_fitting import surface_fitting - # surface_fitting(x,y,z) - # quit() - - if False: - pass - else: - import pandas as pd - from pylab import cm - print(dir(cm)) - df = pd.DataFrame({'x': x, 'y': y, 'z': z}) - - # 只有plot_trisurf这一个函数,输入是三个以为序列的,其他都要meshgrid得到二维数组的(即ndim=2的数组) - # # https://jakevdp.github.io/PythonDataScienceHandbook/04.12-three-dimensional-plotting.html - # surf = ax.plot_trisurf(df.x, df.y, df.z, cmap=cm.magma, linewidth=0.1, edgecolor='none') - # surf = ax.plot_trisurf(x, y, z, cmap='viridis', edgecolor='none') - # surf = ax.plot_trisurf(df.x, df.y, df.z, cmap=cm.magma, linewidth=0.1) - surf = ax.plot_trisurf(df.x, df.y*100, df.z, cmap=cm.Spectral, linewidth=0.1) - - with open('./%s_PF_points.txt'%(fea_config_dict['run_folder'][:-1]), 'w') as f: - f.write('TRV,eta,OC\n') - f.writelines(['%g,%g,%g\n'%(a,b,c) for a,b,c in zip(df.x, df.y*100, df.z)]) - # quit() - - fig.colorbar(surf, shrink=0.5, aspect=5) - - ax.set_xlabel(' \n$\\rm -TRV$ [$\\rm kNm/m^3$]') - ax.set_ylabel(' \n$-\\eta$ [%]') - ax.set_yticks(np.arange(-96,-93.5,0.5)) - ax.set_zlabel(r'$O_C$ [1]') - - # Try to export data from plot_trisurf # https://github.com/WoLpH/numpy-stl/issues/19 - # print(surf.get_vector()) - - # plt.savefig('./plots/avgErrs_vs_C_andgamma_type_%s.png'%(k)) - # plt.show() - - # # rotate the axes and update - # for angle in range(0, 360): - # ax.view_init(30, angle) - # plt.draw() - # plt.pause(.001) - - ax.view_init(azim=245, elev=15) - # fig.tight_layout() - - # Y730 - # fig.savefig(r'C:\Users\horyc\Desktop/3D-plot.png', dpi=300, layout='tight') - - # ax.view_init(azim=az) - # ax.set_xlim(0, 1.) - # ax.set_ylim(0, 1.) - # ax.set_zlim(0, 10.) - return ax -def my_plot(fits, vectors, ndf): - plt.rcParams['mathtext.fontset'] = 'stix' # 'cm' - plt.rcParams["font.family"] = "Times New Roman" - if True: - # for fit in fits: - # print(fit) - # ax = pg.plot_non_dominated_fronts(fits) - - # ax = my_plot_non_dominated_fronts(fits, comp=[0,1], marker='o', up_to_rank_no=3) - # ax = my_plot_non_dominated_fronts(fits, comp=[0,2], marker='o', up_to_rank_no=3) - # ax = my_plot_non_dominated_fronts(fits, comp=[1,2], marker='o', up_to_rank_no=3) - - pass - - ax = my_2p5d_plot_non_dominated_fronts(fits, comp=[0,1], marker='o', up_to_rank_no=1) - # # for studying LSA population (whether or not the optimal is on Rank 1 Pareto Front) - # x = fits[0][0]/1e3 - # y = fits[0][1] - # z = fits[0][2] - # ax.plot(x, y, color='k', marker='s') - # ax.annotate(r'$x_{\rm optm}$', xy=(x, y), xytext=(x+1, y+0.0005), arrowprops=dict(facecolor='black', shrink=0.05),) - ax = my_2p5d_plot_non_dominated_fronts(fits, comp=[0,2], marker='o', up_to_rank_no=1) - ax = my_2p5d_plot_non_dominated_fronts(fits, comp=[1,2], marker='o', up_to_rank_no=1) - - else: - # Obselete. Use ax.step instead to plot - print('Valid for 2D objective function space only for now.') - fig, axes = plt.subplots(ncols=2, nrows=1, dpi=150, facecolor='w', edgecolor='k'); - ax = axes[0] - - for index, xy in enumerate(vectors): - ax.plot(*xy, 's', color='0') - ax.text(*xy, '#%d'%(index), color='0') - ax.title.set_text("Decision Vector Space") - - ax = axes[1] - - for index, front in enumerate(ndf): - print('Rank/Tier', index, front) - the_color = '%g'%(index/len(ndf)) - for individual in front: # individual is integer here - ax.plot(*fits[individual], 'o', color=the_color) - ax.text(*fits[individual], '#%d'%(individual), color=the_color) - - front = front.tolist() - front.sort(key = lambda individual: fits[individual][1]) # sort by y-axis value # individual is integer here - for individual_A, individual_B in zip(front[:-1], front[1:]): # front is already sorted - fits_A = fits[individual_A] - fits_B = fits[individual_B] - ax.plot([fits_A[0], fits_B[0]], - [fits_B[1], fits_B[1]], color=the_color, lw=0.25) # 取高的点的Y - ax.plot([fits_A[0], fits_A[0]], - [fits_A[1], fits_B[1]], color=the_color, lw=0.25) # 取低的点的X - ax.title.set_text("Pareto Front | Objective Function Space") -def my_print(ad, pop, _): - # ndf, dl, dc, ndr = pg.fast_non_dominated_sorting(fits) - # extract and print non-dominated fronts - # - ndf (list of 1D NumPy int array): the non dominated fronts - # - dl (list of 1D NumPy int array): the domination list - # - dc (1D NumPy int array): the domination count - # - ndr (1D NumPy int array): the non domination ranks - fits, vectors = pop.get_f(), pop.get_x() - ndf, dl, dc, ndr = pg.fast_non_dominated_sorting(fits) - - with open(ad.solver.output_dir+'MOO_log.txt', 'a', encoding='utf-8') as fname: - print('-'*40, 'Generation:', _, file=fname) - for rank_minus_1, front in enumerate(ndf): - print('Rank/Tier', rank_minus_1+1, front, file=fname) - index = 0 - for domination_list, domination_count, non_domination_rank in zip(dl, dc, ndr): - print('Individual #%d\t'%(index), 'Belong to Rank #%d\t'%(non_domination_rank), 'Dominating', domination_count, 'and they are', domination_list, file=fname) - index += 1 - - # print(fits, vectors, ndf) - print(pop, file=fname) - - -def learn_about_the_archive(prob, swarm_data, popsize, fea_config_dict, len_s01=None, len_s02=None, bool_plot_and_show=False): - number_of_chromosome = len(swarm_data) - print('Archive size:', number_of_chromosome) - # for el in swarm_data: - # print('\t', el) - - pop_archive = pg.population(prob, size=number_of_chromosome) - for i in range(number_of_chromosome): - pop_archive.set_xf(i, swarm_data[i][:-3], swarm_data[i][-3:]) - - sorted_index = pg.sort_population_mo(points=pop_archive.get_f()) - print('Sorted by domination rank and crowding distance:', len(sorted_index)) - print('\t', sorted_index) - - # 这段代码对于重建种群来说不是必须的,单单sort_population_mo(包含fast_non_dominated_sorting和crowding_distance)就够了, - # 只是我想看看,具体的crowding_distance是多少,然后我想知道排在前面的多少个是属于domination rank 1的。 - if True: - fits, vectors = pop_archive.get_f(), pop_archive.get_x() - ndf, dl, dc, ndr = pg.fast_non_dominated_sorting(fits) - - ind1, ind2 = 0, 0 - for rank_minus_1, front in enumerate(ndf): - - ind2 += len(front) - sorted_index_at_this_front = sorted_index[ind1:ind2] - fits_at_this_front = [fits[point] for point in sorted_index_at_this_front] - - # Rank 1 Pareto Front - if ind1 == 0: - rank1_ParetoPoints = fits_at_this_front - if len(front) < popsize: - print('There are not enough chromosomes (%d) belonging to domination rank 1 (the best Pareto front).\nWill use rank 2 or lower to reach popsize of %d.'%(len(front), popsize)) - - # this crwdsit should be already sorted as well - if len(fits_at_this_front) >= 2: # or else error: A non dominated front must contain at least two points: 1 detected. - crwdst = pg.crowding_distance(fits_at_this_front) - else: - print('A non dominated front must contain at least two points: 1 detected.') - crwdst = [999999] - - - print('\nRank/Tier', rank_minus_1+1, 'chromosome count:', len(front), len(sorted_index_at_this_front)) - # print('\t', sorted_index_at_this_front.tolist()) - # print('\t', crwdst) - print('\tindex in pop\t|\tcrowding distance') - for index, cd in zip(sorted_index_at_this_front, crwdst): - print('\t', index, '\t\t\t|', cd) - ind1 = ind2 - - sorted_vectors = [vectors[index].tolist() for index in sorted_index] - sorted_fits = [fits[index].tolist() for index in sorted_index] - - if bool_plot_and_show: - my_plot(pop_archive.get_f(), pop_archive.get_x(), ndf) - my_3d_plot_non_dominated_fronts(pop_archive, rank1_ParetoPoints, fea_config_dict, plot_option=1) - plt.show() - - swarm_data_on_pareto_front = [design_parameters_denorm + fits for design_parameters_denorm, fits in zip(sorted_vectors, sorted_fits)] - return swarm_data_on_pareto_front - -def pyx_draw_model(im): - import matplotlib.patches as mpatches - import matplotlib.pyplot as plt - plt.rcParams["font.family"] = "Times New Roman" - - myfontsize = 13.5 - plt.rcParams.update({'font.size': myfontsize}) - - # # 示意图而已,改改尺寸吧 - # im.Radius_OuterStatorYoke -= 37 - # im.Radius_InnerStatorYoke -= 20 - # im.Radius_Shaft += 20 - # # im.Location_RotorBarCenter2 += 5 # this will change the shape of rotor slot - - import VanGogh - vg = VanGogh.VanGogh_pyPlotter(im, VanGogh.CUSTOM) - vg.draw_model() - - # PyX - import pyx - vg.tikz.c = pyx.canvas.canvas() # clear the canvas because we want to redraw 90 deg with the data vg.tikz.track_path - from copy import deepcopy - def pyx_draw_path(vg, path, sign=1): - if len(path) == 4: - vg.tikz.draw_line(path[:2], path[2:4], untrack=True) - else: - vg.tikz.draw_arc(path[:2], path[2:4], path[4:6], relangle=sign*path[6], untrack=True) - def rotate(_, x, y): - return np.cos(_)*x + np.sin(_)*y, -np.sin(_)*x + np.cos(_)*y - def is_at_stator(im, path): - return np.sqrt(path[0]**2 + path[1]**2) > im.Radius_OuterRotor + 0.5*im.Length_AirGap - - for path in (vg.tikz.track_path): # track_path is passed by reference and is changed by mirror - path_mirror = deepcopy(path) - # for mirror copy (along x-axis) - path_mirror[1] = path[1]*-1 - path_mirror[3] = path[3]*-1 - - # rotate path and plot - if is_at_stator(im, path): - Q = im.Qs - else: - Q = im.Qr - _ = 2*np.pi/Q - path[0], path[1] = rotate(0.5*np.pi - 0.5*_, path[0], path[1]) - path[2], path[3] = rotate(0.5*np.pi - 0.5*_, path[2], path[3]) - pyx_draw_path(vg, path, sign=1) - - path_mirror[0], path_mirror[1] = rotate(0.5*np.pi - 0.5*_, path_mirror[0], path_mirror[1]) - path_mirror[2], path_mirror[3] = rotate(0.5*np.pi - 0.5*_, path_mirror[2], path_mirror[3]) - pyx_draw_path(vg, path_mirror, sign=-1) - - # 注意,所有 tack_path 中的 path 都已经转动了90度了! - # for mirror copy (along y-axis) - path[0] *= -1 - path[2] *= -1 - pyx_draw_path(vg, path, sign=-1) - - path_mirror[0] *= -1 - path_mirror[2] *= -1 - pyx_draw_path(vg, path_mirror, sign=1) - - - # # 整体转动90度。 - # for path in vg.tikz.track_path: - # if is_at_stator(im, path): - # Q = im.Qs - # else: - # Q = im.Qr - # _ = 2*np.pi/Q - # path[0], path[1] = rotate(0.5*np.pi - _, path[0], path[1]) - # path[2], path[3] = rotate(0.5*np.pi - _, path[2], path[3]) - # pyx_draw_path(vg, path) - # track_path_backup = deepcopy(vg.tikz.track_path) - - # # Rotate Copy - # for path in deepcopy(vg.tikz.track_path): - # if is_at_stator(im, path): - # Q = im.Qs - # else: - # Q = im.Qr - # _ = 2*np.pi/Q - # path[0], path[1] = rotate(_, path[0], path[1]) - # path[2], path[3] = rotate(_, path[2], path[3]) - # pyx_draw_path(vg, path) - - # # Rotate Copy - # for path in (vg.tikz.track_path): - # # if np.sqrt(path[0]**2 + path[1]**2) > im.Radius_OuterRotor + 0.5*im.Length_AirGap: - # if is_at_stator(im, path): - # Q = im.Qs - # else: - # Q = im.Qr - # _ = 2*np.pi/Q - # path[0], path[1] = rotate(_, path[0], path[1]) - # path[2], path[3] = rotate(_, path[2], path[3]) - # pyx_draw_path(vg, path, sign=-1) - - vg.tikz.c.writePDFfile("selected_otimal_design%s"%(im.ID)) - # vg.tikz.c.writeEPSfile("pyx_output") - print('Write to pdf file: selected_otimal_design%s.pdf.'%(im.ID)) - quit() - +import pygmo as pg +from pylab import plt, np +def my_plot_non_dominated_fronts(points, marker='o', comp=[0, 1], up_to_rank_no=None): + # We plot + fronts, _, _, _ = pg.fast_non_dominated_sorting(points) + + # We define the colors of the fronts (grayscale from black to white) + if up_to_rank_no is None: + cl = list(zip(np.linspace(0.1, 0.9, len(fronts)), + np.linspace(0.1, 0.9, len(fronts)), + np.linspace(0.1, 0.9, len(fronts)))) + else: + cl = list(zip(np.linspace(0.1, 0.9, up_to_rank_no), + np.linspace(0.1, 0.9, up_to_rank_no), + np.linspace(0.1, 0.9, up_to_rank_no))) + + fig, ax = plt.subplots() + + count = 0 + for ndr, front in enumerate(fronts): + count += 1 + # We plot the points + for idx in front: + ax.plot(points[idx][comp[0]], points[idx][ + comp[1]], marker=marker, color=cl[ndr]) + # We plot the fronts + # Frist compute the points coordinates + x = [points[idx][comp[0]] for idx in front] + y = [points[idx][comp[1]] for idx in front] + # Then sort them by the first objective + tmp = [(a, b) for a, b in zip(x, y)] + tmp = sorted(tmp, key=lambda k: k[0]) + # Now plot using step + ax.step([c[0] for c in tmp], [c[1] + for c in tmp], color=cl[ndr], where='post') + if up_to_rank_no is None: + pass + else: + if count >= up_to_rank_no: + break + + return ax +def my_2p5d_plot_non_dominated_fronts(points, marker='o', comp=[0, 1], up_to_rank_no=1, no_text=True): + # from pylab import mpl + # mpl.rcParams['font.family'] = ['Times New Roman'] + # mpl.rcParams['font.size'] = 16.0 + + full_comp = [0, 1, 2] + full_comp.remove(comp[0]) + full_comp.remove(comp[1]) + z_comp = full_comp[0] + + # We plot + # fronts, dl, dc, ndr = pg.fast_non_dominated_sorting(points) + fronts, _, _, _= pg.fast_non_dominated_sorting(points) + + # We define the colors of the fronts (grayscale from black to white) + cl = list(zip(np.linspace(0.9, 0.1, len(fronts)), + np.linspace(0.9, 0.1, len(fronts)), + np.linspace(0.9, 0.1, len(fronts)))) + + fig, ax = plt.subplots(constrained_layout=False) + plt.subplots_adjust(left=None, bottom=None, right=0.85, top=None, wspace=None, hspace=None) + + count = 0 + for ndr, front in enumerate(fronts): + count += 1 + + # Frist compute the points coordinates + x_scale = 1 + y_scale = 1 + z_scale = 1 + if comp[0] == 1: # efficency + x_scale = 100 + if comp[1] == 1: # efficency + y_scale = 100 + if z_comp == 1: # efficency + z_scale = 100 + x = [points[idx][comp[0]]*x_scale for idx in front] + y = [points[idx][comp[1]]*y_scale for idx in front] + z = [points[idx][z_comp] *z_scale for idx in front] + + # # We plot the points + # for idx in front: + # ax.plot(points[idx][comp[0]], points[idx][comp[1]], marker=marker, color=cl[ndr]) + + # Then sort them by the first objective + tmp = [(a, b, c) for a, b, c in zip(x, y, z)] + tmp = sorted(tmp, key=lambda k: k[0]) + # Now plot using step + ax.step([coords[0] for coords in tmp], + [coords[1] for coords in tmp], color=cl[ndr], where='post') + + # Now add color according to the value of the z-axis variable usign scatter + scatter_handle = ax.scatter(x, y, c=z, alpha=0.5, cmap='Spectral', marker=marker, zorder=99) #'viridis' + # color bar + cbar_ax = fig.add_axes([0.875, 0.15, 0.02, 0.7]) + cbar_ax.get_yaxis().labelpad = 10 + clb = fig.colorbar(scatter_handle, cax=cbar_ax) + if z_comp == 0: + z_label = r'$-\rm {TRV}$ [Nm/m^3]' + z_text = '%.0f' + elif z_comp == 1: + z_label = r'$-\eta$ [%]' + z_text = '%.1f' + elif z_comp == 2: + z_label = r'$O_C$ [1]' + z_text = '%.1f' + clb.ax.set_ylabel(z_label, rotation=270) + + + if z_comp == 2: # when OC as z-axis + print('-----------------------------------------------------') + print('-----------------------------------------------------') + print('-----------------------------------------------------') + # Add index next to the points + for x_coord, y_coord, z_coord, idx in zip(x, y, z, front): + if no_text: + pass + else: + ax.annotate( z_text%(z_coord) + ' #%d'%(idx), (x_coord, y_coord) ) + else: + # text next scatter showing the value of the 3rd objective + for i, val in enumerate(z): + if no_text: + pass + else: + ax.annotate( z_text%(val), (x[i], y[i]) ) + + # refine the plotting + if comp[0] == 0: + ax.set_xlabel(r'$-\rm {TRV}$ [Nm/m^3]') + elif comp[0] == 1: + ax.set_xlabel(r'$-\eta$ [%]') + elif comp[0] == 2: + ax.set_xlabel(r'$O_C$ [1]') + + if comp[1] == 0: + ax.set_ylabel(r'$-\rm {TRV}$ [Nm/m^3]') + elif comp[1] == 1: + ax.set_ylabel(r'$-\eta$ [%]') + elif comp[1] == 2: + ax.set_ylabel(r'$O_C$ [1]') + ax.grid() + + # plot up to which domination rank? + if up_to_rank_no is None: + pass + else: + if count >= up_to_rank_no: + break + # Y730 + # fig.savefig(r'C:\Users\horyc\Desktop/'+ '2p5D-%d%d.png'%(comp[0],comp[1]), dpi=300) + return ax +def my_3d_plot_non_dominated_fronts(pop, paretoPoints, fea_config_dict, az=180, comp=[0, 1, 2], plot_option=1): + """ + Plots solutions to the DTLZ problems in three dimensions. The Pareto Front is also + visualized if the problem id is 2,3 or 4. + Args: + pop (:class:`~pygmo.population`): population of solutions to a dtlz problem + az (``float``): angle of view on which the 3d-plot is created + comp (``list``): indexes the fitness dimension for x,y and z axis in that order + Returns: + ``matplotlib.axes.Axes``: the current ``matplotlib.axes.Axes`` instance on the current figure + Raises: + ValueError: if *pop* does not contain a DTLZ problem (veryfied by its name only) or if *comp* is not of length 3 + Examples: + >>> import pygmo as pg + >>> udp = pg.dtlz(prob_id = 1, fdim =3, dim = 5) + >>> pop = pg.population(udp, 40) + >>> udp.plot(pop) # doctest: +SKIP + """ + from mpl_toolkits.mplot3d import axes3d + import matplotlib.pyplot as plt + import numpy as np + # from pylab import mpl + # mpl.rcParams['font.family'] = ['Times New Roman'] + # mpl.rcParams['font.size'] = 16.0 + + # if (pop.problem.get_name()[:-1] != "DTLZ"): + # raise(ValueError, "The problem seems not to be from the DTLZ suite") + + if (len(comp) != 3): + raise(ValueError, "The kwarg *comp* needs to contain exactly 3 elements (ids for the x,y and z axis)") + + # Create a new figure + fig = plt.figure(figsize=(12,8)) + ax = fig.add_subplot(111, projection='3d') + + # plot the points + fits = np.transpose(pop.get_f()) + try: + pass + # ax.plot(fits[comp[0]], fits[comp[1]], fits[comp[2]], 'ro') + except IndexError: + print('Error. Please choose correct fitness dimensions for printing!') + + if False: + # Plot pareto front for dtlz 1 + if plot_option==1: # (pop.problem.get_name()[-1] in ["1"]): + + X, Y = np.meshgrid(np.linspace(0, 0.5, 100), np.linspace(0, 0.5, 100)) + Z = - X - Y + 0.5 + # remove points not in the simplex + for i in range(100): + for j in range(100): + if X[i, j] < 0 or Y[i, j] < 0 or Z[i, j] < 0: + Z[i, j] = float('nan') + + ax.set_xlim(0, 1.) + ax.set_ylim(0, 1.) + ax.set_zlim(0, 1.) + + ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10) + plt.plot([0, 0.5], [0.5, 0], [0, 0]) + + # Plot pareto fronts for dtlz 2,3,4 + if plot_option == 2: # (pop.problem.get_name()[-1] in ["2", "3", "4"]): + # plot the wireframe of the known optimal pareto front + thetas = np.linspace(0, (np.pi / 2.0), 30) + # gammas = np.linspace(-np.pi / 4, np.pi / 4, 30) + gammas = np.linspace(0, (np.pi / 2.0), 30) + + x_frame = np.outer(np.cos(thetas), np.cos(gammas)) + y_frame = np.outer(np.cos(thetas), np.sin(gammas)) + z_frame = np.outer(np.sin(thetas), np.ones(np.size(gammas))) + + ax.set_autoscalex_on(False) + ax.set_autoscaley_on(False) + ax.set_autoscalez_on(False) + + ax.set_xlim(0, 1.8) + ax.set_ylim(0, 1.8) + ax.set_zlim(0, 1.8) + + ax.plot_wireframe(x_frame, y_frame, z_frame) + + # https://stackoverflow.com/questions/37000488/how-to-plot-multi-objectives-pareto-frontier-with-deap-in-python + # def simple_cull(inputPoints, dominates): + # paretoPoints = set() + # candidateRowNr = 0 + # dominatedPoints = set() + # while True: + # candidateRow = inputPoints[candidateRowNr] + # inputPoints.remove(candidateRow) + # rowNr = 0 + # nonDominated = True + # while len(inputPoints) != 0 and rowNr < len(inputPoints): + # row = inputPoints[rowNr] + # if dominates(candidateRow, row): + # # If it is worse on all features remove the row from the array + # inputPoints.remove(row) + # dominatedPoints.add(tuple(row)) + # elif dominates(row, candidateRow): + # nonDominated = False + # dominatedPoints.add(tuple(candidateRow)) + # rowNr += 1 + # else: + # rowNr += 1 + + # if nonDominated: + # # add the non-dominated point to the Pareto frontier + # paretoPoints.add(tuple(candidateRow)) + + # if len(inputPoints) == 0: + # break + # return paretoPoints, dominatedPoints + # def dominates(row, candidateRow): + # return sum([row[x] >= candidateRow[x] for x in range(len(row))]) == len(row) + # import random + # print(inputPoints) + # inputPoints = [[random.randint(70,100) for i in range(3)] for j in range(500)] + # print(inputPoints) + # quit() + # inputPoints = [(x,y,z) for x,y,z in zip(fits[comp[0]], fits[comp[1]], fits[comp[2]])] + # paretoPoints, dominatedPoints = simple_cull(inputPoints, dominates) + x = [coords[0]/1000 for coords in paretoPoints] + y = [coords[1] for coords in paretoPoints] + z = [coords[2] for coords in paretoPoints] + + # from surface_fitting import surface_fitting + # surface_fitting(x,y,z) + # quit() + + if False: + pass + else: + import pandas as pd + from pylab import cm + print(dir(cm)) + df = pd.DataFrame({'x': x, 'y': y, 'z': z}) + + # 只有plot_trisurf这一个函数,输入是三个以为序列的,其他都要meshgrid得到二维数组的(即ndim=2的数组) + # # https://jakevdp.github.io/PythonDataScienceHandbook/04.12-three-dimensional-plotting.html + # surf = ax.plot_trisurf(df.x, df.y, df.z, cmap=cm.magma, linewidth=0.1, edgecolor='none') + # surf = ax.plot_trisurf(x, y, z, cmap='viridis', edgecolor='none') + # surf = ax.plot_trisurf(df.x, df.y, df.z, cmap=cm.magma, linewidth=0.1) + surf = ax.plot_trisurf(df.x, df.y*100, df.z, cmap=cm.Spectral, linewidth=0.1) + + with open('./%s_PF_points.txt'%(fea_config_dict['run_folder'][:-1]), 'w') as f: + f.write('TRV,eta,OC\n') + f.writelines(['%g,%g,%g\n'%(a,b,c) for a,b,c in zip(df.x, df.y*100, df.z)]) + # quit() + + fig.colorbar(surf, shrink=0.5, aspect=5) + + ax.set_xlabel(' \n$\\rm -TRV$ [$\\rm kNm/m^3$]') + ax.set_ylabel(' \n$-\\eta$ [%]') + ax.set_yticks(np.arange(-96,-93.5,0.5)) + ax.set_zlabel(r'$O_C$ [1]') + + # Try to export data from plot_trisurf # https://github.com/WoLpH/numpy-stl/issues/19 + # print(surf.get_vector()) + + # plt.savefig('./plots/avgErrs_vs_C_andgamma_type_%s.png'%(k)) + # plt.show() + + # # rotate the axes and update + # for angle in range(0, 360): + # ax.view_init(30, angle) + # plt.draw() + # plt.pause(.001) + + ax.view_init(azim=245, elev=15) + # fig.tight_layout() + + # Y730 + # fig.savefig(r'C:\Users\horyc\Desktop/3D-plot.png', dpi=300, layout='tight') + + # ax.view_init(azim=az) + # ax.set_xlim(0, 1.) + # ax.set_ylim(0, 1.) + # ax.set_zlim(0, 10.) + return ax +def my_plot(fits, vectors, ndf): + plt.rcParams['mathtext.fontset'] = 'stix' # 'cm' + plt.rcParams["font.family"] = "Times New Roman" + if True: + # for fit in fits: + # print(fit) + # ax = pg.plot_non_dominated_fronts(fits) + + # ax = my_plot_non_dominated_fronts(fits, comp=[0,1], marker='o', up_to_rank_no=3) + # ax = my_plot_non_dominated_fronts(fits, comp=[0,2], marker='o', up_to_rank_no=3) + # ax = my_plot_non_dominated_fronts(fits, comp=[1,2], marker='o', up_to_rank_no=3) + + pass + + ax = my_2p5d_plot_non_dominated_fronts(fits, comp=[0,1], marker='o', up_to_rank_no=1) + # # for studying LSA population (whether or not the optimal is on Rank 1 Pareto Front) + # x = fits[0][0]/1e3 + # y = fits[0][1] + # z = fits[0][2] + # ax.plot(x, y, color='k', marker='s') + # ax.annotate(r'$x_{\rm optm}$', xy=(x, y), xytext=(x+1, y+0.0005), arrowprops=dict(facecolor='black', shrink=0.05),) + ax = my_2p5d_plot_non_dominated_fronts(fits, comp=[0,2], marker='o', up_to_rank_no=1) + ax = my_2p5d_plot_non_dominated_fronts(fits, comp=[1,2], marker='o', up_to_rank_no=1) + + else: + # Obselete. Use ax.step instead to plot + print('Valid for 2D objective function space only for now.') + fig, axes = plt.subplots(ncols=2, nrows=1, dpi=150, facecolor='w', edgecolor='k'); + ax = axes[0] + + for index, xy in enumerate(vectors): + ax.plot(*xy, 's', color='0') + ax.text(*xy, '#%d'%(index), color='0') + ax.title.set_text("Decision Vector Space") + + ax = axes[1] + + for index, front in enumerate(ndf): + print('Rank/Tier', index, front) + the_color = '%g'%(index/len(ndf)) + for individual in front: # individual is integer here + ax.plot(*fits[individual], 'o', color=the_color) + ax.text(*fits[individual], '#%d'%(individual), color=the_color) + + front = front.tolist() + front.sort(key = lambda individual: fits[individual][1]) # sort by y-axis value # individual is integer here + for individual_A, individual_B in zip(front[:-1], front[1:]): # front is already sorted + fits_A = fits[individual_A] + fits_B = fits[individual_B] + ax.plot([fits_A[0], fits_B[0]], + [fits_B[1], fits_B[1]], color=the_color, lw=0.25) # 取高的点的Y + ax.plot([fits_A[0], fits_A[0]], + [fits_A[1], fits_B[1]], color=the_color, lw=0.25) # 取低的点的X + ax.title.set_text("Pareto Front | Objective Function Space") +def my_print(ad, pop, _): + # ndf, dl, dc, ndr = pg.fast_non_dominated_sorting(fits) + # extract and print non-dominated fronts + # - ndf (list of 1D NumPy int array): the non dominated fronts + # - dl (list of 1D NumPy int array): the domination list + # - dc (1D NumPy int array): the domination count + # - ndr (1D NumPy int array): the non domination ranks + fits, vectors = pop.get_f(), pop.get_x() + ndf, dl, dc, ndr = pg.fast_non_dominated_sorting(fits) + + with open(ad.solver.output_dir+'MOO_log.txt', 'a', encoding='utf-8') as fname: + print('-'*40, 'Generation:', _, file=fname) + for rank_minus_1, front in enumerate(ndf): + print('Rank/Tier', rank_minus_1+1, front, file=fname) + index = 0 + for domination_list, domination_count, non_domination_rank in zip(dl, dc, ndr): + print('Individual #%d\t'%(index), 'Belong to Rank #%d\t'%(non_domination_rank), 'Dominating', domination_count, 'and they are', domination_list, file=fname) + index += 1 + + # print(fits, vectors, ndf) + print(pop, file=fname) + + +def learn_about_the_archive(prob, swarm_data, popsize, fea_config_dict, len_s01=None, len_s02=None, bool_plot_and_show=False): + number_of_chromosome = len(swarm_data) + print('Archive size:', number_of_chromosome) + # for el in swarm_data: + # print('\t', el) + + pop_archive = pg.population(prob, size=number_of_chromosome) + for i in range(number_of_chromosome): + pop_archive.set_xf(i, swarm_data[i][:-3], swarm_data[i][-3:]) + + sorted_index = pg.sort_population_mo(points=pop_archive.get_f()) + print('Sorted by domination rank and crowding distance:', len(sorted_index)) + print('\t', sorted_index) + + # 这段代码对于重建种群来说不是必须的,单单sort_population_mo(包含fast_non_dominated_sorting和crowding_distance)就够了, + # 只是我想看看,具体的crowding_distance是多少,然后我想知道排在前面的多少个是属于domination rank 1的。 + if True: + fits, vectors = pop_archive.get_f(), pop_archive.get_x() + ndf, dl, dc, ndr = pg.fast_non_dominated_sorting(fits) + + ind1, ind2 = 0, 0 + for rank_minus_1, front in enumerate(ndf): + + ind2 += len(front) + sorted_index_at_this_front = sorted_index[ind1:ind2] + fits_at_this_front = [fits[point] for point in sorted_index_at_this_front] + + # Rank 1 Pareto Front + if ind1 == 0: + rank1_ParetoPoints = fits_at_this_front + if len(front) < popsize: + print('There are not enough chromosomes (%d) belonging to domination rank 1 (the best Pareto front).\nWill use rank 2 or lower to reach popsize of %d.'%(len(front), popsize)) + + # this crwdsit should be already sorted as well + if len(fits_at_this_front) >= 2: # or else error: A non dominated front must contain at least two points: 1 detected. + crwdst = pg.crowding_distance(fits_at_this_front) + else: + print('A non dominated front must contain at least two points: 1 detected.') + crwdst = [999999] + + + print('\nRank/Tier', rank_minus_1+1, 'chromosome count:', len(front), len(sorted_index_at_this_front)) + # print('\t', sorted_index_at_this_front.tolist()) + # print('\t', crwdst) + print('\tindex in pop\t|\tcrowding distance') + for index, cd in zip(sorted_index_at_this_front, crwdst): + print('\t', index, '\t\t\t|', cd) + ind1 = ind2 + + sorted_vectors = [vectors[index].tolist() for index in sorted_index] + sorted_fits = [fits[index].tolist() for index in sorted_index] + + if bool_plot_and_show: + my_plot(pop_archive.get_f(), pop_archive.get_x(), ndf) + my_3d_plot_non_dominated_fronts(pop_archive, rank1_ParetoPoints, fea_config_dict, plot_option=1) + plt.show() + + swarm_data_on_pareto_front = [design_parameters_denorm + fits for design_parameters_denorm, fits in zip(sorted_vectors, sorted_fits)] + return swarm_data_on_pareto_front + +def pyx_draw_model(im): + import matplotlib.patches as mpatches + import matplotlib.pyplot as plt + plt.rcParams["font.family"] = "Times New Roman" + + myfontsize = 13.5 + plt.rcParams.update({'font.size': myfontsize}) + + # # 示意图而已,改改尺寸吧 + # im.Radius_OuterStatorYoke -= 37 + # im.Radius_InnerStatorYoke -= 20 + # im.Radius_Shaft += 20 + # # im.Location_RotorBarCenter2 += 5 # this will change the shape of rotor slot + + import VanGogh + vg = VanGogh.VanGogh_pyPlotter(im, VanGogh.CUSTOM) + vg.draw_model() + + # PyX + import pyx + vg.tikz.c = pyx.canvas.canvas() # clear the canvas because we want to redraw 90 deg with the data vg.tikz.track_path + from copy import deepcopy + def pyx_draw_path(vg, path, sign=1): + if len(path) == 4: + vg.tikz.draw_line(path[:2], path[2:4], untrack=True) + else: + vg.tikz.draw_arc(path[:2], path[2:4], path[4:6], relangle=sign*path[6], untrack=True) + def rotate(_, x, y): + return np.cos(_)*x + np.sin(_)*y, -np.sin(_)*x + np.cos(_)*y + def is_at_stator(im, path): + return np.sqrt(path[0]**2 + path[1]**2) > im.Radius_OuterRotor + 0.5*im.Length_AirGap + + for path in (vg.tikz.track_path): # track_path is passed by reference and is changed by mirror + path_mirror = deepcopy(path) + # for mirror copy (along x-axis) + path_mirror[1] = path[1]*-1 + path_mirror[3] = path[3]*-1 + + # rotate path and plot + if is_at_stator(im, path): + Q = im.Qs + else: + Q = im.Qr + _ = 2*np.pi/Q + path[0], path[1] = rotate(0.5*np.pi - 0.5*_, path[0], path[1]) + path[2], path[3] = rotate(0.5*np.pi - 0.5*_, path[2], path[3]) + pyx_draw_path(vg, path, sign=1) + + path_mirror[0], path_mirror[1] = rotate(0.5*np.pi - 0.5*_, path_mirror[0], path_mirror[1]) + path_mirror[2], path_mirror[3] = rotate(0.5*np.pi - 0.5*_, path_mirror[2], path_mirror[3]) + pyx_draw_path(vg, path_mirror, sign=-1) + + # 注意,所有 tack_path 中的 path 都已经转动了90度了! + # for mirror copy (along y-axis) + path[0] *= -1 + path[2] *= -1 + pyx_draw_path(vg, path, sign=-1) + + path_mirror[0] *= -1 + path_mirror[2] *= -1 + pyx_draw_path(vg, path_mirror, sign=1) + + + # # 整体转动90度。 + # for path in vg.tikz.track_path: + # if is_at_stator(im, path): + # Q = im.Qs + # else: + # Q = im.Qr + # _ = 2*np.pi/Q + # path[0], path[1] = rotate(0.5*np.pi - _, path[0], path[1]) + # path[2], path[3] = rotate(0.5*np.pi - _, path[2], path[3]) + # pyx_draw_path(vg, path) + # track_path_backup = deepcopy(vg.tikz.track_path) + + # # Rotate Copy + # for path in deepcopy(vg.tikz.track_path): + # if is_at_stator(im, path): + # Q = im.Qs + # else: + # Q = im.Qr + # _ = 2*np.pi/Q + # path[0], path[1] = rotate(_, path[0], path[1]) + # path[2], path[3] = rotate(_, path[2], path[3]) + # pyx_draw_path(vg, path) + + # # Rotate Copy + # for path in (vg.tikz.track_path): + # # if np.sqrt(path[0]**2 + path[1]**2) > im.Radius_OuterRotor + 0.5*im.Length_AirGap: + # if is_at_stator(im, path): + # Q = im.Qs + # else: + # Q = im.Qr + # _ = 2*np.pi/Q + # path[0], path[1] = rotate(_, path[0], path[1]) + # path[2], path[3] = rotate(_, path[2], path[3]) + # pyx_draw_path(vg, path, sign=-1) + + vg.tikz.c.writePDFfile("selected_otimal_design%s"%(im.ID)) + # vg.tikz.c.writeEPSfile("pyx_output") + print('Write to pdf file: selected_otimal_design%s.pdf.'%(im.ID)) + quit() + diff --git a/build/CMakeFiles/CMakeDirectoryInformation.cmake b/build/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..01691e3 --- /dev/null +++ b/build/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.22 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/gtq/ACMSIMC_TUT") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/gtq/ACMSIMC_TUT/build") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/build/CMakeFiles/Makefile.cmake b/build/CMakeFiles/Makefile.cmake new file mode 100644 index 0000000..cb50837 --- /dev/null +++ b/build/CMakeFiles/Makefile.cmake @@ -0,0 +1,47 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.22 + +# The generator used is: +set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") + +# The top level Makefile was generated from the following files: +set(CMAKE_MAKEFILE_DEPENDS + "CMakeCache.txt" + "../CMakeLists.txt" + "CMakeFiles/3.22.1/CMakeCCompiler.cmake" + "CMakeFiles/3.22.1/CMakeCXXCompiler.cmake" + "CMakeFiles/3.22.1/CMakeSystem.cmake" + "/usr/share/cmake-3.22/Modules/CMakeCInformation.cmake" + "/usr/share/cmake-3.22/Modules/CMakeCXXInformation.cmake" + "/usr/share/cmake-3.22/Modules/CMakeCommonLanguageInclude.cmake" + "/usr/share/cmake-3.22/Modules/CMakeGenericSystem.cmake" + "/usr/share/cmake-3.22/Modules/CMakeInitializeConfigs.cmake" + "/usr/share/cmake-3.22/Modules/CMakeLanguageInformation.cmake" + "/usr/share/cmake-3.22/Modules/CMakeSystemSpecificInformation.cmake" + "/usr/share/cmake-3.22/Modules/CMakeSystemSpecificInitialize.cmake" + "/usr/share/cmake-3.22/Modules/Compiler/CMakeCommonCompilerMacros.cmake" + "/usr/share/cmake-3.22/Modules/Compiler/GNU-C.cmake" + "/usr/share/cmake-3.22/Modules/Compiler/GNU-CXX.cmake" + "/usr/share/cmake-3.22/Modules/Compiler/GNU.cmake" + "/usr/share/cmake-3.22/Modules/Platform/Linux-GNU-C.cmake" + "/usr/share/cmake-3.22/Modules/Platform/Linux-GNU-CXX.cmake" + "/usr/share/cmake-3.22/Modules/Platform/Linux-GNU.cmake" + "/usr/share/cmake-3.22/Modules/Platform/Linux.cmake" + "/usr/share/cmake-3.22/Modules/Platform/UnixPaths.cmake" + ) + +# The corresponding makefile is: +set(CMAKE_MAKEFILE_OUTPUTS + "Makefile" + "CMakeFiles/cmake.check_cache" + ) + +# Byproducts of CMake generate step: +set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/CMakeDirectoryInformation.cmake" + ) + +# Dependency information for all targets: +set(CMAKE_DEPEND_INFO_FILES + "CMakeFiles/main.dir/DependInfo.cmake" + ) diff --git a/build/CMakeFiles/Makefile2 b/build/CMakeFiles/Makefile2 new file mode 100644 index 0000000..14da2ea --- /dev/null +++ b/build/CMakeFiles/Makefile2 @@ -0,0 +1,112 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.22 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Disable VCS-based implicit rules. +% : %,v + +# Disable VCS-based implicit rules. +% : RCS/% + +# Disable VCS-based implicit rules. +% : RCS/%,v + +# Disable VCS-based implicit rules. +% : SCCS/s.% + +# Disable VCS-based implicit rules. +% : s.% + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/gtq/ACMSIMC_TUT + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/gtq/ACMSIMC_TUT/build + +#============================================================================= +# Directory level rules for the build root directory + +# The main recursive "all" target. +all: CMakeFiles/main.dir/all +.PHONY : all + +# The main recursive "preinstall" target. +preinstall: +.PHONY : preinstall + +# The main recursive "clean" target. +clean: CMakeFiles/main.dir/clean +.PHONY : clean + +#============================================================================= +# Target rules for target CMakeFiles/main.dir + +# All Build rule for target. +CMakeFiles/main.dir/all: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/depend + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/gtq/ACMSIMC_TUT/build/CMakeFiles --progress-num=1,2,3,4,5,6 "Built target main" +.PHONY : CMakeFiles/main.dir/all + +# Build rule for subdir invocation for target. +CMakeFiles/main.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/gtq/ACMSIMC_TUT/build/CMakeFiles 6 + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/main.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /home/gtq/ACMSIMC_TUT/build/CMakeFiles 0 +.PHONY : CMakeFiles/main.dir/rule + +# Convenience name for target. +main: CMakeFiles/main.dir/rule +.PHONY : main + +# clean rule for target. +CMakeFiles/main.dir/clean: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/clean +.PHONY : CMakeFiles/main.dir/clean + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/build/CMakeFiles/cmake.check_cache b/build/CMakeFiles/cmake.check_cache new file mode 100644 index 0000000..3dccd73 --- /dev/null +++ b/build/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/build/CMakeFiles/main.dir/DependInfo.cmake b/build/CMakeFiles/main.dir/DependInfo.cmake new file mode 100644 index 0000000..ffad647 --- /dev/null +++ b/build/CMakeFiles/main.dir/DependInfo.cmake @@ -0,0 +1,23 @@ + +# Consider dependencies only in project. +set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF) + +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + ) + +# The set of dependency files which are needed: +set(CMAKE_DEPENDS_DEPENDENCY_FILES + "/home/gtq/ACMSIMC_TUT/commissioning.c" "CMakeFiles/main.dir/commissioning.c.o" "gcc" "CMakeFiles/main.dir/commissioning.c.o.d" + "/home/gtq/ACMSIMC_TUT/controller.c" "CMakeFiles/main.dir/controller.c.o" "gcc" "CMakeFiles/main.dir/controller.c.o.d" + "/home/gtq/ACMSIMC_TUT/inverter.c" "CMakeFiles/main.dir/inverter.c.o" "gcc" "CMakeFiles/main.dir/inverter.c.o.d" + "/home/gtq/ACMSIMC_TUT/main.c" "CMakeFiles/main.dir/main.c.o" "gcc" "CMakeFiles/main.dir/main.c.o.d" + "/home/gtq/ACMSIMC_TUT/observer.c" "CMakeFiles/main.dir/observer.c.o" "gcc" "CMakeFiles/main.dir/observer.c.o.d" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/build/CMakeFiles/main.dir/build.make b/build/CMakeFiles/main.dir/build.make new file mode 100644 index 0000000..868d986 --- /dev/null +++ b/build/CMakeFiles/main.dir/build.make @@ -0,0 +1,174 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.22 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Disable VCS-based implicit rules. +% : %,v + +# Disable VCS-based implicit rules. +% : RCS/% + +# Disable VCS-based implicit rules. +% : RCS/%,v + +# Disable VCS-based implicit rules. +% : SCCS/s.% + +# Disable VCS-based implicit rules. +% : s.% + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/gtq/ACMSIMC_TUT + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/gtq/ACMSIMC_TUT/build + +# Include any dependencies generated for this target. +include CMakeFiles/main.dir/depend.make +# Include any dependencies generated by the compiler for this target. +include CMakeFiles/main.dir/compiler_depend.make + +# Include the progress variables for this target. +include CMakeFiles/main.dir/progress.make + +# Include the compile flags for this target's objects. +include CMakeFiles/main.dir/flags.make + +CMakeFiles/main.dir/main.c.o: CMakeFiles/main.dir/flags.make +CMakeFiles/main.dir/main.c.o: ../main.c +CMakeFiles/main.dir/main.c.o: CMakeFiles/main.dir/compiler_depend.ts + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/gtq/ACMSIMC_TUT/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object CMakeFiles/main.dir/main.c.o" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/main.dir/main.c.o -MF CMakeFiles/main.dir/main.c.o.d -o CMakeFiles/main.dir/main.c.o -c /home/gtq/ACMSIMC_TUT/main.c + +CMakeFiles/main.dir/main.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/main.dir/main.c.i" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /home/gtq/ACMSIMC_TUT/main.c > CMakeFiles/main.dir/main.c.i + +CMakeFiles/main.dir/main.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/main.dir/main.c.s" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /home/gtq/ACMSIMC_TUT/main.c -o CMakeFiles/main.dir/main.c.s + +CMakeFiles/main.dir/commissioning.c.o: CMakeFiles/main.dir/flags.make +CMakeFiles/main.dir/commissioning.c.o: ../commissioning.c +CMakeFiles/main.dir/commissioning.c.o: CMakeFiles/main.dir/compiler_depend.ts + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/gtq/ACMSIMC_TUT/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building C object CMakeFiles/main.dir/commissioning.c.o" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/main.dir/commissioning.c.o -MF CMakeFiles/main.dir/commissioning.c.o.d -o CMakeFiles/main.dir/commissioning.c.o -c /home/gtq/ACMSIMC_TUT/commissioning.c + +CMakeFiles/main.dir/commissioning.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/main.dir/commissioning.c.i" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /home/gtq/ACMSIMC_TUT/commissioning.c > CMakeFiles/main.dir/commissioning.c.i + +CMakeFiles/main.dir/commissioning.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/main.dir/commissioning.c.s" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /home/gtq/ACMSIMC_TUT/commissioning.c -o CMakeFiles/main.dir/commissioning.c.s + +CMakeFiles/main.dir/inverter.c.o: CMakeFiles/main.dir/flags.make +CMakeFiles/main.dir/inverter.c.o: ../inverter.c +CMakeFiles/main.dir/inverter.c.o: CMakeFiles/main.dir/compiler_depend.ts + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/gtq/ACMSIMC_TUT/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building C object CMakeFiles/main.dir/inverter.c.o" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/main.dir/inverter.c.o -MF CMakeFiles/main.dir/inverter.c.o.d -o CMakeFiles/main.dir/inverter.c.o -c /home/gtq/ACMSIMC_TUT/inverter.c + +CMakeFiles/main.dir/inverter.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/main.dir/inverter.c.i" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /home/gtq/ACMSIMC_TUT/inverter.c > CMakeFiles/main.dir/inverter.c.i + +CMakeFiles/main.dir/inverter.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/main.dir/inverter.c.s" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /home/gtq/ACMSIMC_TUT/inverter.c -o CMakeFiles/main.dir/inverter.c.s + +CMakeFiles/main.dir/controller.c.o: CMakeFiles/main.dir/flags.make +CMakeFiles/main.dir/controller.c.o: ../controller.c +CMakeFiles/main.dir/controller.c.o: CMakeFiles/main.dir/compiler_depend.ts + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/gtq/ACMSIMC_TUT/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building C object CMakeFiles/main.dir/controller.c.o" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/main.dir/controller.c.o -MF CMakeFiles/main.dir/controller.c.o.d -o CMakeFiles/main.dir/controller.c.o -c /home/gtq/ACMSIMC_TUT/controller.c + +CMakeFiles/main.dir/controller.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/main.dir/controller.c.i" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /home/gtq/ACMSIMC_TUT/controller.c > CMakeFiles/main.dir/controller.c.i + +CMakeFiles/main.dir/controller.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/main.dir/controller.c.s" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /home/gtq/ACMSIMC_TUT/controller.c -o CMakeFiles/main.dir/controller.c.s + +CMakeFiles/main.dir/observer.c.o: CMakeFiles/main.dir/flags.make +CMakeFiles/main.dir/observer.c.o: ../observer.c +CMakeFiles/main.dir/observer.c.o: CMakeFiles/main.dir/compiler_depend.ts + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/gtq/ACMSIMC_TUT/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building C object CMakeFiles/main.dir/observer.c.o" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/main.dir/observer.c.o -MF CMakeFiles/main.dir/observer.c.o.d -o CMakeFiles/main.dir/observer.c.o -c /home/gtq/ACMSIMC_TUT/observer.c + +CMakeFiles/main.dir/observer.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing C source to CMakeFiles/main.dir/observer.c.i" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /home/gtq/ACMSIMC_TUT/observer.c > CMakeFiles/main.dir/observer.c.i + +CMakeFiles/main.dir/observer.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling C source to assembly CMakeFiles/main.dir/observer.c.s" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /home/gtq/ACMSIMC_TUT/observer.c -o CMakeFiles/main.dir/observer.c.s + +# Object files for target main +main_OBJECTS = \ +"CMakeFiles/main.dir/main.c.o" \ +"CMakeFiles/main.dir/commissioning.c.o" \ +"CMakeFiles/main.dir/inverter.c.o" \ +"CMakeFiles/main.dir/controller.c.o" \ +"CMakeFiles/main.dir/observer.c.o" + +# External object files for target main +main_EXTERNAL_OBJECTS = + +main: CMakeFiles/main.dir/main.c.o +main: CMakeFiles/main.dir/commissioning.c.o +main: CMakeFiles/main.dir/inverter.c.o +main: CMakeFiles/main.dir/controller.c.o +main: CMakeFiles/main.dir/observer.c.o +main: CMakeFiles/main.dir/build.make +main: CMakeFiles/main.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/gtq/ACMSIMC_TUT/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Linking C executable main" + $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/main.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +CMakeFiles/main.dir/build: main +.PHONY : CMakeFiles/main.dir/build + +CMakeFiles/main.dir/clean: + $(CMAKE_COMMAND) -P CMakeFiles/main.dir/cmake_clean.cmake +.PHONY : CMakeFiles/main.dir/clean + +CMakeFiles/main.dir/depend: + cd /home/gtq/ACMSIMC_TUT/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/gtq/ACMSIMC_TUT /home/gtq/ACMSIMC_TUT /home/gtq/ACMSIMC_TUT/build /home/gtq/ACMSIMC_TUT/build /home/gtq/ACMSIMC_TUT/build/CMakeFiles/main.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : CMakeFiles/main.dir/depend + diff --git a/build/CMakeFiles/main.dir/cmake_clean.cmake b/build/CMakeFiles/main.dir/cmake_clean.cmake new file mode 100644 index 0000000..b007a25 --- /dev/null +++ b/build/CMakeFiles/main.dir/cmake_clean.cmake @@ -0,0 +1,19 @@ +file(REMOVE_RECURSE + "CMakeFiles/main.dir/commissioning.c.o" + "CMakeFiles/main.dir/commissioning.c.o.d" + "CMakeFiles/main.dir/controller.c.o" + "CMakeFiles/main.dir/controller.c.o.d" + "CMakeFiles/main.dir/inverter.c.o" + "CMakeFiles/main.dir/inverter.c.o.d" + "CMakeFiles/main.dir/main.c.o" + "CMakeFiles/main.dir/main.c.o.d" + "CMakeFiles/main.dir/observer.c.o" + "CMakeFiles/main.dir/observer.c.o.d" + "main" + "main.pdb" +) + +# Per-language clean rules from dependency scanning. +foreach(lang C) + include(CMakeFiles/main.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/build/CMakeFiles/main.dir/commissioning.c.o b/build/CMakeFiles/main.dir/commissioning.c.o new file mode 100644 index 0000000..96a243e Binary files /dev/null and b/build/CMakeFiles/main.dir/commissioning.c.o differ diff --git a/build/CMakeFiles/main.dir/commissioning.c.o.d b/build/CMakeFiles/main.dir/commissioning.c.o.d new file mode 100644 index 0000000..aa2700f --- /dev/null +++ b/build/CMakeFiles/main.dir/commissioning.c.o.d @@ -0,0 +1,70 @@ +CMakeFiles/main.dir/commissioning.c.o: \ + /home/gtq/ACMSIMC_TUT/commissioning.c /usr/include/stdc-predef.h \ + /home/gtq/ACMSIMC_TUT/ACMSim.h /usr/include/stdio.h \ + /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \ + /usr/include/features.h /usr/include/features-time64.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/bits/timesize.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/long-double.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/include/x86_64-linux-gnu/bits/time64.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/floatn.h \ + /usr/include/x86_64-linux-gnu/bits/floatn-common.h /usr/include/curses.h \ + /usr/include/ncurses_dll.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h /usr/include/stdint.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdbool.h /usr/include/unctrl.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/time_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/timer_t.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endianness.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \ + /usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h \ + /usr/include/x86_64-linux-gnu/bits/struct_mutex.h \ + /usr/include/x86_64-linux-gnu/bits/struct_rwlock.h /usr/include/alloca.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-float.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/math-vector.h \ + /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \ + /usr/include/x86_64-linux-gnu/bits/flt-eval-method.h \ + /usr/include/x86_64-linux-gnu/bits/fp-logb.h \ + /usr/include/x86_64-linux-gnu/bits/fp-fast.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \ + /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \ + /home/gtq/ACMSIMC_TUT/ACMConfig.h /home/gtq/ACMSIMC_TUT/controller.h \ + /home/gtq/ACMSIMC_TUT/observer.h /home/gtq/ACMSIMC_TUT/inverter.h \ + /home/gtq/ACMSIMC_TUT/commissioning.h diff --git a/build/CMakeFiles/main.dir/compiler_depend.make b/build/CMakeFiles/main.dir/compiler_depend.make new file mode 100644 index 0000000..386f0a8 --- /dev/null +++ b/build/CMakeFiles/main.dir/compiler_depend.make @@ -0,0 +1,2 @@ +# Empty compiler generated dependencies file for main. +# This may be replaced when dependencies are built. diff --git a/build/CMakeFiles/main.dir/compiler_depend.ts b/build/CMakeFiles/main.dir/compiler_depend.ts new file mode 100644 index 0000000..a3467f4 --- /dev/null +++ b/build/CMakeFiles/main.dir/compiler_depend.ts @@ -0,0 +1,2 @@ +# CMAKE generated file: DO NOT EDIT! +# Timestamp file for compiler generated dependencies management for main. diff --git a/build/CMakeFiles/main.dir/controller.c.o b/build/CMakeFiles/main.dir/controller.c.o new file mode 100644 index 0000000..bff4a84 Binary files /dev/null and b/build/CMakeFiles/main.dir/controller.c.o differ diff --git a/build/CMakeFiles/main.dir/controller.c.o.d b/build/CMakeFiles/main.dir/controller.c.o.d new file mode 100644 index 0000000..1219c4d --- /dev/null +++ b/build/CMakeFiles/main.dir/controller.c.o.d @@ -0,0 +1,70 @@ +CMakeFiles/main.dir/controller.c.o: /home/gtq/ACMSIMC_TUT/controller.c \ + /usr/include/stdc-predef.h /home/gtq/ACMSIMC_TUT/ACMSim.h \ + /usr/include/stdio.h \ + /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \ + /usr/include/features.h /usr/include/features-time64.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/bits/timesize.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/long-double.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/include/x86_64-linux-gnu/bits/time64.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/floatn.h \ + /usr/include/x86_64-linux-gnu/bits/floatn-common.h /usr/include/curses.h \ + /usr/include/ncurses_dll.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h /usr/include/stdint.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdbool.h /usr/include/unctrl.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/time_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/timer_t.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endianness.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \ + /usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h \ + /usr/include/x86_64-linux-gnu/bits/struct_mutex.h \ + /usr/include/x86_64-linux-gnu/bits/struct_rwlock.h /usr/include/alloca.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-float.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/math-vector.h \ + /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \ + /usr/include/x86_64-linux-gnu/bits/flt-eval-method.h \ + /usr/include/x86_64-linux-gnu/bits/fp-logb.h \ + /usr/include/x86_64-linux-gnu/bits/fp-fast.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \ + /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \ + /home/gtq/ACMSIMC_TUT/ACMConfig.h /home/gtq/ACMSIMC_TUT/controller.h \ + /home/gtq/ACMSIMC_TUT/observer.h /home/gtq/ACMSIMC_TUT/inverter.h \ + /home/gtq/ACMSIMC_TUT/commissioning.h diff --git a/build/CMakeFiles/main.dir/depend.make b/build/CMakeFiles/main.dir/depend.make new file mode 100644 index 0000000..7e75fee --- /dev/null +++ b/build/CMakeFiles/main.dir/depend.make @@ -0,0 +1,2 @@ +# Empty dependencies file for main. +# This may be replaced when dependencies are built. diff --git a/build/CMakeFiles/main.dir/flags.make b/build/CMakeFiles/main.dir/flags.make new file mode 100644 index 0000000..5abec08 --- /dev/null +++ b/build/CMakeFiles/main.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.22 + +# compile C with /usr/bin/cc +C_DEFINES = + +C_INCLUDES = + +C_FLAGS = -lm -Wall + diff --git a/build/CMakeFiles/main.dir/inverter.c.o b/build/CMakeFiles/main.dir/inverter.c.o new file mode 100644 index 0000000..2cc9fa7 Binary files /dev/null and b/build/CMakeFiles/main.dir/inverter.c.o differ diff --git a/build/CMakeFiles/main.dir/inverter.c.o.d b/build/CMakeFiles/main.dir/inverter.c.o.d new file mode 100644 index 0000000..c4192b4 --- /dev/null +++ b/build/CMakeFiles/main.dir/inverter.c.o.d @@ -0,0 +1,70 @@ +CMakeFiles/main.dir/inverter.c.o: /home/gtq/ACMSIMC_TUT/inverter.c \ + /usr/include/stdc-predef.h /home/gtq/ACMSIMC_TUT/ACMSim.h \ + /usr/include/stdio.h \ + /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \ + /usr/include/features.h /usr/include/features-time64.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/bits/timesize.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/long-double.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/include/x86_64-linux-gnu/bits/time64.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/floatn.h \ + /usr/include/x86_64-linux-gnu/bits/floatn-common.h /usr/include/curses.h \ + /usr/include/ncurses_dll.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h /usr/include/stdint.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdbool.h /usr/include/unctrl.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/time_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/timer_t.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endianness.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \ + /usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h \ + /usr/include/x86_64-linux-gnu/bits/struct_mutex.h \ + /usr/include/x86_64-linux-gnu/bits/struct_rwlock.h /usr/include/alloca.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-float.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/math-vector.h \ + /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \ + /usr/include/x86_64-linux-gnu/bits/flt-eval-method.h \ + /usr/include/x86_64-linux-gnu/bits/fp-logb.h \ + /usr/include/x86_64-linux-gnu/bits/fp-fast.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \ + /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \ + /home/gtq/ACMSIMC_TUT/ACMConfig.h /home/gtq/ACMSIMC_TUT/controller.h \ + /home/gtq/ACMSIMC_TUT/observer.h /home/gtq/ACMSIMC_TUT/inverter.h \ + /home/gtq/ACMSIMC_TUT/commissioning.h diff --git a/build/CMakeFiles/main.dir/main.c.o b/build/CMakeFiles/main.dir/main.c.o new file mode 100644 index 0000000..ab37a84 Binary files /dev/null and b/build/CMakeFiles/main.dir/main.c.o differ diff --git a/build/CMakeFiles/main.dir/main.c.o.d b/build/CMakeFiles/main.dir/main.c.o.d new file mode 100644 index 0000000..3c4c3ed --- /dev/null +++ b/build/CMakeFiles/main.dir/main.c.o.d @@ -0,0 +1,70 @@ +CMakeFiles/main.dir/main.c.o: /home/gtq/ACMSIMC_TUT/main.c \ + /usr/include/stdc-predef.h /home/gtq/ACMSIMC_TUT/ACMSim.h \ + /usr/include/stdio.h \ + /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \ + /usr/include/features.h /usr/include/features-time64.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/bits/timesize.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/long-double.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/include/x86_64-linux-gnu/bits/time64.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/floatn.h \ + /usr/include/x86_64-linux-gnu/bits/floatn-common.h /usr/include/curses.h \ + /usr/include/ncurses_dll.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h /usr/include/stdint.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdbool.h /usr/include/unctrl.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/time_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/timer_t.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endianness.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \ + /usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h \ + /usr/include/x86_64-linux-gnu/bits/struct_mutex.h \ + /usr/include/x86_64-linux-gnu/bits/struct_rwlock.h /usr/include/alloca.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-float.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/math-vector.h \ + /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \ + /usr/include/x86_64-linux-gnu/bits/flt-eval-method.h \ + /usr/include/x86_64-linux-gnu/bits/fp-logb.h \ + /usr/include/x86_64-linux-gnu/bits/fp-fast.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \ + /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \ + /home/gtq/ACMSIMC_TUT/ACMConfig.h /home/gtq/ACMSIMC_TUT/controller.h \ + /home/gtq/ACMSIMC_TUT/observer.h /home/gtq/ACMSIMC_TUT/inverter.h \ + /home/gtq/ACMSIMC_TUT/commissioning.h diff --git a/build/CMakeFiles/main.dir/observer.c.o b/build/CMakeFiles/main.dir/observer.c.o new file mode 100644 index 0000000..ad41824 Binary files /dev/null and b/build/CMakeFiles/main.dir/observer.c.o differ diff --git a/build/CMakeFiles/main.dir/observer.c.o.d b/build/CMakeFiles/main.dir/observer.c.o.d new file mode 100644 index 0000000..972f4c7 --- /dev/null +++ b/build/CMakeFiles/main.dir/observer.c.o.d @@ -0,0 +1,70 @@ +CMakeFiles/main.dir/observer.c.o: /home/gtq/ACMSIMC_TUT/observer.c \ + /usr/include/stdc-predef.h /home/gtq/ACMSIMC_TUT/ACMSim.h \ + /usr/include/stdio.h \ + /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \ + /usr/include/features.h /usr/include/features-time64.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/bits/timesize.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/long-double.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stddef.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/include/x86_64-linux-gnu/bits/time64.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/FILE.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/floatn.h \ + /usr/include/x86_64-linux-gnu/bits/floatn-common.h /usr/include/curses.h \ + /usr/include/ncurses_dll.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdint.h /usr/include/stdint.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-intn.h \ + /usr/include/x86_64-linux-gnu/bits/stdint-uintn.h \ + /usr/lib/gcc/x86_64-linux-gnu/11/include/stdbool.h /usr/include/unctrl.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ + /usr/include/x86_64-linux-gnu/sys/types.h \ + /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/time_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/timer_t.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endianness.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ + /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \ + /usr/include/x86_64-linux-gnu/bits/atomic_wide_counter.h \ + /usr/include/x86_64-linux-gnu/bits/struct_mutex.h \ + /usr/include/x86_64-linux-gnu/bits/struct_rwlock.h /usr/include/alloca.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-float.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/math-vector.h \ + /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \ + /usr/include/x86_64-linux-gnu/bits/flt-eval-method.h \ + /usr/include/x86_64-linux-gnu/bits/fp-logb.h \ + /usr/include/x86_64-linux-gnu/bits/fp-fast.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h \ + /usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h \ + /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \ + /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \ + /home/gtq/ACMSIMC_TUT/ACMConfig.h /home/gtq/ACMSIMC_TUT/controller.h \ + /home/gtq/ACMSIMC_TUT/observer.h /home/gtq/ACMSIMC_TUT/inverter.h \ + /home/gtq/ACMSIMC_TUT/commissioning.h diff --git a/build/CMakeFiles/main.dir/progress.make b/build/CMakeFiles/main.dir/progress.make new file mode 100644 index 0000000..daba7fa --- /dev/null +++ b/build/CMakeFiles/main.dir/progress.make @@ -0,0 +1,7 @@ +CMAKE_PROGRESS_1 = 1 +CMAKE_PROGRESS_2 = 2 +CMAKE_PROGRESS_3 = 3 +CMAKE_PROGRESS_4 = 4 +CMAKE_PROGRESS_5 = 5 +CMAKE_PROGRESS_6 = 6 + diff --git a/build/CMakeFiles/progress.marks b/build/CMakeFiles/progress.marks new file mode 100644 index 0000000..1e8b314 --- /dev/null +++ b/build/CMakeFiles/progress.marks @@ -0,0 +1 @@ +6 diff --git a/build/Makefile b/build/Makefile new file mode 100644 index 0000000..f3532c1 --- /dev/null +++ b/build/Makefile @@ -0,0 +1,289 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.22 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Disable VCS-based implicit rules. +% : %,v + +# Disable VCS-based implicit rules. +% : RCS/% + +# Disable VCS-based implicit rules. +% : RCS/%,v + +# Disable VCS-based implicit rules. +% : SCCS/s.% + +# Disable VCS-based implicit rules. +% : s.% + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/gtq/ACMSIMC_TUT + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/gtq/ACMSIMC_TUT/build + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..." + /usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available. +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/gtq/ACMSIMC_TUT/build/CMakeFiles /home/gtq/ACMSIMC_TUT/build//CMakeFiles/progress.marks + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /home/gtq/ACMSIMC_TUT/build/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named main + +# Build rule for target. +main: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 main +.PHONY : main + +# fast build rule for target. +main/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/build +.PHONY : main/fast + +commissioning.o: commissioning.c.o +.PHONY : commissioning.o + +# target to build an object file +commissioning.c.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/commissioning.c.o +.PHONY : commissioning.c.o + +commissioning.i: commissioning.c.i +.PHONY : commissioning.i + +# target to preprocess a source file +commissioning.c.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/commissioning.c.i +.PHONY : commissioning.c.i + +commissioning.s: commissioning.c.s +.PHONY : commissioning.s + +# target to generate assembly for a file +commissioning.c.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/commissioning.c.s +.PHONY : commissioning.c.s + +controller.o: controller.c.o +.PHONY : controller.o + +# target to build an object file +controller.c.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/controller.c.o +.PHONY : controller.c.o + +controller.i: controller.c.i +.PHONY : controller.i + +# target to preprocess a source file +controller.c.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/controller.c.i +.PHONY : controller.c.i + +controller.s: controller.c.s +.PHONY : controller.s + +# target to generate assembly for a file +controller.c.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/controller.c.s +.PHONY : controller.c.s + +inverter.o: inverter.c.o +.PHONY : inverter.o + +# target to build an object file +inverter.c.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/inverter.c.o +.PHONY : inverter.c.o + +inverter.i: inverter.c.i +.PHONY : inverter.i + +# target to preprocess a source file +inverter.c.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/inverter.c.i +.PHONY : inverter.c.i + +inverter.s: inverter.c.s +.PHONY : inverter.s + +# target to generate assembly for a file +inverter.c.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/inverter.c.s +.PHONY : inverter.c.s + +main.o: main.c.o +.PHONY : main.o + +# target to build an object file +main.c.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/main.c.o +.PHONY : main.c.o + +main.i: main.c.i +.PHONY : main.i + +# target to preprocess a source file +main.c.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/main.c.i +.PHONY : main.c.i + +main.s: main.c.s +.PHONY : main.s + +# target to generate assembly for a file +main.c.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/main.c.s +.PHONY : main.c.s + +observer.o: observer.c.o +.PHONY : observer.o + +# target to build an object file +observer.c.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/observer.c.o +.PHONY : observer.c.o + +observer.i: observer.c.i +.PHONY : observer.i + +# target to preprocess a source file +observer.c.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/observer.c.i +.PHONY : observer.c.i + +observer.s: observer.c.s +.PHONY : observer.s + +# target to generate assembly for a file +observer.c.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/observer.c.s +.PHONY : observer.c.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... main" + @echo "... commissioning.o" + @echo "... commissioning.i" + @echo "... commissioning.s" + @echo "... controller.o" + @echo "... controller.i" + @echo "... controller.s" + @echo "... inverter.o" + @echo "... inverter.i" + @echo "... inverter.s" + @echo "... main.o" + @echo "... main.i" + @echo "... main.s" + @echo "... observer.o" + @echo "... observer.i" + @echo "... observer.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/build/cmake_install.cmake b/build/cmake_install.cmake new file mode 100644 index 0000000..c3acfae --- /dev/null +++ b/build/cmake_install.cmake @@ -0,0 +1,54 @@ +# Install script for directory: /home/gtq/ACMSIMC_TUT + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Install shared libraries without execute permission? +if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + set(CMAKE_INSTALL_SO_NO_EXE "1") +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + +# Set default install directory permissions. +if(NOT DEFINED CMAKE_OBJDUMP) + set(CMAKE_OBJDUMP "/usr/bin/objdump") +endif() + +if(CMAKE_INSTALL_COMPONENT) + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") +else() + set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +endif() + +string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT + "${CMAKE_INSTALL_MANIFEST_FILES}") +file(WRITE "/home/gtq/ACMSIMC_TUT/build/${CMAKE_INSTALL_MANIFEST}" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/build/main b/build/main new file mode 100644 index 0000000..340ec42 Binary files /dev/null and b/build/main differ diff --git a/commissioning.c b/commissioning.c index 9b76af2..1814aa7 100644 --- a/commissioning.c +++ b/commissioning.c @@ -35,7 +35,8 @@ void COMM_init(){ /* standard lib */ #include // printf #include // bool for _Bool and true for 1 -#include // for clrscr, and getch() +// #include // for clrscr, and getch() +#include #include "stdlib.h" // for rand() #include "math.h" diff --git a/img/picture.png b/img/picture.png new file mode 100644 index 0000000..0dff457 Binary files /dev/null and b/img/picture.png differ diff --git a/main.c b/main.c index e37c4dc..47b6fd6 100644 --- a/main.c +++ b/main.c @@ -219,7 +219,7 @@ int main(){ // cmd_fast_speed_reversal(CTRL.timebase, 5, 5, 1500); // timebase, instant, interval, rpm_cmd // cmd_fast_speed_reversal(CTRL.timebase, 5, 5, 200); // timebase, instant, interval, rpm_cmd if(CTRL.timebase>14){ - ACM.rpm_cmd = 900; // 40 double e_state; // Integral internal state + ACM.rpm_cmd = 90; // 40 double e_state; // Integral internal state }else if(CTRL.timebase>12){ ACM.rpm_cmd = 40; // 40 @@ -269,7 +269,7 @@ int main(){ fclose(fw); /* Fade out */ - system("python ./ACMPlot.py"); + system("python3 ../ACMPlot.py"); // getch(); // system("pause"); // system("exit");