Giter Site home page Giter Site logo

danielmartensson / mataveid Goto Github PK

View Code? Open in Web Editor NEW
76.0 11.0 25.0 41.27 MB

System identification toolbox for GNU Octave and MATLAB

License: MIT License

MATLAB 100.00%
subspace-identification identification-toolbox matlab gnu-octave systemidentification realization identification eigensystem-realization-algorithm

mataveid's People

Contributors

danielmartensson avatar jasonnicholson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mataveid's Issues

Ask question

Dear professor, It's generous of you to share this project . But I have a question that what is the specific value of input(u) in README.md, such as command lsim(G, u, t). I'm a beginner, it's a little diffcult for me to guess the value of u. Can you upload a more detailed version of 'Typical use' at your convenience or just tell me the value of u?

OCID Not MATLAB Compatible

Similar to #DanielMartensson/MataveControl#4, ocid.m is not MATLAB compatible.

image

Multiple variables can be defined without coma or semicolon and multiple equal signed in OCTAVE but this is not allowed in MATLAB.

Change from:
image

To:
image

I am working on a pull request to fix some these issues.

Some question

Thank you for your open source, but there are some problems in running the example code:ss function
help ss
ss - Create state-space model, convert to state-space model

This MATLAB function creates a state-space model object representing the
continuous-time state-space model
sys = ss(A,B,C,D)

another problem is missing raw data

A question about OKID in practice

Dear Professor,
Thanks for your sharing your codes. I have a problem when I use OKID in practice.

Here is the problem:
error: svd: cannot take SVD of matrix containing Inf or NaN values
error: called from
okid >eradcokid at line 200 column 11
okid at line 142 column 13
OKID_motor at line 24 column 11

The reason is the following function has no output.
Ybar = y_part*inv(V'V + regularizationeye(size(V'*V)))*V';

Here is the output on terminal
Ybar =
Columns 1 through 37:
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
Columns 38 through 74:
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
...
...
...

How should I fix this problem?
Thanks again.
Regards

Mataveid with Octave

I have just tried to execute the RLS example under Octave 5.2.0. I get the following error:
error

Attribute "sampleTime" is not known in Octave transfer function object. When I code Gd.tsam = sampleTime in rls.m the next error occurs.
To me it seems like the code is not really usable with Octave although the first sentence in the description suggests so...

Sindy example not working in MATLAB

The Sindy example in MATLAB is not working.

I modified the code of the example only slightly so that some indexing issues don't stop MATLAB. Instead, we end up erroring out at line 159. See stack trace below. The code completes in Octave.

image

clc; clear; close all;


% Load CSV data
X = csvread('..\data\MotorRotation.csv'); % Can be found in the folder "data"
t = X(:, 1);
u = X(:, 2);
y = X(:, 3);
sampleTime = 0.02;

% Do filtering of y
y = filtfilt2(y', t', 0.1)';

% Sindy - Sparce identification Dynamics
activations = [1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; % Enable or disable the candidate functions such as sin(u), x^2, sqrt(y) etc...
lambda = 0.05;
l = length(u);
h = floor(l/2);
s = ceil(l/2);
fx_up = sindy(u(1:h), y(1:h), activations, lambda, sampleTime); % We go up
fx_down = sindy(u(s:end), y(s:end), activations, lambda, sampleTime); % We go down

% Simulation up
x0 = y(1);
u_up = u(1:h);
u_up = u_up(1:100:end)';
stepTime = 1.2;
[x_up, t] = nlsim(fx_up, u_up, x0, stepTime, 'ode15s');

% Simulation down 
x0 = y(s);
u_down = u(s:end)
u_down = u_down(1:100:end)';
stepTime = 1.2;
[x_down, t] = nlsim(fx_down, u_down, x0, stepTime, 'ode15s');

% Compare 
figure
plot([x_up x_down])
hold on 
plot(y(1:100:end));
legend('Simulation', 'Measurement')
ylabel('Rotation')
xlabel('Time')
grid on

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.