{"id":28751954,"url":"https://github.com/ethanjameslew/koopmania","last_synced_at":"2025-06-16T23:07:42.206Z","repository":{"id":43403341,"uuid":"418984560","full_name":"EthanJamesLew/koopmania","owner":"EthanJamesLew","description":"a little library to help me with things involving Koopman operators","archived":false,"fork":false,"pushed_at":"2022-03-03T06:06:47.000Z","size":172,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-03-04T05:23:33.318Z","etag":null,"topics":["data-driven-model","dmd","dynamic-mode-decomposition","dynamical-systems","kernel-methods","koopman","koopman-operators"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EthanJamesLew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-19T15:31:09.000Z","updated_at":"2022-12-08T22:19:39.000Z","dependencies_parsed_at":"2022-08-26T21:41:38.348Z","dependency_job_id":null,"html_url":"https://github.com/EthanJamesLew/koopmania","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/EthanJamesLew/koopmania","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EthanJamesLew%2Fkoopmania","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EthanJamesLew%2Fkoopmania/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EthanJamesLew%2Fkoopmania/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EthanJamesLew%2Fkoopmania/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EthanJamesLew","download_url":"https://codeload.github.com/EthanJamesLew/koopmania/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EthanJamesLew%2Fkoopmania/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260256257,"owners_count":22981807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-driven-model","dmd","dynamic-mode-decomposition","dynamical-systems","kernel-methods","koopman","koopman-operators"],"created_at":"2025-06-16T23:07:35.981Z","updated_at":"2025-06-16T23:07:42.184Z","avatar_url":"https://github.com/EthanJamesLew.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Koopmania: Library for Koopman Operator Based Data-Driven Analysis\n\n![system estimation](./documentation/estimation.svg)\n\nThis is a (work in progress) little library to help me with research involving Koopman\noperators. It features\n* Estimators - scikit-like estimators to fit systems from data. These can be\ncontinuous or discrete time systems.\n* Observables - a way of creating Koopman observables easily. These can be\nspecified symbolically or numerically.\n\n## Example Usage\n\n### Create Systems\n\nCreate systems from symbolic equations\n\n```python\nimport koopmania as km\nimport sympy as sp\n\n\n# van der pol model\nx0, x1 = sp.symbols('x0 x1')\nxdot = [x1, (1 - x0**2) * x1 - x0]\n\nmy_system = km.SymbolicContinuousSystem((x0, x1), xdot)\n```\n\n### Create Observables\n\n```python\nimport koopmania as km\nimport sympy as sp\n\n\n# create observables from symbolic expressions\nx0, x1 = sp.symbols('x0 x1')\nobservable_map = [sp.cos(0.5*x0 + 0.2*x1), sp.sin(x1)]\nmy_obs = km.SymbolicObservable((x0, x1), observable_map)\n\n# use existing observables\nq_obs = km.QuadraticObservable(2)\n\n# combine observables together\nobs = my_obs | q_obs\n```\n\n### Learn Systems from Data\n\n```python\nimport koopmania as km\n\n\n# learn a system from trajectory data X, Xn\nobs = km.QuadraticObservable(2)\nest = km.KoopmanSystemEstimator(obs, sampling_period=0.1)\nest.fit(X, Xn)\n\n# my learned system\nest.system \n\n\n# predict the next state (after one sampling period)\nest.predict(initial_value) \n```\n\n### Visualize Systems\n```python\nimport koopmania.visualizer as kviz\nimport matplotlib.pyplot as plt\n\n\n# show vector field\nfig, ax = plt.subplots() \nviewer = kviz.SystemViewer(system)\nviewer.plot_quiver(ax)\nplt.show()\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethanjameslew%2Fkoopmania","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethanjameslew%2Fkoopmania","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethanjameslew%2Fkoopmania/lists"}