Answered

Empty linear analysis workspace after linearising model

linsys1 isn't empty. It's a static gain of zero. Double click the Derivative block. If the Parameter ("Coefficient c ....") i...

Empty linear analysis workspace after linearising model

linsys1 isn't empty. It's a static gain of zero. Double click the Derivative block. If the Parameter ("Coefficient c ....") i...

3 days ago | 0

Answered

Euler's method code

The code that is posted solves a differential equation of the form y'(x) = f(x,y), y(0) = y0 and compares it to the exact solu...

Euler's method code

The code that is posted solves a differential equation of the form y'(x) = f(x,y), y(0) = y0 and compares it to the exact solu...

3 days ago | 0

Answered

Finding curve length of vector r(t)=<2t, t^2, 1/3t^3> Given0<=t<=1

It looks like the equation for "magnitude" is incorrect Why is magnitude the sqrt of the sum of the squares of each individual ...

Finding curve length of vector r(t)=<2t, t^2, 1/3t^3> Given0<=t<=1

It looks like the equation for "magnitude" is incorrect Why is magnitude the sqrt of the sum of the squares of each individual ...

4 days ago | 0

Answered

How to explicit a matlab equation by using the symbolic toolbox?

Looks like there are two solutions for V based on reasonable assumptions: syms rho V CD0 K W S T positive syms gamma real eqn...

How to explicit a matlab equation by using the symbolic toolbox?

Looks like there are two solutions for V based on reasonable assumptions: syms rho V CD0 K W S T positive syms gamma real eqn...

5 days ago | 0

| accepted

Answered

diff function rearranges symbolic expression leading to non-vanishing terms

Why not just use collect() and coeffs() on the elements of dxdt? If the system is affine in u, then those should give the desir...

diff function rearranges symbolic expression leading to non-vanishing terms

Why not just use collect() and coeffs() on the elements of dxdt? If the system is affine in u, then those should give the desir...

5 days ago | 1

| accepted

Answered

DC gain discrete-time transfer function error

I think the problem is just inaccuracy of the numerical computation of the freuqency response at very small frequencies. Keep i...

DC gain discrete-time transfer function error

I think the problem is just inaccuracy of the numerical computation of the freuqency response at very small frequencies. Keep i...

6 days ago | 0

| accepted

Answered

Roots of a polynomial with variables

Don't know the scope of the actual problems of interest, but for the two examples in the question: syms x y sol = solve(3*x*y ...

Roots of a polynomial with variables

Don't know the scope of the actual problems of interest, but for the two examples in the question: syms x y sol = solve(3*x*y ...

6 days ago | 0

Answered

Boundary Value Problem\ Symbolic solution

Need to use sym(pi) syms y(t) cond = [y(0)==0,y(1)==0]; X = dsolve(diff(y,t,2)+sym(pi)^2*y==0,cond)

Boundary Value Problem\ Symbolic solution

Need to use sym(pi) syms y(t) cond = [y(0)==0,y(1)==0]; X = dsolve(diff(y,t,2)+sym(pi)^2*y==0,cond)

7 days ago | 1

| accepted

Answered

Heun's method stiff ODE

Correct implementation of Heun's method, as I understand it, is given below and compare to the analytic solution and other equat...

Heun's method stiff ODE

Correct implementation of Heun's method, as I understand it, is given below and compare to the analytic solution and other equat...

7 days ago | 2

| accepted

Answered

How to solve a system of second order nonlinear differential equations with boundary conditions

I was not able to solve the problem for the boundary conditions specified at t=2. But I was able to get a resonable looking sol...

How to solve a system of second order nonlinear differential equations with boundary conditions

I was not able to solve the problem for the boundary conditions specified at t=2. But I was able to get a resonable looking sol...

8 days ago | 0

Question

What is the Best Way to Deal with an Empty Line Object?

Suppose I have some data: x = 1:10; y = 1:10; Now I want to plot three lines based on three logical index vectors. i1 = x<=3;...

9 days ago | 2 answers | 0

Answered

Strange form of increasing when derivating sine waves

I think you're seeing the effect of the discrete time step combined with numerical approximations to the differentiation and the...

Strange form of increasing when derivating sine waves

I think you're seeing the effect of the discrete time step combined with numerical approximations to the differentiation and the...

11 days ago | 0

| accepted

Answered

Using ODE1 in Simulink yields different results for an equivalent model run in a for loop

I think some of the equations are out of order. I got a match (obviously using my inputs) with this: h = Ts; %sample period q...

Using ODE1 in Simulink yields different results for an equivalent model run in a for loop

I think some of the equations are out of order. I got a match (obviously using my inputs) with this: h = Ts; %sample period q...

12 days ago | 0

Answered

How to make state space for two or more inputs with same number of state variables

Without seeing the code that constructs the model, it's unclear if the desired end state is even achievable. You can always try ...

How to make state space for two or more inputs with same number of state variables

Without seeing the code that constructs the model, it's unclear if the desired end state is even achievable. You can always try ...

12 days ago | 0

Answered

MATLAB Answers Wish-list #5 (and bug reports)

After I click the "Follow" link on a question, I'd like that question to show up in my Managed Followed Content list immediately...

MATLAB Answers Wish-list #5 (and bug reports)

After I click the "Follow" link on a question, I'd like that question to show up in my Managed Followed Content list immediately...

