HI all i was trying to calculate the transfer function of an regulator i wrote below kcl nodal equations
clc;
clear;
%for test transfer function
syms s x y z G_MOTA R_OTA C_OTA s g_mbuf C_gdMN ...
C_gsMN g_mMN R_L C_L R_1 R_2 C_1 C_2 V_out V_in
S1= solve( 's*C_1*(V_in-x)+(V_in-x)/R_1=x/R_2+s*C_2*(x-z)',V_in,...
'-G_MOTA*x=y/R_OTA+s*C_OTA*y ' ,y ,...
'y*g_mbuf=g_mbuf*z+s*C_2*(z-x)+s*C_gdMN*z+s*C_gsMN*(z-V_out)' ,z ,...
'(g_mMN+s*C_gsMN)*(z-V_out)=s*C_L*V_out+V_out/R_L',V_out);
TF = (S1.V_out/S1.V_in);
H=collect(TF,s)
i am getting this below error
Struct contents reference from a non-struct array object.
Error in sym/subsref (line 881)
R_tilde = builtin('subsref',L_tilde,Idx);
Error in tranfun (line 12)
TF = (S1.V_out/S1.V_in);

 채택된 답변

manish srivastava
manish srivastava 2018년 10월 5일

0 개 추천

It is working now thanks you very much

댓글 수: 1

Stephan
Stephan 2018년 10월 6일
Glad to hear - you can accept and/or vote for helpful answers in order to help people with similar problems finding useful answers. Also this is the way how the volunteers here warm reputation.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Stephan
Stephan 2018년 10월 2일

0 개 추천

Hi,
try:
syms s x y z G_MOTA R_OTA C_OTA s g_mbuf C_gdMN ...
C_gsMN g_mMN R_L C_L R_1 R_2 C_1 C_2 V_out V_in
eqn = [s*C_1*(V_in-x)+(V_in-x)/R_1 == x/R_2+s*C_2*(x-z),...
-G_MOTA*x == y/R_OTA+s*C_OTA*y,...
y*g_mbuf == g_mbuf*z+s*C_2*(z-x)+s*C_gdMN*z+s*C_gsMN*(z-V_out),...
(g_mMN+s*C_gsMN)*(z-V_out) == s*C_L*V_out+V_out/R_L];
vars = [V_in, y, z, V_out];
S1 = solve(eqn, vars);
TF = (S1.V_out/S1.V_in);
H=collect(TF,s);

댓글 수: 1

Torsten
Torsten 2018년 10월 5일
manish srivastava's answer moved to a comment
error gone thanks you but nothing is comming out as outputt

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

태그

질문:

2018년 10월 2일

댓글:

2018년 10월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by