{"id":15716339,"url":"https://github.com/ramy-badr-ahmed/random-simplex","last_synced_at":"2026-07-03T00:01:25.755Z","repository":{"id":248443085,"uuid":"828697368","full_name":"Ramy-Badr-Ahmed/Random-Simplex","owner":"Ramy-Badr-Ahmed","description":"Random Simplex - https://doi.org/10.5281/zenodo.12808899","archived":false,"fork":false,"pushed_at":"2024-08-12T09:38:47.000Z","size":1072,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T20:44:28.513Z","etag":null,"topics":["fortran","matlab","multivariate-distributions","random-simplex","stability-analysis"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ramy-Badr-Ahmed.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-14T23:34:04.000Z","updated_at":"2024-08-30T09:15:30.000Z","dependencies_parsed_at":"2024-08-12T10:57:27.088Z","dependency_job_id":null,"html_url":"https://github.com/Ramy-Badr-Ahmed/Random-Simplex","commit_stats":null,"previous_names":["ramy-badr-ahmed/random-simplex"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Ramy-Badr-Ahmed/Random-Simplex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramy-Badr-Ahmed%2FRandom-Simplex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramy-Badr-Ahmed%2FRandom-Simplex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramy-Badr-Ahmed%2FRandom-Simplex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramy-Badr-Ahmed%2FRandom-Simplex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ramy-Badr-Ahmed","download_url":"https://codeload.github.com/Ramy-Badr-Ahmed/Random-Simplex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ramy-Badr-Ahmed%2FRandom-Simplex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35067032,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["fortran","matlab","multivariate-distributions","random-simplex","stability-analysis"],"created_at":"2024-10-03T21:45:09.642Z","updated_at":"2026-07-03T00:01:25.731Z","avatar_url":"https://github.com/Ramy-Badr-Ahmed.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"![MATLAB](https://img.shields.io/badge/MATLAB-%23D00000.svg?style=plastic\u0026logo=mathworks\u0026logoColor=white)   ![Fortran](https://img.shields.io/badge/Fortran-%23734F96.svg?style=plastic\u0026logo=fortran\u0026logoColor=white) ![GitHub](https://img.shields.io/github/license/Ramy-Badr-Ahmed/random-simplex?style=plastic)\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.12808899.svg)](https://doi.org/10.5281/zenodo.12808899)\n\n\n# Random Simplex Matrix\n\n## Overview\n\nThis repository contains a function that utilises the Dirichlet distribution method to generate points on the `(n−1)`-dimensional simplex. The `randomSimplexMatrix.m` generates `m x n` matrices where each row is a random sample from the `(n−1)`-dimensional simplex, i.e., it produces vectors where each element is a non-negative number and the sum of all elements in each vector is 1.\n\n### About\n\n[Mathematica Link](https://reference.wolfram.com/language/ref/Simplex.html)\n\n## Methodology\n\n1. **Generation of K Unit-Exponential Distributed Random Draws**:\n    - In each row (sample), the function generates K uniform random numbers `y_i` from the open interval `(0,1]`.\n    - These are transformed to unit-exponential distributed random numbers `x_i = -log(y_i)`.\n\n2. **Normalization**:\n    - Compute the sum `S` of all `x_i` values.\n\n3. **Calculation of Simplex Coordinates**:\n    - The coordinates `t_1, ..., t_K` of the final point on the unit simplex are computed as `t_i = x_i / S`.\n\n4. **Output**:\n    - Returns a matrix, where each row is a vector on the `(n-1)`-dimensional simplex.\n\n\n## Some Applications\n\n#### Stability Analysis\n\n- Polynomial Stability/Stability of discrete-time control systems: \n\n    \u003e Use simplex sampling to generate coefficients for polynomials and analyse their stability by checking if all roots lie within the unit circle.\n\n- Lyapunov Functions: \n\n    \u003e Construct Lyapunov functions with randomly sampled coefficients to study the stability of equilibrium points in dynamical systems.\n\n#### Bifurcation Analysis\n\n- Parameter Space Exploration:\n\n    \u003e Investigate the behavior of dynamical systems under different parameter regimes by sampling parameters from a simplex. Identify bifurcation points where system behavior changes qualitatively.\n\n- Nonlinear Dynamics: \n\n    \u003e Model/simulate nonlinear systems to study chaos, where initial conditions or parameters are sampled from a simplex.\n\n## Additional Scripts\n\n1. `simplexSpace.m`\n\n   \u003e Demonstrates various plots and visualisations of simplex sampling.\n\n2. `MultivariateND.m`\n\n   \u003e Showcases an application of simplex sampling for sampling from a multivariate normal distribution.\n\n3. `VoronoiDiagram.m`\n\n   \u003e Visualise the Voronoi diagram of random points on a 2-dimensional simplex, divides regions based on proximity.\n\n\n## Example Usage\n\n```matlab\nn = 100;  % Number of columns (dimensionality of simplex)\nm = 1500;  % Number of rows (number of samples)\ny = randomSimplexMatrix(n, m);\ndisp('Generated simplex matrix:');\ndisp(y);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framy-badr-ahmed%2Frandom-simplex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framy-badr-ahmed%2Frandom-simplex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framy-badr-ahmed%2Frandom-simplex/lists"}