Error using sym/subsindex , Error in sym/subsref

4 ビュー (過去 30 日間)
Ege Alp TURKYENER
Ege Alp TURKYENER 2020 年 5 月 15 日
回答済み: Ameer Hamza 2020 年 5 月 15 日
syms Ybus k n V i N;
V(k,i) = (1/Ybus(k,k))*((conj(S(k)))/(conj(V(k,i)))-(symsum(Ybus(k,n)*V(n,i+1),n,1,k-1)) -(symsum(Ybus(k,N)*V(N,i),n,k+1,N)));
Error using sym/subsindex (line 855)
Invalid indexing or function definition. Indexing must follow MATLAB indexing. Function arguments must be symbolic variables, and function body must be sym
expression.
Error in sym/subsref (line 900)
R_tilde = builtin('subsref',L_tilde,Idx);
Error in hmw (line 28)
V(k,i) = (1/Ybus(k,k))*((conj(S(k)))/(conj(V(k,i)))-(symsum(Ybus(k,n)*V(n,i+1),n,1,k-1)) -(symsum(Ybus(k,N)*V(N,i),n,k+1,N)));
Where is the problem ?

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 5 月 15 日
You are using Ybus, S, and V as functions, however, you defined them as simple symbolic variables. Try this
syms Ybus(k,n) V(k,i) N S(k)
V(k,i) = (1/Ybus(k,k))*((conj(S(k)))/(conj(V(k,i)))-(symsum(Ybus(k,n)*V(n,i+1),n,1,k-1)) -(symsum(Ybus(k,N)*V(N,i),n,k+1,N)));
Also, here you are defining V(k,i) in terms of V(k,1). It appears there might be a logical error. Can you show the equation you are trying to implement?

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by