이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
Undefined function 'ShortLine' for input arguments of type 'double'.
조회 수: 1 (최근 30일)
이전 댓글 표시
%***- - - - - Main Program
function test()
TransmissionLineData;
[ZSeries,YShunt] = ShortLine(nphc,ngw,nb,bsep,resis,rdext,gmr,x,y,f, sigmag,vbase,sbase)
[Z012,Y012] = SequenceImpedance(ZSeries,YShunt);
%End main Program
function [Z012,Y012] = SequenceImpedance(ZSeries,YShunt)
TS(1,1) = 1;
TS(1,2) = 1;
TS(1,3) = 1;
TS(2,1) = 1;
TS(2,2) = -0.5-sqrt(3)*0.5*i;
TS(2,3) = -0.5+sqrt(3)*0.5*i;
TS(3,1) = 1;
TS(3,2) = -0.5+sqrt(3)*0.5*i;
TS(3,3) = -0.5-sqrt(3)*0.5*i;
ST = inv(TS);
Z012 = ST*ZSeries*TS;
Y012 = ST*YShunt*TS;
댓글 수: 12
Geoff Hayes
2017년 12월 15일
Mohd - is ShortLine a function that you have written or have downloaded from somewhere? The error suggests that MATLAB can't find that function or you are not providing the correct input parameters.
In the command window type
which ShortLine
The above will return the full path for the function if it can be found. If it can't be found, then try adding it (or rather the folder that it is in) to your MATLAB search path. See https://www.mathworks.com/help/matlab/matlab_env/what-is-the-matlab-search-path.html for details.
Adam
2017년 12월 15일
Please format your code, it is almost impossible to work out what is on each line and what is in a comment.
MOHD ABDUL MUQEEM
2017년 12월 15일
편집: Walter Roberson
2017년 12월 15일
%transmission line.
%
%nphc = number of phase conductors
%ngw = number of ground wires
%
nphc = 3 ; ngw = 0 ;
%
%Individual Conductors Data
%resis = resistance in ohms per meter
%rdext = external radius in meters
%gmr = geometrical mean radius in meters
%nb = number of bundle conductors per phase -1 to 4
%bsep = separation between conductors in the bundle in meters
%x,y = conductor’s co-ordinates in the tower in meters
%
resis(1) = 0.1379/1000 ; rdext(1) = 1.049/100 ; gmr(1) = 0.817/100 ;
nb(1) = 4 ; bsep(1) = 0.46 ; x(1) = 12.65 ; y(1) = 27.50 ;
resis(2) = 0.1379/1000 ; rdext(2) = 1.049/100 ; gmr(2) = 0.817/100 ;
nb(2) = 4 ; bsep(2) = 0.46 ; x(2) = 0 ; y(2) = 27.50 ;
resis(3) = 0.1379/1000 ; rdext(3) = 1.049/100 ; gmr(3) = 0.817/100 ;
nb(3) = 4 ; bsep(3) = 0.46 ; x(3) = -12.65 ; y(3) = 27.50 ;
%
%General Data
%f = frequency
%sigmag = ground’s conductivity
%vbase = base voltage
%sbase = base power
%
f = 50 ; sigmag = 0.01 ; vbase = 500 ; sbase = 100 ;
%
%End of function TransmissionLineData
MOHD ABDUL MUQEEM
2017년 12월 15일
편집: Walter Roberson
2017년 12월 15일
%transmission line of Example 1, to include long-line effects and passive
%shunt and series compensation. The line is 500 km long and contains no
%compensation.
%
%Transmission Line Data
%
%nsections = number of sections in the transmission line
%length = total length of transmission line
%
nsections = 1 ;
length(1) = 500 ;
%
%Compensating Plant Data
%
ZSe(:,:,1) = [ 0 0 0 ; 0 0 0 ; 0 0 0 ] ;
YSh(:,:,1) = [ 0 0 0 ; 0 0 0 ; 0 0 0 ] ;
%
%End of function LongLineData
MOHD ABDUL MUQEEM
2017년 12월 15일
편집: Walter Roberson
2017년 12월 15일
%***- - - - - Main Program
function test()
TransmissionLineData;
[ZSeries,YShunt] = ShortLine(nphc,ngw,nb,bsep,resis,rdext,gmr,...
x,y,f, sigmag,vbase,sbase)
%End main Program
function [ZSeries,YShunt] = ShortLine(nphc,ngw,nb,bsep,...
resis,rdext,gmr,x, y,f,sigmag,vbase,sbase)
[RAD,GMR,RES] = BundleReduction(nphc,ngw,nb,bsep,rdext,gmr,resis);
[YShunt] = PotCoeff(nphc,RAD,x,y,f);
[ZSeries] = Dubanton(nphc,ngw,GMR,RES,x,y,f,sigmag);
[ZSeries] = GroundWireReduction(nphc,ngw,ZSeries);
[ZSeries,YShunt] = PerUnit(nphc,ZSeries,YShunt,vbase,sbase);
function [RAD,GMR,RES] = BundleReduction(nphc,ngw,nb,bsep,rdext,...
gmr,resis);
for ii = 1: nphc + ngw
if nb(ii) == 1
RAD(ii) = rdext(ii);
GMR(ii) = gmr(ii);
elseif nb(ii) == 2
RAD(ii) = sqrt(rdext(ii)*bsep(ii));
GMR(ii) = sqrt(gmr(ii)*bsep(ii));
elseif nb(ii) == 3
RAD(ii) = exp(log(rdext(ii)*bsep(ii)*bsep(ii))/3);
GMR(ii) = exp(log(gmr(ii)*bsep(ii)*bsep(ii))/3);
elseif nb(ii) == 4
RAD(ii) = sqrt(sqrt(rdext(ii)*bsep(ii)*bsep(ii)*bsep(ii)...
*sqrt (2)));
GMR(ii) = sqrt(sqrt(gmr(ii)*bsep(ii)*bsep(ii)*bsep(ii)*sqrt(2)));
end
RES(ii) = resis(ii)/nb(ii);
end
function [YShunt] = PotCoeff(nphc,RAD,x,y,f);
[YShunt] = zeros(nphc,nphc);
omega = 2*pi*f;
eps = 8.854*1e-9;
for ii = 1: nphc
for jj = 1: nphc
if ( ii == jj )
YShunt(ii,ii)=log(2*y(ii)/RAD(ii));
else
YShunt(ii,jj) = log( sqrt ( ( x(ii) - x(jj) )^2 + ...
( y(ii) + y(jj) )^2 ) / sqrt ( ( x(ii) - x(jj) )^2 + ...
( y(ii)-y(jj) )^2 ) );
end
end
end
YShunt = i*2*pi*omega*eps*inv(YShunt);
function [ZSeries] = Dubanton(nphc,ngw,GMR,RES,x,y,f,sigmag)
[ZSeries] = zeros(nphc+ngw,nphc+ngw);
mnu = 4*pi*1e-7;
omega = (0+(2*pi*f)*i);
pe = 1/sqrt(omega*mnu*sigmag);
for ii = 1: nphc + ngw
for jj = 1: nphc + ngw
if( ii == jj )
ZSeries(ii,ii) = 1000*( RES(ii) + omega*mnu*...
log((y(ii)+y(jj)+2*pe)/GMR(ii))/(2*pi) );
else
ZSeries(ii,jj) = 1000*omega*mnu*...
log( sqrt((x(ii)-x(jj))^2+(y(ii)+y(jj)+2*pe)^2) /...
sqrt((x(ii)-x(jj))^2+(y(ii)-y(jj))^2 ) )/(2*pi);
end
end
end
function [ZSeries] = GroundWireReduction(nphc,ngw,ZSeries)
for ii = nphc + 1: nphc + ngw
ZSeries(ii,ii) = 1/ZSeries(ii,ii);
for jj = 1: nphc + ngw
if( ii ~= jj )
ZSeries(jj,ii) = ZSeries(jj,ii)*ZSeries(ii,ii);
for kk = 1: nphc + ngw
if( kk ~= ii )
ZSeries(jj,kk) = ZSeries(jj,kk) -ZSeries(jj,ii)*...
ZSeries(ii,kk);
if ( jj == nphc + ngw)
ZSeries(ii,kk) = -ZSeries(ii,ii)*ZSeries(ii,kk);
end
end
end
end
end
end
if ngw > 0
for jj = 1: nphc + ngw -1
ZSeries(nphc+ngw,jj) = -ZSeries(nphc+ngw,nphc+ngw)*...
ZSeries(nphc+ngw,jj)
end
ZSeries = ZSeries(1:nphc,1:nphc);
end
function [ZSeries,YShunt] = PerUnit(nphc,ZSeries,YShunt,vbase,sbase)
zbase = vbase*vbase/sbase;
for ii = 1: nphc
for jj = 1: nphc
ZSeries(ii,jj) = ZSeries(ii,jj)/zbase;
YShunt(ii,jj) = YShunt(ii,jj)*zbase;
end
end
MOHD ABDUL MUQEEM
2017년 12월 15일
편집: Walter Roberson
2017년 12월 15일
%***- - - - - Main Program
function test()
TransmissionLineData;
[ZSeries,YShunt] = ShortLine(nphc,ngw,nb,bsep,resis,rdext,gmr,...
x,y,f, sigmag,vbase,sbase)
[Z012,Y012] = SequenceImpedance(ZSeries,YShunt);
%End main Program
function [Z012,Y012] = SequenceImpedance(ZSeries,YShunt)
TS(1,1) = 1;
TS(1,2) = 1;
TS(1,3) = 1;
TS(2,1) = 1;
TS(2,2) = -0.5-sqrt(3)*0.5*i;
TS(2,3) = -0.5+sqrt(3)*0.5*i;
TS(3,1) = 1;
TS(3,2) = -0.5+sqrt(3)*0.5*i;
TS(3,3) = -0.5-sqrt(3)*0.5*i;
ST = inv(TS);
Z012 = ST*ZSeries*TS;
Y012 = ST*YShunt*TS;
MOHD ABDUL MUQEEM
2017년 12월 15일
편집: Walter Roberson
2017년 12월 15일
%***- - - - - Main Program
function test()
TransmissionLineData;
LongLineData;
[ZSeries,YShunt,Z012,Y012] = ShortLine(nphc,ngw,nb,bsep,resis,...
rdext,gmr,x,y,f,sigmag,vbase,sbase);
[ZPhase,YPhase] = LongLine(nphc,nsections,length,ZSeries,YShunt,...
ZSe,Ysh);
%End main Program
function [ZPhase,YPhase] = LongLine(nphc,nsect,length,ZSeries,...
YShunt,ZSe,YSh)
AUX = eye(nphc*2);
[TV,ZY] = eig(ZSeries*YShunt);
[TI,YZ] = eig(YShunt*ZSeries);
ZModal = inv(TV)*ZSeries*TI;
YModal = inv(TI)*YShunt*TV;
kk = 1;
for ll = 1: nsect
if ( length(ll) > 0 )
[ABCD] = ABCDLine(ll,nphc,length,ZModal,YModal,TV,TI);
else
[ABCD] = ABCDComp(kk,nphc,ZSe,YSh);
kk = kk + 1;
end
AUX = AUX*ABCD;
end
ABCD = AUX;
A = ABCD(1:nphc,1:nphc);
B = ABCD(1:nphc,nphc+1:nphc*2);
C = ABCD(nphc+1:nphc*2,1:nphc);
D = ABCD(nphc+1:nphc*2,nphc+1:nphc*2);
ZPhase(1:nphc,1:nphc) = A*inv(C);
ZPhase(1:nphc,nphc+1:nphc*2) = -B + A*inv(C)*D;
ZPhase(nphc+1:nphc*2,1:nphc) = inv(C);
ZPhase(nphc+1:nphc*2,nphc+1:nphc*2) = inv(C)*D;
YPhase = inv(ZPhase);
%End LongLine function
function [ABCD] = ABCDLine(ll,nphc,length,ZModal,YModal,TV,TI);
Modal = zeros(nphc,nphc);
for ii = 1: nphc
gamma = sqrt(ZModal(ii,ii)*YModal(ii,ii));
gammar = real(gamma*length(ll));
gammai = imag(gamma*length(ll));
fact1 = sinh(gammar);
fact2 = cosh(gammar);
fact3 = sin(gammai);
fact4 = cos(gammai);
Modal(ii,ii) = ((fact2*fact4)+(fact1*fact3)*i);
end
ABCD(1:nphc,1:nphc) = TV*Modal*inv(TV);
for ii = 1: nphc
gamma = sqrt(ZModal(ii,ii)*YModal(ii,ii));
gammar = real(gamma*length(ll));
gammai = imag(gamma*length(ll));
fact1 = sinh(gammar);
fact2 = cosh(gammar);
fact3 = sin(gammai);
fact4 = cos(gammai);
Modal(ii,ii) = sqrt(ZModal(ii,ii)/YModal(ii,ii))*...
(fact1*fact4+fact2*fact3*i);
end
ABCD(1:nphc,nphc+1:nphc*2) = TV*Modal*inv(TI);
for ii = 1: nphc
gamma = sqrt(ZModal(ii,ii)*YModal(ii,ii));
gammar = real(gamma*length(ll));
gammai = imag(gamma*length(ll));
fact1 = sinh(gammar);
fact2 = cosh(gammar);
fact3 = sin(gammai);
fact4 = cos(gammai);
Modal(ii,ii) = sqrt(YModal(ii,ii)/ZModal(ii,ii))*...
(fact1*fact4+fact2*fact3*i);
end
ABCD(nphc+1:nphc*2,1:nphc) = TI*Modal*inv(TV);
for ii = 1: nphc
gamma = sqrt(ZModal(ii,ii)*YModal(ii,ii));
gammar = real(gamma*length(ll));
gammai = imag(gamma*length(ll));
fact1 = sinh(gammar);
fact2 = cosh(gammar);
fact3 = sin(gammai);
fact4 = cos(gammai);
Modal(ii,ii) = (fact2*fact4+fact1*fact3*i);
end
ABCD(nphc+1:nphc*2,nphc+1:nphc*2) = TI*Modal*inv(TI);
%End ABCDLine function
function [ABCD] = ABCDComp(kk,nphc,ZSe,YSh)
One = eye(nphc) ;
ABCD(1:nphc,1:nphc) = One ;
ABCD(1:nphc,nphc+1:nphc*2) = ZSe(:,:,kk) ;
ABCD(nphc+1:nphc*2,1:nphc) = YSh(:,:,kk) ;
ABCD(nphc+1:nphc*2,nphc+1:nphc*2) = YSh(:,:,kk)*ZSe(:,:,kk) + One ;
%End ABCDComp function
Walter Roberson
2017년 12월 15일
I am confused. You have posted several different function test(), only one of which defines function ShortLine . I do not know which one is the correct version.
If you define a function inside a .m but not as the first function in the file, then that second function cannot be called from outside the .m (unless you pass out a handle to it.)
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)