Transfer Function Implementation with s and sqrt

조회 수: 12 (최근 30일)
Anastasios
Anastasios 2023년 12월 4일
편집: Dyuman Joshi 2023년 12월 5일
I am trying to implement the following transfer function:
H = ((2*(acos(sqrt((Vout*(1+(s*TIA_Cf*TIA_Rf)))/(TIA_Rf*Pin*0.9)))))-(3*pi/2))/((2e-7)*(7.8e-3));
However I am getting the error:
Incorrect number or types of inputs or outputs for function 'sqrt'.
Is it because the sqrt() cannot be always a positive number?
How may I handle a situation like this?
Thank you.
  댓글 수: 6
Sam Chak
Sam Chak 2023년 12월 4일
Hi @Anastasios, I'll explain what happened to your code. If you look into the documentation of sqrt(), you will find that the function only accepts inputs of data types such as single, double, table, and timetable. However, 's' is a tf-class data, and thus it threw the "Incorrect number of types of inputs..." error message.
Vout = 300e-9;
TIA_Cf = 1e-12;
TIA_Rf = 1e3;
Pin = 1e-3;
whos Vout TIA_Cf TIA_Rf Pin
Name Size Bytes Class Attributes Pin 1x1 8 double TIA_Cf 1x1 8 double TIA_Rf 1x1 8 double Vout 1x1 8 double
s = tf('s');
whos s
Name Size Bytes Class Attributes s 1x1 1281 tf
%% OP's "transfer function"
H = ((2*(acos(sqrt((Vout*(1+(s*TIA_Cf*TIA_Rf)))/(TIA_Rf*Pin*0.9)))))-(3*pi/2))/((2e-7)*(7.8e-3));
Incorrect number or types of inputs or outputs for function sqrt.

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

답변 (1개)

Sam Chak
Sam Chak 2023년 12월 5일
The transfer function that describes the mapping from the input (input Current) to the output (output Voltage) appears to be the one shown in the image. However, this may not be truly what you are looking for. What exactly is "a [ng]"?
TIA_Cf = 1e-12;
TIA_Rf = 1e3;
%% Transfer function
Gp = tf(TIA_Rf, [TIA_Cf*TIA_Rf 1])
Gp = 1000 ----------- 1e-09 s + 1 Continuous-time transfer function.
%% Bode plot
bode(Gp), grid on
  댓글 수: 3
Dyuman Joshi
Dyuman Joshi 2023년 12월 5일
편집: Dyuman Joshi 2023년 12월 5일
If nm can be interpreted as nanometer, then ng could be interpreted as nanogram.
Another interpretation could be n times gravity.
Edit - @Anastasios, aren't the things mentioned inside the square brackets units for physical quantities?
Sam Chak
Sam Chak 2023년 12월 5일
The expression boxed in green should also be represented in transfer function form. For example, the Laplace transform of the time-domain is given by .
Could you briefly explain the reason for wanting to find the acceleration?

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

카테고리

Help CenterFile Exchange에서 Get Started with Control System Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by