MATLAB: Problems with multirate simscape electrical model

electricalMATLABpower_electronics_controlSimscapeSimscape Electricalsimulink

Hi everyone,
I'm trying to run a simscape electrical model with two networks (CPU and FPGA) and different sample times. I've inserted two solver configuration blocks (one for each subsystem/network) and I'm using the local solver (Backward Euler). The sample time in both solvers it's different, but when I check the sample time of the model I see that the electrical blocks have the global sample time that is set in the solver.
These are the sample times of my model:
Ts_cpu = 50e-6
Ts_fpga = 10e-6
Solver = 1e-6
Attached to this question you can find how I'm configuring the solver configuration, the configuration parameter of the solver and the timing legend of the model.
Do you know how can I set Ts_cpu for CPU network and Ts_fpga for FPGA network?
Thank you in advance,
Ander.

Best Answer

Hello Ander,
you can have seperate step sizes for your solver configurations. This is what it should look like: (I set one to 1e-3 and one to 1e-4, both backward Euler). see the color of the line coming out of the one network vs the other (red vs green).
I attatched the example but its in 2020b so it might not work for you. Let me know what version you'd life if you want an example. Notice the simscape solver block color in this case is yellow for multi-rate, I am not sure that's how it works for older versions.
Regards,
Joel