Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error to use update: TypeError: A.multiply is not a function #1

Closed
alexz18 opened this issue Apr 19, 2019 · 2 comments
Closed

Error to use update: TypeError: A.multiply is not a function #1

alexz18 opened this issue Apr 19, 2019 · 2 comments

Comments

@alexz18
Copy link

alexz18 commented Apr 19, 2019

I've got installed the kalman library through the NPM and try to start my code:

var kalman = require('kalman');
var math = require('mathjs');

let valx = [ 4, 5 ];
let valp = math.matrix([[ 5, 0 ], [ 0, 4 ]]);

var valr = [];
var vala = math.matrix([[ 5, 0 ], [ 0, 4 ]]);
valr['A'] = vala;

let kf = new kalman.KF(valx, valp);

kf.update(valr);

After start found the error:
Wondering what's wrong, thanks.


kalman.js:75
var xhat = A.multiply(x).add(B.multiply(u));
^

TypeError: A.multiply is not a function
at KF.update (...kalman.js:75:18)
at Object. (...index2.js:21:4)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3

@infusion
Copy link
Owner

As stated in the docs, Kalman.js is meant to work with lina libaries that feature a syntax similar to the one of Sylvester.js. The syntax of math.js differs too much, as it uses static function calls instead of member methods. But porting the library should be trivial.

@alexz18
Copy link
Author

alexz18 commented Apr 23, 2019

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants