- #1
Maxzchea
- 3
- 0
I personally inform that i still beginner in Comsol Script. I wanted to learn about the comsol, how to simulate the graph. I tried plot(x,y). but i need to use this function simulate(Ss1,(U1,U2)). But at the end, it show Syntax error.
Heres the details of the code:
Ks = 600000; %spring stiffness of the car
M = 1200; %mass of the car
KST = 15000000; % New value for spring stiffness
MH = 48; % Constant value of the car.
A = [0 1 0 0 ; (-Ks+KST)/MH -Kv/MH -Ks/MH Kv/MH; 0 0 0 1; Ks/M Kv/M -Ks/M -Kv/M];
B= [0 0; KST/MH -1/MH; 0 0; 0 1/M];
C = [1 0 0 0; 0 0 1 0; 0 1 0 0; 0 0 0 1];
D = [0 0; 0 0; 0 0; 0 0];
Ss1 = ss(A, B, C, D);
T = [0:0.01:10]';
S1 = zeros(size(T));
S2 = 3000*ones(size(T));
U1 = sig(S1, T);
U2 = sig(S2, T);
simulate(Ss1,(U1, U2))
From the beginning, i type all the code together. can when it comes to U1=sig(S1,T);
it shows Error: SIG constructor: Length of t must equal number of rows in y
sig.sig 96 error('SIG constructor: Length of t must equal number of rows in y')
until the end i couldn't get the graph. How can i get the graph done? how to modify the sig code? i have no idea. i tried many times already. those who know. please take a look. Help me please. Thx in advance
Heres the details of the code:
Ks = 600000; %spring stiffness of the car
M = 1200; %mass of the car
KST = 15000000; % New value for spring stiffness
MH = 48; % Constant value of the car.
A = [0 1 0 0 ; (-Ks+KST)/MH -Kv/MH -Ks/MH Kv/MH; 0 0 0 1; Ks/M Kv/M -Ks/M -Kv/M];
B= [0 0; KST/MH -1/MH; 0 0; 0 1/M];
C = [1 0 0 0; 0 0 1 0; 0 1 0 0; 0 0 0 1];
D = [0 0; 0 0; 0 0; 0 0];
Ss1 = ss(A, B, C, D);
T = [0:0.01:10]';
S1 = zeros(size(T));
S2 = 3000*ones(size(T));
U1 = sig(S1, T);
U2 = sig(S2, T);
simulate(Ss1,(U1, U2))
From the beginning, i type all the code together. can when it comes to U1=sig(S1,T);
it shows Error: SIG constructor: Length of t must equal number of rows in y
sig.sig 96 error('SIG constructor: Length of t must equal number of rows in y')
until the end i couldn't get the graph. How can i get the graph done? how to modify the sig code? i have no idea. i tried many times already. those who know. please take a look. Help me please. Thx in advance