Difference between MacOS and Windows

7 views (last 30 days)
Guillemette
Guillemette on 1 Mar 2023
Edited: Luca Ferro on 1 Mar 2023
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 Comments
Guillemette
Guillemette on 1 Mar 2023
@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 on 1 Mar 2023
Edited: Luca Ferro on 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

Sign in to comment.

Answers (0)

Categories

Find more on Desktop in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!