13 days ago | 1

Answered

How were the matrices for A G and C derived in this answer

The matrices are not developed by linearizing and then discretizing the nonlinear differential equation. The doc says that they...

How were the matrices for A G and C derived in this answer

The matrices are not developed by linearizing and then discretizing the nonlinear differential equation. The doc says that they...

15 days ago | 1

Answered

How to get rid of sign() in diff() results?

If the goal is to get an expression for the amplitude of the frequency response of H(s) and then differentiate ... syms R1 R2 C...

How to get rid of sign() in diff() results?

If the goal is to get an expression for the amplitude of the frequency response of H(s) and then differentiate ... syms R1 R2 C...

15 days ago | 0

| accepted

Answered

zero frequency amplitude issue at fft

In the third plot, the data tip is not at X = 0 (as is the case with the first two plots). Try zooming in and picking the actua...

zero frequency amplitude issue at fft

In the third plot, the data tip is not at X = 0 (as is the case with the first two plots). Try zooming in and picking the actua...

15 days ago | 0

Answered

Difference between eigs and svds

eigs returns eigenvalues and eigenvectors. svds resturns singular valuese and singular vectors. Why would there be an expectat...

Difference between eigs and svds

eigs returns eigenvalues and eigenvectors. svds resturns singular valuese and singular vectors. Why would there be an expectat...

15 days ago | 0

Answered

Element by element multiplication of a matrix

For the matrix exponential: % example data H = [1 2;3 4]; t = 0:5; f = cell2mat(cellfun(@expm,mat2cell(H.*reshape(t,1,1,[]),...

Element by element multiplication of a matrix

For the matrix exponential: % example data H = [1 2;3 4]; t = 0:5; f = cell2mat(cellfun(@expm,mat2cell(H.*reshape(t,1,1,[]),...

17 days ago | 0

Answered

a problem with pade approximation

tf objects have three delay properties: InputDelay, OutputDelay, and IODelay. Look at all three of these properties for each ele...

a problem with pade approximation

tf objects have three delay properties: InputDelay, OutputDelay, and IODelay. Look at all three of these properties for each ele...

18 days ago | 0

| accepted

Answered

Demux and State Space Dimension errors

If the output of the State Space block has four elements, then set the "Number of outputs" parameter of the Demux block to 4.

Demux and State Space Dimension errors

If the output of the State Space block has four elements, then set the "Number of outputs" parameter of the Demux block to 4.

20 days ago | 0

Answered

Plotting lsim directly results in different plot when writing to variables first

plot() is a general purpose plotting function and has no way of knowing that the inputs to be plotted represent sample times and...

Plotting lsim directly results in different plot when writing to variables first

plot() is a general purpose plotting function and has no way of knowing that the inputs to be plotted represent sample times and...

20 days ago | 0

Answered

Area between two curves without intersection

I think this is what you're looking for: x=[0,-1.66128688049154,-3.71843384492024,-6.03903044153544,-8.52179344691878,-11.06847...

Area between two curves without intersection

I think this is what you're looking for: x=[0,-1.66128688049154,-3.71843384492024,-6.03903044153544,-8.52179344691878,-11.06847...

21 days ago | 0

Answered

Conflicting Simulink mdoels - transfer function

The block diagrams don't represent the same system. The easiest way to see this is that the loop transfer functions are differen...

Conflicting Simulink mdoels - transfer function

The block diagrams don't represent the same system. The easiest way to see this is that the loop transfer functions are differen...

24 days ago | 0

| accepted

Answered

Multivariate normal random numbers vs. random numbers from normal distribution

I'm not quite sure what you did to create y, since the code generates y as a single column. It looks like y was produced by: m...

Multivariate normal random numbers vs. random numbers from normal distribution

I'm not quite sure what you did to create y, since the code generates y as a single column. It looks like y was produced by: m...

24 days ago | 1

Answered

generating wrong Nyquist plot of tf

Keep in mind that nyquist() doesn't draw the arc at infinity due to the double pole at the origin. If you zoom in around the or...

generating wrong Nyquist plot of tf

Keep in mind that nyquist() doesn't draw the arc at infinity due to the double pole at the origin. If you zoom in around the or...

24 days ago | 0

| accepted

Answered

numerical curl vs symbolic curl

In addition to fixing the meshgrid per the comment above ... The eigenvectors Uk are normalized differently between the symboli...

numerical curl vs symbolic curl

In addition to fixing the meshgrid per the comment above ... The eigenvectors Uk are normalized differently between the symboli...

25 days ago | 0

Answered

How can I exchange sqrt(-1) with 1i

I thought that all that would be needed is to assume that g is positive: syms g positive sqrt(-g) Alas, this approach doesn't...

How can I exchange sqrt(-1) with 1i

I thought that all that would be needed is to assume that g is positive: syms g positive sqrt(-g) Alas, this approach doesn't...

27 days ago | 0

| accepted

Answered

Sorting complex array with cplxpair and how to get the sort index?

ismember() might be what you're looking for. Do you care about how this works if the elements of k are not all unique? k = [ ...

Sorting complex array with cplxpair and how to get the sort index?

ismember() might be what you're looking for. Do you care about how this works if the elements of k are not all unique? k = [ ...

27 days ago | 0

| accepted