Answered

conversion between state space and transfer function

An infinite number of state space realizations correspond to a single transfer function. From a transfer function, the Control S...

conversion between state space and transfer function

An infinite number of state space realizations correspond to a single transfer function. From a transfer function, the Control S...

20 hours ago | 1

| accepted

Answered

Feedback command for MIMO systems in MATLAB

I think this does what you want (assuming negative feedback) Pitch_State = STATE_SPACE_MODEL({'x';'Theta'},'Pitch Torque') PIT...

Feedback command for MIMO systems in MATLAB

I think this does what you want (assuming negative feedback) Pitch_State = STATE_SPACE_MODEL({'x';'Theta'},'Pitch Torque') PIT...

1 day ago | 0

| accepted

Answered

Can I define the initial condition at a nonzero point using Simulink integator?

Look at using the Start Time parameter on the Solver Pane (link). As best I can tell, it will do exactly what you want; initial...

Can I define the initial condition at a nonzero point using Simulink integator?

Look at using the Start Time parameter on the Solver Pane (link). As best I can tell, it will do exactly what you want; initial...

3 days ago | 0

Answered

Fast Fourier Transform Zero Padding

Try changing these lines: L = length(O2_exp); Y = fft(O2_exp); to L = nfft; % select nfft > numel(O2_e...

Fast Fourier Transform Zero Padding

Try changing these lines: L = length(O2_exp); Y = fft(O2_exp); to L = nfft; % select nfft > numel(O2_e...

4 days ago | 0

| accepted

Answered

Simulink control with moving average

A difference equation of the form y(k)=(c0*u(k)+c1*u(k-1)+c2*u(k-2)+c3*u(k-4)+c4*u(k-4))/D can be implemeted with one of the b...

Simulink control with moving average

A difference equation of the form y(k)=(c0*u(k)+c1*u(k-1)+c2*u(k-2)+c3*u(k-4)+c4*u(k-4))/D can be implemeted with one of the b...

6 days ago | 0

| accepted

Answered

State Space with Disturbance

Combine d and u into a single input vector: Xdot = A*X + [B F] * [u;d] y = C*X + [D 0]*[u:d] % assuming the disurbance doesn'...

State Space with Disturbance

Combine d and u into a single input vector: Xdot = A*X + [B F] * [u;d] y = C*X + [D 0]*[u:d] % assuming the disurbance doesn'...

6 days ago | 0

Question

Why Would fplot(f) and fplot(vpa(f)) Show Different Results?

I'm seeing different results between fplot for a symfun object, the fplot of the vpa form of that object, and the regular old pl...

8 days ago | 1 answer | 0

Answered

How do you do Unity Feedback on Matlab? (Transfer Functions)

Check the doc page for feedback() doc feedback In this case, the feedback line isn't "empty," it has a gain of 1 (or if you pr...

How do you do Unity Feedback on Matlab? (Transfer Functions)

Check the doc page for feedback() doc feedback In this case, the feedback line isn't "empty," it has a gain of 1 (or if you pr...

11 days ago | 0

Answered

Illustration of Frequency Response (magnitude and phase response)

if you wnat to plot them yourself, then use plot(), or semilogx() or whatever plotting function meets your needs. Or you can de...

Illustration of Frequency Response (magnitude and phase response)

if you wnat to plot them yourself, then use plot(), or semilogx() or whatever plotting function meets your needs. Or you can de...

17 days ago | 0

Question

Peculiar Result with Solve (Symbolic Math Toolbox) with Three Equations and Three Unknowns. Can Anyone Explain?

Suppose I have three equations and three unknowns as so: >> syms X1 X2 X3 real >> e1 = X1/(X1 + X2 + X3) == 0.1; >> e2 = X2/(...

18 days ago | 1 answer | 0

Answered

Generation of Conditional Random Variables

Based on this comment, the problem is as follows: Let Xi be a set of independent, continuous random variables, i = 1-n. Let wi...

Generation of Conditional Random Variables

Based on this comment, the problem is as follows: Let Xi be a set of independent, continuous random variables, i = 1-n. Let wi...

19 days ago | 1

Answered

How do I stop a signal after a fixed time and let the simulation continue?

Use a Switch block: https://www.mathworks.com/help/simulink/slref/switch.html

How do I stop a signal after a fixed time and let the simulation continue?

Use a Switch block: https://www.mathworks.com/help/simulink/slref/switch.html

23 days ago | 1

| accepted

Answered

Model Linearisation - Open Loop Input and Input Pertubation has the same input values ?

The linear analysis points (Input Perturbation, etc.) only apply for linearizing the model. They don't have any impact when runn...

Model Linearisation - Open Loop Input and Input Pertubation has the same input values ?

The linear analysis points (Input Perturbation, etc.) only apply for linearizing the model. They don't have any impact when runn...

23 days ago | 0

Answered

How to obtain Real and Imaginary parts of symbolic polynomial

From the context of the code, it appear that w is a real number. Assuming it being so will help: >> syms s syms w real poly...

How to obtain Real and Imaginary parts of symbolic polynomial

From the context of the code, it appear that w is a real number. Assuming it being so will help: >> syms s syms w real poly...

25 days ago | 0

| accepted

Answered

fft of Rectangle*sin function in MATLAB

It appears that you want to find the Continuous Time Fourier Transform of a windowed cos wave, where the window covers an intege...

fft of Rectangle*sin function in MATLAB

It appears that you want to find the Continuous Time Fourier Transform of a windowed cos wave, where the window covers an intege...

26 days ago | 0

| accepted

Answered

Error when using find function

Maybe you want to start with ismember? doc ismember

Error when using find function

Maybe you want to start with ismember? doc ismember

26 days ago | 0

Answered

how to use ss and lsim for 1 dof differential equation

That lsim command calculates y using default initial conditions x(0) = xdot(0) = 0, but the analytical solution clearly doesn'...

how to use ss and lsim for 1 dof differential equation

That lsim command calculates y using default initial conditions x(0) = xdot(0) = 0, but the analytical solution clearly doesn'...

26 days ago | 0

| accepted

Question

Given One Partition of a Matrix, What is the Best Way to Find a Second Partition that Ensures the Matrix is Nonsingular?

Suppose I have a matrix C, dimension m x n, m < n, and that rank(C) = m. I wish to find a marix V, dimension n-m x n, such that...

27 days ago | 3 answers | 0

Answered

Lsim gives NaN for square input

Look at the eigenvalues of the plant matrix: >> eig(sys) ans = -6.846331220081878e+07 -5.237359879589575e+07 ...

Lsim gives NaN for square input

Look at the eigenvalues of the plant matrix: >> eig(sys) ans = -6.846331220081878e+07 -5.237359879589575e+07 ...

28 days ago | 0

| accepted

Answered

Invalid use of operator in for loop

You're geting the error because that's the wrong syntax for a for loop: doc for Having said that, it kind of looks like you re...

Invalid use of operator in for loop

You're geting the error because that's the wrong syntax for a for loop: doc for Having said that, it kind of looks like you re...

1 month ago | 1

Answered

How do I find the LTI system using deconv, when it is connected to more systems and with the final impulse response?

I think heaviside is function from the Symbolic Math Toolbox, but I don't see any symbolic variables defined. In any case, perha...

How do I find the LTI system using deconv, when it is connected to more systems and with the final impulse response?

I think heaviside is function from the Symbolic Math Toolbox, but I don't see any symbolic variables defined. In any case, perha...

1 month ago | 0

Answered

Simulink Difference Equation Implementation

Maybe this example will help, which essentially illustrates the comment made by Alvery. Consider a plant P(s) = 1/(s + 5) that ...

Simulink Difference Equation Implementation

Maybe this example will help, which essentially illustrates the comment made by Alvery. Consider a plant P(s) = 1/(s + 5) that ...

1 month ago | 0

| accepted

Answered

Simulink with control system designer: Step response is completely flat.

The block diagram has an Open-loop Input at the input to the plant (on the line marked "u + d") so the response from any input t...

Simulink with control system designer: Step response is completely flat.

The block diagram has an Open-loop Input at the input to the plant (on the line marked "u + d") so the response from any input t...

1 month ago | 1

| accepted

Answered

How to chose one form of transfer function from other forms

You don't need to get the num and den explicitly using tfdata (unless you need them for some reason). To convert from ss to tf: ...

How to chose one form of transfer function from other forms

You don't need to get the num and den explicitly using tfdata (unless you need them for some reason). To convert from ss to tf: ...

1 month ago | 1

Answered

Error using acker System must be single input.How can I solve this problem ?

Try using the place command: doc place

Error using acker System must be single input.How can I solve this problem ?

Try using the place command: doc place

1 month ago | 0

Question

Why is extractFileText Much Slower than fileread for Text Files?

I'm fine with using fileread, but am curious why extractFileText is so much slower: >> tic,for i=1:500,s1=extractFileText('sonn...

1 month ago | 1 answer | 0

Answered

Can I do this using matlab or simulink?

It looks like the Simulink model is that of a linear time invariant (LTI) system. If that is the case one can use linmod to get ...

Can I do this using matlab or simulink?

It looks like the Simulink model is that of a linear time invariant (LTI) system. If that is the case one can use linmod to get ...

1 month ago | 0

Answered

Rearrange state space system

Let's assume that the state space model from Simulink is defined as: xdot = A*x + B*u [y1;y2] = [C1; C2] * x + [0;D2] u where...

Rearrange state space system

Let's assume that the state space model from Simulink is defined as: xdot = A*x + B*u [y1;y2] = [C1; C2] * x + [0;D2] u where...

1 month ago | 0

| accepted

Answered

Why can't I get the same plot as the official tutorial video? (non-minimal phase system)

I get the same Bode plots. What's different about yours? Also, you can do this with one Bode command bode(G,G_RHP_zero,G_delay...

Why can't I get the same plot as the official tutorial video? (non-minimal phase system)

I get the same Bode plots. What's different about yours? Also, you can do this with one Bode command bode(G,G_RHP_zero,G_delay...

1 month ago | 1

| accepted

Answered

Using Lsim to solve a dynamic control model.

It sounds like wf1 and wf2 are supposed to be step inputs at t = 1 and t = 5. In Simulink these were implemented with Step block...

Using Lsim to solve a dynamic control model.

It sounds like wf1 and wf2 are supposed to be step inputs at t = 1 and t = 5. In Simulink these were implemented with Step block...

2 months ago | 0