⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fm_draw.m

📁 电力系统的psat
💻 M
字号:
function [x,y] = fm_draw(varargin)% FM_DRAW draw the PSAT Simulink library component masks%%Author:    Federico Milano%Date:      11-Nov-2002%Update:    31-Jan-2003%Version:   1.0.0%%E-mail:    fmilano@thunderbox.uwaterloo.ca%Web-site:  http://thunderbox.uwaterloo.ca/~fmilano%% Copyright (C) 2002-2005 Federico Milano%% This toolbox 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 2.0 of the License, or% (at your option) any later version.%% This toolbox is distributed in the hope that it will be useful, but% WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANDABILITY 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 toolbox; if not, write to the Free Software% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,% USA.if nargin == 0, return, endswitch varargin{1} case 'circle'  t = 0:0.05:2*pi+0.05;  x = cos(t);  y = sin(t); case 'semicircle'  t = -pi/2:0.05:pi/2+0.05;  x = cos(t);  y = sin(t); case 'quarter'  t = 0:0.05:pi/2+0.05;  x = cos(t);  y = sin(t); case 'sinus'  x = 0:0.05:2*pi+0.05;  y = sin(x); case 'helix'  t = 0:0.05:2*pi+0.05;  y = sin(t);  x = cos(t).*y; case 'C'  t = 0:0.05:pi+0.05;  x1 = cos(t);  y1 = sin(t);  x = [1+x1,0,0,1-x1]/2;  y = [1+y1,1,-1,-1-y1]/4; case 'S'  t = -pi/2:0.05:pi/2+0.05;  x1 = cos(t);  y1 = sin(t);  x = [-1.5,0.5,0.5+x1,0.5,-0.5,-0.5-x1,-0.5,1]/3;  y = [-2,-2,-1+y1,0,0,1+y1,2,2]/4; case 'P'  t = -pi/2:0.05:pi/2+0.05;  x1 = cos(t);  y1 = sin(t);  x = [-1,0.5,0.5+x1,0.5,-1,-1]/2.5;  y = [0,0,1+y1,2,2,-2]/4; case 'M'  x = [-0.5,-0.5,0,0.5,0.5];  y = [-0.5,0.5,-0.5,0.5,-0.5]; case 'O'  t = 0:0.05:pi+0.05;  x1 = cos(t);  y1 = sin(t);  x = [1+x1,0,0,1-x1,2,2]/2;  y = [1+y1,1,-1,-1-y1,-1,1]/4; case 'U'  t = 0:0.05:pi+0.05;  x1 = cos(t);  y1 = sin(t);  x = [0,0,1-x1,2,2]/2;  y = [2,-1,-1-y1,-1,2]/4; case 'R'  t = -pi/2:0.05:pi/2+0.05;  x1 = cos(t);  y1 = sin(t);  x = [1.5,0.5,-1,0.5,0.5+x1,0.5,-1,-1]/2.5;  y = [-2,0,0,0,1+y1,2,2,-2]/4; case 'J'  t = 0:0.05:pi+0.05;  x1 = cos(t);  y1 = sin(t);  x = [1-x1,2,2,2,1,3]/4-0.25;  y = [-1-y1,-1,2,2,2,2]/4; case 'G'  t = pi/4:0.05:2*pi-pi/10+0.025;  x1 = cos(t);  y1 = sin(t);  x = [x1,0];  y = [y1,-0.2934]; case 'hill'  t = pi/4:0.05:3*pi/4;  x = cos(t);  y = sin(t); case 'cap'  x = [-0.3420   -0.5000   -0.6428   -0.7660   -0.8660 ...       -0.9397   -0.9848   -1.0000   -0.9848   -0.9397 ...       -0.8660   -0.7660   -0.6428   -0.5000   -0.3420];  y = [ 0.9397    0.8660    0.7660    0.6428    0.5000 ...        0.3420    0.1736    0.0000   -0.1736   -0.3420 ...       -0.5000   -0.6428   -0.7660   -0.8660   -0.9397]; case 'ind'  x = [0 0.174 0.342 0.5 0.643 0.766 0.866 0.94 0.985 1 0.985 ...       0.94 0.866 0.766 0.643 0.5  0.342 0.174 0];  y = [1 0.985 0.94 0.866 0.766 0.643 0.5 0.342 0.174 0 -0.174 ...       -0.342 -0.5 -0.643 -0.766 -0.866 -0.94 -0.985 -1]; case 'a'  x = [ 0.8660    0.7071    0.5000    0.2588    0.0000   -0.2588  ...       -0.5000   -0.7071   -0.8660   -0.9659   -1.0000   -0.9659  ...       -0.8660   -0.7071   -0.5000   -0.2588   -0.0000    0.2588  ...        0.5000    0.7071    0.8660    0.8660    0.8660    0.7071  ...        0.5000    0.2588    0.0000   -0.2588   -0.5000];  y = [ 0.5000    0.7071    0.8660    0.9659    1.0000    0.9659  ...        0.8660    0.7071    0.5000    0.2588    0.0000   -0.2588  ...       -0.5000   -0.7071   -0.8660   -0.9659   -1.0000   -0.9659  ...       -0.8660   -0.7071   -0.5000   -1.0000    1.5000    1.7071  ...        1.8660    1.9659    2.0000    1.9659    1.8660]; otherwise  x = [];  y = [];end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -