Altering Resistance Parameters during Simulation in Simulink

Hi all,
I am having a similar problem to this thread (<http://www.mathworks.com/matlabcentral/answers/41582-control-a-simulink-module-by-an-m-file>) in which I would like to alter the resistance of my circuit during simulation. I have tried most of the methods suggested in it but to no avail, I am not entirely sure how to implement the clock/function method. Do I require an output to the function, and do I need to call the function within my main m-file? This is what I have written so far:
function Rchange(time)
%#codegen
coder.extrinsic('set_param');
if time > 20
set_param('autotest\R1','Resistance','1350');
elseif time > 40
set_param('autotest\R1','Resistance','750');
end
Also, I am unable to use the variable resistor which would seem like the most logical solution to my problem as I am running SimPowerSystems and do not know how to convert signals using the s-ps converters and reconnecting it back to my circuit.
Any help will be appreciated.
Thanks

답변 (1개)

Sabin
Sabin 2022년 12월 23일

0 개 추천

In Simscape Electrical a Variable Resistor can be used for such problems. Variable Resistor is available in both Simscape and Specialized Power Systems technologies.

카테고리

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

질문:

2013년 1월 16일

답변:

2022년 12월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by