필터 지우기
필터 지우기

Error message: Index exceeds the number of array elements. Index must not exceed 1. When I use trim function

조회 수: 9 (최근 30일)
% Define the trim condition
Y0 = 2500; % RPM
X0 = [2500; 0; 0; 0]; % Initial guess for the state vector
U0 = 0; % Input value for trimming
% Perform the trimming
[X0, U0] = trim(model,X0,U0,[],[],Y0);
Unrecognized function or variable 'model'.
The above is my code. Unfortunately, I can't provide the model. The Simulink Model have one input and Three output. But two of three output connects to the Terminator Block.
  댓글 수: 3
Changyu
Changyu 2023년 10월 25일
After I run this. C:\Program Files\MATLAB\R2023a\toolbox\simulink\core\general\trim.p
Is .p means this file is a variable?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2023년 10월 25일
According to trim y0 must be immediately after u0
  댓글 수: 3
Walter Roberson
Walter Roberson 2023년 10월 25일
[x,u,y,dx] = trim('sys',x0,u0,y0,ix,iu,iy) finds the trim point closest to x0, u0, y0 that satisfies a specified set of state, input, and/or output conditions. The integer vectors ix, iu, and iy select the values in x0, u0, and y0 that must be satisfied.
You are passing Y0 in the iy position, and Y0 = 2500 in your code. That tells trim() that the 2500'th y0 value must be satisfied. But you only have one y0 value, which is the scalar Y0.
The iy is an index not a value .
You should probably just be using
[X0, U0] = trim(model,X0,U0,Y0);
Changyu
Changyu 2023년 10월 25일
Warning: Rank deficient, rank = 1, tol = 1.332268e-15.
> In qpsub
In nlconst
In simcnstr
In trim
In trim
Maximum number of function evaluations exceeded;
increase OPTIONS(14)
It doesn't work. I can't understand the error message.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by