Transfer Function Implementation with s and sqrt
古いコメントを表示
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 件のコメント
You get the error because transfer function inputs are not accepted by sqrt(). I have recreated the error below.
s = tf('s');
sqrt(s)
As for handling the issue, please provide more information as to what you are trying to do / what is the objective here.
Anastasios
2023 年 12 月 4 日
移動済み: Dyuman Joshi
2023 年 12 月 4 日
Sam Chak
2023 年 12 月 4 日
@Anastasios, Can you show the math equation of this code? I want see how it looks like in the true mathematical "Display" mode.
H = ((2*(acos(sqrt((Vout*(1+(s*TIA_Cf*TIA_Rf)))/(TIA_Rf*Pin*0.9)))))-(3*pi/2))/((2e-7)*(7.8e-3));
Anastasios
2023 年 12 月 4 日
移動済み: Sam Chak
2023 年 12 月 4 日
Anastasios
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
s = tf('s');
whos s
%% 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));

回答 (1 件)
Hi @Anastasios
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])
%% Bode plot
bode(Gp), grid on
3 件のコメント
Anastasios
2023 年 12 月 5 日
編集済み: Anastasios
2023 年 12 月 5 日
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
2023 年 12 月 5 日
Hi @Anastasios
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
.
is given by
. Could you briefly explain the reason for wanting to find the acceleration?

カテゴリ
ヘルプ センター および File Exchange で Response Computation and Visualization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

