I am trying to use Simscape to model the simple cross-over filter below.
Using the linearisation tool box I am able to extract its state-space representation and plot its transfer function. I would like to run a parameter sweep where I vary the inductance of Ind1.
I have managed to get this working, but the simulation has to recompile everytime it is linearised. When I use the fastRestartForLinearAnalysis( ) function (taken fropm the example in https://uk.mathworks.com/help/slcontrol/ug/fastrestartforlinearanalysis.html) the model no longer recompiles with each iteration, but the variable L_LP doesnt seem to get updated anymore... How can I avoid recompiling the model everytime, whilst still varying parameter values?
The main peice of code I am using is given below.
L_LP = 1e-3;
for n = 1:100
L_LP = L_LP + 0.0001 ;
linsys = linearize(mdl,io);
[magLP(n,:), phaseLP(n,:)] = bode(linsys(1),w);