How to simulate a graph in Comsol Script?

  • Thread starter Thread starter Maxzchea
  • Start date Start date
  • Tags Tags
    Comsol Graph
AI Thread Summary
The discussion revolves around a user's struggle to simulate a graph in Comsol Script, particularly encountering a syntax error with the simulate function. The user has provided a code snippet involving system matrices and signal generation but faces an issue with the SIG constructor, indicating a mismatch in dimensions between time and signal arrays. Suggestions include checking pointwise and matrix operations to ensure compatibility of dimensions. The user seeks assistance in modifying the SIG code to resolve the errors and successfully generate the graph. Clarification on these coding issues is essential for effective simulation in Comsol.
Maxzchea
Messages
2
Reaction score
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
 
Engineering news on Phys.org
Have you checked you've your pointwise and matrix acting operators (* & .*) in order & dimensions of different elements going about ok?
 
Hi all, I have a question. So from the derivation of the Isentropic process relationship PV^gamma = constant, there is a step dW = PdV, which can only be said for quasi-equilibrium (or reversible) processes. As such I believe PV^gamma = constant (and the family of equations) should not be applicable to just adiabatic processes? Ie, it should be applicable only for adiabatic + reversible = isentropic processes? However, I've seen couple of online notes/books, and...
Thread 'How can I find the cleanout for my building drain?'
I am a long distance truck driver, but I recently completed a plumbing program with Stratford Career Institute. In the chapter of my textbook Repairing DWV Systems, the author says that if there is a clog in the building drain, one can clear out the clog by using a snake augur or maybe some other type of tool into the cleanout for the building drain. The author said that the cleanout for the building drain is usually near the stack. I live in a duplex townhouse. Just out of curiosity, I...
Back
Top