Difference between MacOS and Windows

Hello
I am rather new to Matlab and I am working on a simple project on MatLab and Simulink but I have an issue with it.
When I am running my script and simulink model on Matlab 2017 for Windows (at school), the plot that I obtain are the one that I expect to have. But the minute I run the same script and simulink model on MatLab 2022 for MacOS (personnal computer) the plot that I get is not what I expect it to be, furthermore it is not the same as what I get under MatLab 2017 for Windows which is very odd. For information, the script uses very simple mathematical object such as matrix and sqrt
Does someone know where does this difference could come from ? I'm kind of going crazy because of it.
Thank you in advance for your responses !

7 Commenti

could you share the script?
The simulink model : gain 3 is B1*u, gain 2 is A1*u and gain 1 is C1*u, the sine wave is u(t)=10*sin(wt)
Bruno Luong
Bruno Luong il 1 Mar 2023
Modificato: Bruno Luong il 1 Mar 2023
Please share the script by typing the code here (capsulated using the [>] icon) or attach the mfile with paperclip icon, NOT the screenshot that is not useful.
Then show the results between MATLAB versions and computers.
On the left there is the scope view that I get when I'm runningg the script on MacOS and on the right there is the scope view that I get when I'm running the script on Windows (this one is the one I expect)
@Bruno Luong ok I am going to share the code in another way, sorry about the screenshot
%parameters
M1=25;
M2=250;
K1=210000;
K2=29500;
b1=13100;
b2=1850;
%Part 1
A1 = [-b2/M2 1/M2; -K2 0];
B1 = [b2/M2; K2];
C1 = [1 0];
D1 = 0;
%Part 2
A2 = [-b2/M2 1/M2 b2/M2 0; -K2 0 K2 0; b2/M1 -1/M1 -(b1+b2)/M2 1/M1; 0 0 -K1 0];
B2 = [0 ;0 ;b1/M1 ;K1];
C2 = [1 0 0 0];
D2 = 0;
%Simulation for different w
w=2*pi;
w1=5*sqrt(K1/M1);
w2=w1/5;
w3=w2/2;
w4=sqrt(K2/M2);
w5=w4*0.1;
Luca Ferro
Luca Ferro il 1 Mar 2023
Modificato: Luca Ferro il 1 Mar 2023
just a guess but:
  • check the solver type/step (mac seems variable, windows fixed)
  • try to compare the graphs as the same order of dimension on x axis (mac is 0-1-2-3, windows 0.001, 0.002, ..)
  • check the simulation time (mac is 10s, windows is 0.1

Accedi per commentare.

Risposte (0)

Categorie

Prodotti

Release

R2022b

Richiesto:

il 1 Mar 2023

Modificato:

il 1 Mar 2023

Community Treasure Hunt

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

Start Hunting!

Translated by