필터 지우기
필터 지우기

insert an array of values inside a transfer function block(simulink)

조회 수: 4 (최근 30일)
mohamed sarfaras JAFARULLA KHAN
mohamed sarfaras JAFARULLA KHAN 2022년 1월 26일
답변: Riya 2023년 11월 19일
I have tau=0.1:0.1:10;
this array of tau values must be simulated for an ODE(xdotdot+tau*xdot+x=u) using a transfer function(simulink) block to find ideal value of tau.
denominator of transfer function is [1 tau*s 1]
I am unable add array of values,to make simulate multiple values in simulink .

답변 (1개)

Riya
Riya 2023년 11월 19일
Hello mohamed sarfaras JAFARULLA KHAN,
As per my understanding you want to insert an array of values inside a transfer function block in Simulink.
Please note that to simulate multiple values of tau in Simulink using a transfer function block, you can follow these steps:
1. Create a MATLAB Function block in Simulink. This block will allow you to define and use MATLAB code within your Simulink model.
2. Inside the MATLAB Function block, define the array of tau values using the given expression: `tau = 0.1:0.1:10;`.
3. Use a for loop to iterate over the tau values and simulate the system for each value. Within the loop, create a transfer function object using the `tf` function and specify the numerator and denominator coefficients.
Here is an example of how the MATLAB Function block code could look like:
function y = tauSimulation(u)
tau = 0.1:0.1:10;
y = zeros(size(tau));
for i = 1:length(tau)
sys = tf(1, [1, tau(i), 1]);
y(i) = lsim(sys, u);
end
end
4. Connect the input `u` to the MATLAB Function block and use the output `y` to observe the simulated response for each tau value.
By implementing this MATLAB Function block in your Simulink model, you will be able to simulate the system for multiple values of tau using the transfer function block.
I hope it helps.
Regards
Riya

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by