same models in MATLAB and Simulink but different results! what would you do in this case?

1 view (last 30 days)
Hi everyone,
I am building a model in simulink which I have done it in MATLAB before. In one specific part of the model a PDE must be solved using iterative loop for two variables (pressure and air thickness in Reynold's equation)for 51*51 points in matrix-form. This proccess is done by using 2 while loops in MATLAB-code and different blocks including MATLAB-fcn block in simulink. As you may see in two attached pictures there are instability in both models from MATLAB-code and Simulink for one those two variables (at the right side of pictures) but in simulink (right) it's deffinitively much more greater (and also negative values) than by result form MATLAB-code (left) and exactly because of that I recieve a whole different result for the second variable with exact the same constrains. What would you change or test in Simulink in order to obtain the exact result as in MATLAB-code?

Answers (0)

Community Treasure Hunt

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

Start Hunting!