Open SebiK91 opened 4 years ago
For certain problems, you may wish to use a modified inner product. For instance, sometimes data from finite element simulations are meant to approximate continuous functions, which means the inner product sum approximates an integral. In that case, you might want to weight each element of the sum by a differential volume dV, so that large elements in the simulation mesh get more weight. You might also have different weights if different elements of your data have different physical units (e.g. meters vs kilometers). If you have questions on this, let us know.
Thanks for the explanation. Unfortunately I can't even run the examples so I can't go on with more complex things...
1) I tried to run the examples of this website: https://modred.readthedocs.io/en/stable/tutorial_modaldecomp.html But as soon as I use the functions 'mr.compute_POD_matrices_snaps_method' and 'mr.compute_POD_matrices_direct_method' I get the following error: AttributeError: module 'modred' has no attribute 'mr.compute_POD_matrices_snaps_method' and AttributeError: module 'modred' has no attribute 'compute_POD_matrices_direct_method' respectively.
Do you know what the problem is? Other functions like 'mr.VecHandleArrayText' work very well so the installation of 'modred' should be ok.
2) Before I can start with ERA I need the Markovs from OKID. For this I tried Markovs = mr.okid.OKID(u, y, 3) with my Inputs u and Outputs y --> Inputs_Outputs.zip
But the following error occurs: File "C:\Users\qxo2456\Anaconda3\lib\site-packages\modred-2.0.4.post6-py3.7.egg\modred\okid.py", line 64, in OKID Markov_aug = np.linalg.lstsq(V.conj().T, outputs.T)[0].conj().T
File "<__array_function__ internals>", line 6, in lstsq
File "C:\Users\qxo2456\AppData\Roaming\Python\Python37\site-packages\numpy\linalg\linalg.py", line 2306, in lstsq x, resids, rank, s = gufunc(a, b, rcond, signature=signature, extobj=extobj)
TypeError: No loop matching the specified signature and casting was found for ufunc lstsq_n
Do you know what I am doing wrong here?
Thank you very much!
I think we forgot to update the documentation. Thanks for pointing that out!
mr.compute_POD_arrays_snaps_method
and mr.compute_POD_arrays_direct_method
. We changed "matrices" to "arrays" since we use numpy arrays and not matrices.As for your second question, I'm not sure about that one. I would check the value of V. Is it an array of the expected shape?
1) Ah, looks but still doesn't work unfortunately: Traceback (most recent call last):
File "
ValueError: too many values to unpack (expected 2)
2) I think I know what the problem is. My inputs and outputs are not two vectors but two matrices. Is this algorithm developed for a SISO- or a MIMO-system?
Regarding the examples, I realize now that the documentation on ReadTheDocs is for the last release. Since you had to build from source, you should also build the documentation locally. The instructions are in the README of the source code, but boils down to running sphinx-build doc doc/build
. Sorry again for this. We have fixed a lot of stuff but I haven't had time yet to put out the new release. I will try to get to that soon.
Regarding OKID, I see in the unittests that there are tests for SISO, SIMO, MISO, and MIMO cases. So I think it should work for MIMO. To be honest, OKID is not a method I know much about. @belson17, since this method is in your domain of expertise, do you have any thoughts?
I just released a new version of the code, so the documentation on ReadTheDocs should be up-to-date with respect to modred 2.1.0. Did you figure out your issue with MIMO inputs/outputs yet?
Hi everybody,
after installing the modred package I'd like to use it for a model order reduction. For this want to apply the Proper Orthogonal Decomposition (POD) and Eigensystem Realization Algorithm (ERA) on my dataset. This consists of an input (m x n) and an output matrix (n x p). Unfortunately I have a problem with the function variables:
1) According to the modred.pod-documentation I need a inner_product as an input for the calculation: https://modred.readthedocs.io/en/stable/pod.html. How do I get the inner_product from my dataset?
2) According to the modred.era-documentation I need a put_mat as an input for the calculation: https://modred.readthedocs.io/en/stable/era.html. How do I get the put_mat from my dataset? Where do I get the Markov parameters in the next step? As I understand the documentation the function expects it as an input but I don't know how to calculate it.
Thanks and regards Markus