Error using sym/subsindex , Error in sym/subsref
5 views (last 30 days)
Show older comments
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 ?
0 Comments
Answers (1)
Ameer Hamza
on 15 May 2020
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?
0 Comments
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!