{"id":22663410,"url":"https://github.com/efjerryyang/modeling-and-simulation","last_synced_at":"2025-07-21T03:32:53.111Z","repository":{"id":131290669,"uuid":"487416380","full_name":"efJerryYang/modeling-and-simulation","owner":"efJerryYang","description":"A modeling and simulation task of SJTU","archived":false,"fork":false,"pushed_at":"2023-10-04T00:17:19.000Z","size":50394,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T09:14:31.726Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/efJerryYang.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":"2022-05-01T01:10:13.000Z","updated_at":"2022-09-26T13:14:21.000Z","dependencies_parsed_at":"2025-02-03T23:49:44.898Z","dependency_job_id":null,"html_url":"https://github.com/efJerryYang/modeling-and-simulation","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/efJerryYang/modeling-and-simulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efJerryYang%2Fmodeling-and-simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efJerryYang%2Fmodeling-and-simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efJerryYang%2Fmodeling-and-simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efJerryYang%2Fmodeling-and-simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/efJerryYang","download_url":"https://codeload.github.com/efJerryYang/modeling-and-simulation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efJerryYang%2Fmodeling-and-simulation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266235425,"owners_count":23897180,"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":[],"created_at":"2024-12-09T12:18:53.534Z","updated_at":"2025-07-21T03:32:48.104Z","avatar_url":"https://github.com/efJerryYang.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Modeling and Simulation\n\n## Sonar System Simulation\n\nThis project simulates a distributed sonar system, which consists of various independent nodes interconnected to function collaboratively. Maintaining a synchronized clock signal across these nodes is vital for the system's effective operation. One node assumes the role of a primary clock signal distributor, while the others function as receivers.\n\n### System Overview\n\n- **Node States**: Nodes can transition between primary and secondary roles based on system requirements and node conditions. The system can adaptively select a new primary node if the existing one encounters issues.\n- **Redundancy**: Even if only `k` nodes work synchronously, the system can function correctly. Having more nodes than `k` provides redundancy, enhancing the system's survival rate and longevity.\n- **Switch Failures**: Both switches A and B in nodes can exhibit different types of failures. These failures influence node states and the overall system state.\n\n### System Structure\n\n1. **Constants \u0026 Parameters**: Both the Julia and MATLAB codes initiate the system with predefined settings. These constants, like `NUM_SYSTEM`, `NUM_NODE`, and `LIFE_LIMIT`, set the scope of the simulation. Switch-specific constants also dictate their failure probabilities.\n2. **Simulation Core**: The core logic assesses the system's state by evaluating the state of switches and nodes. If required, the primary node can be reselected to maintain system functionality.\n3. **Output**: Post-simulation, the results detailing system lifetimes are recorded. Visualizations, such as histograms, provide insights into system reliability and MTTF (Mean Time To Failure).\n\n### Usage\n\n**Julia**:\n\n- Launch the Julia script `simulation.jl` in an editor or the Julia REPL.\n- Run the simulation, and the results will be saved as CSV files.\n- Inspect the MTTF histogram.\n\n**MATLAB**:\n\n- Execute the MATLAB script `simulation_varia_timestep.m`.\n- On completing the simulation for a series of nodes, MTTF and reliability data will be presented in the MATLAB console.\n\n### Notice\n\n- For tailored simulations, modify parameters like the total systems, node counts, or life limits.\n- As random number generation is integral to these simulations, different runs might give slightly varying results.\n- Differences between the Julia and MATLAB codes primarily stem from language-specific nuances.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefjerryyang%2Fmodeling-and-simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefjerryyang%2Fmodeling-and-simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefjerryyang%2Fmodeling-and-simulation/lists"}