how to control amplitude of step in code

조회 수: 175 (최근 30일)
RJS
RJS 2021년 12월 23일
답변: Star Strider 2022년 1월 4일
I have A B C D matrix
G7 =ss(A,K*B,C,D)
t = [0:0.001:5]';
[y, t, x] = step(feedback(G7,(Ka + 1/s)),t);
plot(t, x(:,3));
here K and Ka are control gains, in my actual plant angle is input to the system but when we perform step command that time it gives output response for one radian.............
.But I want step response for different amplitude ,How to do? ....

채택된 답변

Star Strider
Star Strider 2022년 1월 4일
Use stepDataOptions to create an options structure, and specifically the StepAmplitude option —
A = randn(3) % Create System
A = 3×3
-0.3929 -0.4093 -1.4841 -2.2959 -0.3964 -0.7033 0.7378 -2.0547 -1.0544
B = rand(3,1) % Create System
B = 3×1
0.7772 0.3109 0.7188
C = rand(1,3) % Create System
C = 1×3
0.0152 0.0333 0.6986
D = 0; % Create System
K = rand % Create System
K = 0.6582
Ka = rand % Create System
Ka = 0.9986
s = tf('s');
G7 =ss(A,K*B,C,D)
G7 = A = x1 x2 x3 x1 -0.3929 -0.4093 -1.484 x2 -2.296 -0.3964 -0.7033 x3 0.7378 -2.055 -1.054 B = u1 x1 0.5115 x2 0.2046 x3 0.4731 C = x1 x2 x3 y1 0.0152 0.03335 0.6986 D = u1 y1 0 Continuous-time state-space model.
t = [0:0.001:5]';
opts = stepDataOptions('StepAmplitude',5)
opts =
step with properties: InputOffset: 0 StepAmplitude: 5
[y, t, x] = step(feedback(G7,(Ka + 1/s)),t, opts);
plot(t, x(:,3));
.

추가 답변 (1개)

Mathieu NOE
Mathieu NOE 2022년 1월 4일
hello
simply multiply the result of the (normalized) step (input amplitude = 1) by the actual / desired input amplitude
input_amplitude = 0.3; % your value here
G7 =ss(A,K*B,C,D);
t = [0:0.001:5]';
[y, t, x] = step(feedback(G7,(Ka + 1/s)),t);
plot(t, input_amplitude*x(:,3));
  댓글 수: 1
Mathieu NOE
Mathieu NOE 2022년 1월 4일
you can do this as soon as the system is linear in (amplitude ) response (LTI systems for example)

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

카테고리

Help CenterFile Exchange에서 Linear Model Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by