How Do I Change a Block Parameter Based on the Output of Another Block?

조회 수: 3 (최근 30일)
Abdull walii
Abdull walii 2017년 3월 16일
댓글: Abdull walii 2017년 3월 17일
Hi, i have two transfer functions as shown in the attached picture. transfer function 1 has an equation (tms+1)/(Kms+1) transfer function 2 has an equation Km/(tms^2 + s) whenever the parameters Km and tm in transfer function 2 changes i want the the parameters Km and tm in transfer function 1 also to change at the same time with the same values accordingly. So may you please help me how to do it. Your reply be very appreciated.

채택된 답변

ES
ES 2017년 3월 16일
Use values from workspace. For example, create variables in workspace tms=1, kms=5. use these variables instead of the direct values in the transfer function blocks.
Simulate till you need.
change values of tms and kms in workspace (say tms =1.5, kms = 3). do a
set_param(model, 'SimulationCommand', 'update')% to update model with values from workspace.
Continue simulation
  댓글 수: 1
Abdull walii
Abdull walii 2017년 3월 17일
@Warrior Thank you for your reply, yeah that way its working, but is there any way so that I can change the values of these variables using a simulink block (such as changing the values inside the transfer function block in the simulink) instead of changing in the workspace ?

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

추가 답변 (0개)

카테고리

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

태그

아직 태그를 입력하지 않았습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by