MATLAB: Is trim command not supported when Simscape blocks are present in the model

Simscape

I have a Simscape model of the power valve and I need to autotune pre-loads on springs.
I am using a PID to tune the value.
I using the trim command to do the job.
But I am getting the below error when using the trim command on my model.
Error: All elements of the variable must be a differential or algebraic

Best Answer

Unfortunately, the "trim" command in not supported for Simscape blocks.
I suggest you to use the Simscape Initial Condition Solver to find the steady state operating point for the system.
You can get more details about finding an operating point of the system when Simscape blocks are involved in the following link: