Risposto
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...

oltre 5 anni fa | 0

Risposto
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 ...

oltre 5 anni fa | 0

Risposto
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...

oltre 5 anni fa | 0

| accettato

Risposto
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...

oltre 5 anni fa | 1

| accettato

Risposto
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...

oltre 5 anni fa | 0

| accettato

Risposto
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 ...

oltre 5 anni fa | 0

Risposto
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)

oltre 5 anni fa | 1

| accettato

Risposto
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...

oltre 5 anni fa | 2

| accettato

Risposto
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...

oltre 5 anni fa | 0

Domanda


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;...

oltre 5 anni fa | 2 risposte | 0

2

risposte

Risposto
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...

oltre 5 anni fa | 0

| accettato

Risposto
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...

oltre 5 anni fa | 0

Risposto
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 ...

oltre 5 anni fa | 0

Risposto
[DISCONTINUED] 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...

oltre 5 anni fa | 1

Risposto
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...

oltre 5 anni fa | 1

Risposto
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...

oltre 5 anni fa | 0

| accettato

Risposto
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...

oltre 5 anni fa | 0

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

oltre 5 anni fa | 0

Risposto
MATLAB can't compute a closed-loop final-value theorem on a controller.
Is that feedback gain matrix correct? Note that here I'm using K, but the code above used k1 and k2, which were not defined. Ph...

oltre 5 anni fa | 0

| accettato

Risposto
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,[]),...

oltre 5 anni fa | 0

Risposto
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...

oltre 5 anni fa | 0

| accettato

Risposto
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.

oltre 5 anni fa | 0

Risposto
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...

oltre 5 anni fa | 0

Risposto
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...

oltre 5 anni fa | 0

Risposto
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...

oltre 5 anni fa | 0

| accettato

Risposto
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...

oltre 5 anni fa | 1

Risposto
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...

oltre 5 anni fa | 0

| accettato

Risposto
numerical curl vs symbolic curl
In addition to fixing the meshgrid per the comment above ... The eigenvectors Uk are normalized differently between the symboli...

oltre 5 anni fa | 0

Risposto
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...

oltre 5 anni fa | 0

| accettato

Risposto
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 = [ ...

oltre 5 anni fa | 0

| accettato

Carica altro