{"id":31727244,"url":"https://github.com/sarvesh2304/stellarator_simulation","last_synced_at":"2025-10-09T06:19:40.889Z","repository":{"id":315383071,"uuid":"1059257054","full_name":"Sarvesh2304/Stellarator_simulation","owner":"Sarvesh2304","description":"A comprehensive Julia package for stellarator fusion reactor physics analysis featuring 3D magnetic field calculations, neoclassical transport modelling, quasi-isodynamic optimisation algorithms, and interactive 3D visualisations. Includes tokamak comparison framework and high-resolution plotting capabilities for fusion research.","archived":false,"fork":false,"pushed_at":"2025-09-18T08:05:32.000Z","size":7545,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-18T10:23:51.653Z","etag":null,"topics":["3d-visualisation","data-analysis","field-line-tracing","fusion-physics","fusion-research","interactive-3d","julia","magnetic-confinement","magnetic-field-calculations","magnetic-surfaces","matplotlib","neoclassical-transport","numerical-methods","optimisations","physics-simulation","plasma-physics","plotly","quasi-isodynamic","stellarator","stellarator-optimization"],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sarvesh2304.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-18T07:53:02.000Z","updated_at":"2025-09-18T08:50:47.000Z","dependencies_parsed_at":"2025-09-18T10:23:56.450Z","dependency_job_id":"da78760b-e678-4a68-aeac-3068c482659f","html_url":"https://github.com/Sarvesh2304/Stellarator_simulation","commit_stats":null,"previous_names":["sarvesh2304/stellarator_simulation"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Sarvesh2304/Stellarator_simulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarvesh2304%2FStellarator_simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarvesh2304%2FStellarator_simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarvesh2304%2FStellarator_simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarvesh2304%2FStellarator_simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sarvesh2304","download_url":"https://codeload.github.com/Sarvesh2304/Stellarator_simulation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarvesh2304%2FStellarator_simulation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000852,"owners_count":26082950,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"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":["3d-visualisation","data-analysis","field-line-tracing","fusion-physics","fusion-research","interactive-3d","julia","magnetic-confinement","magnetic-field-calculations","magnetic-surfaces","matplotlib","neoclassical-transport","numerical-methods","optimisations","physics-simulation","plasma-physics","plotly","quasi-isodynamic","stellarator","stellarator-optimization"],"created_at":"2025-10-09T06:19:39.093Z","updated_at":"2025-10-09T06:19:40.884Z","avatar_url":"https://github.com/Sarvesh2304.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Stellarator Physics Analysis Package\n\nA comprehensive Julia package for stellarator fusion reactor physics analysis, featuring 3D magnetic field calculations, neoclassical transport modeling, optimization algorithms, and comparison with tokamak performance.\n\n## Features\n\n### 🔬 Core Physics\n- **3D Magnetic Field Calculations**: Complete stellarator magnetic field modeling with Fourier harmonics\n- **Neoclassical Transport**: Stellarator-specific transport coefficient calculations\n- **Boozer Coordinates**: Advanced coordinate system for stellarator analysis\n- **Magnetic Surface Analysis**: Calculation of magnetic surfaces and safety factors\n\n### ⚡ Optimisation Algorithms\n- **Quasi-Symmetry Optimisation**: Minimize magnetic field asymmetry\n- **Quasi-Isodynamicity Optimisation**: Optimise for isodynamic magnetic fields\n- **Magnetic Well Optimisation**: Maximize magnetic well depth for stability\n- **Transport Optimisation**: Minimize neoclassical transport\n\n### 🔄 Tokamak Comparison\n- **Performance Metrics**: Direct comparison of stellarator vs tokamak performance\n- **Transport Analysis**: Side-by-side transport coefficient comparison\n- **Stability Analysis**: Comparison of stability properties and beta limits\n- **Confinement Scaling**: Analysis of confinement time scaling laws\n\n### 📊 3D Visualisation\n- **Magnetic Field Lines**: Interactive 3D field line tracing\n- **Plasma Surfaces**: 3D visualisation of magnetic surfaces\n- **Transport Profiles**: 2D and 3D transport coefficient visualisation\n- **Optimisation Results**: Real-time optimisation progress visualisation\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone \u003crepository-url\u003e\ncd \"Stellarator Physics\"\n```\n\n2. Start Julia and activate the environment:\n```julia\njulia\u003e using Pkg\njulia\u003e Pkg.activate(\".\")\njulia\u003e Pkg.instantiate()\n```\n\n3. Load the package:\n```julia\njulia\u003e using StellaratorPhysics\n```\n\n## Quick Start\n\n```julia\nusing StellaratorPhysics\n\n# Create a stellarator configuration\nR₀ = 1.0  # Major radius [m]\na = 0.2   # Minor radius [m]\nN = 5     # Number of field periods\nB₀ = 1.0  # Reference magnetic field [T]\n\nstellarator_bfield = MagneticField3D(R₀, a, N, B₀)\n\n# Set up plasma parameters\nT_e = 1000.0  # Electron temperature [eV]\nT_i = 1000.0  # Ion temperature [eV]\nn_e = 1e20    # Electron density [m^-3]\nn_i = 1e20    # Ion density [m^-3]\n\ntransport = NeoclassicalTransport(stellarator_bfield, T_e, T_i, n_e, n_i)\n\n# Calculate transport coefficients\ns = 0.5  # Normalized radius\ncoeffs = calculate_transport_coefficients(transport, s)\n\n# Create 3D visualization\nplot_3d = plot_plasma_surfaces(stellarator_bfield, [0.2, 0.4, 0.6, 0.8])\n```\n\n## Examples\n\n### Complete Analysis Example\nRun the comprehensive example:\n```julia\ninclude(\"examples/stellarator_analysis_example.jl\")\n```\n\nThis example demonstrates:\n- 3D magnetic field calculations\n- Neoclassical transport analysis\n- Stellarator optimization\n- Comparison with tokamak performance\n- 3D visualization\n\n### Individual Module Examples\n\n#### Magnetic Field Analysis\n```julia\n# Calculate magnetic field at a point\nR, φ, Z = 1.2, 0.0, 0.1\nB_R, B_φ, B_Z = calculate_magnetic_field(stellarator_bfield, R, φ, Z)\n\n# Trace a field line\nfield_line = trace_field_line(stellarator_bfield, R, φ, Z, 10.0)\n\n# Find magnetic surface\nsurface = find_magnetic_surface(stellarator_bfield, 0.5)\n```\n\n#### Transport Analysis\n```julia\n# Calculate transport coefficients\ncoeffs = calculate_transport_coefficients(transport, 0.5)\n\n# Calculate bootstrap current\nj_bs = bootstrap_current(transport, 0.5)\n\n# Calculate radial electric field\nE_r = radial_electric_field(transport, 0.5)\n```\n\n#### Optimisation\n```julia\n# Optimise for quasi-symmetry\nresult, optimal_harmonics = optimize_quasi_symmetry(stellarator_bfield, 1000)\n\n# Multi-objective optimization\nweights = Dict(\n    \"quasi_symmetry\" =\u003e 0.4,\n    \"magnetic_well\" =\u003e 0.3,\n    \"transport\" =\u003e 0.3\n)\nresult = multi_objective_optimization(stellarator_bfield, weights, 1000)\n```\n\n#### Comparison with Tokamak\n```julia\n# Create tokamak field\ntokamak_bfield = create_tokamak_field(R₀, a, 1.0, 2.0, B₀)\ntokamak_transport = NeoclassicalTransport(tokamak_bfield, T_e, T_i, n_e, n_i)\n\n# Compare performance\ncomparison = TokamakComparison(stellarator_bfield, tokamak_bfield, \n                              stellarator_transport, tokamak_transport)\nresults = comprehensive_comparison(comparison, 0.5)\n```\n\n## Package Structure\n\n```\nStellaratorPhysics/\n├── src/\n│   ├── StellaratorPhysics.jl      # Main module\n│   ├── MagneticField3D.jl         # 3D magnetic field calculations\n│   ├── NeoclassicalTransport.jl   # Transport modeling\n│   ├── StellaratorOptimization.jl # Optimisation algorithms\n│   ├── TokamakComparison.jl       # Tokamak comparison\n│   ├── Visualization3D.jl         # 3D visualization\n│   └── utils.jl                   # Utility functions\n├── examples/\n│   └── stellarator_analysis_example.jl\n├── Project.toml\n└── README.md\n```\n\n## Dependencies\n\n- **Julia 1.8+**: Required for optimal performance\n- **Plots.jl**: For 2D plotting and visualization\n- **PlotlyJS.jl**: For interactive 3D visualization\n- **Optim.jl**: For optimization algorithms\n- **NLopt.jl**: For advanced optimization\n- **DifferentialEquations.jl**: For field line tracing\n- **ForwardDiff.jl**: For automatic differentiation\n- **SpecialFunctions.jl**: For special mathematical functions\n\n## Physics Background\n\n### Stellarator vs Tokamak\nStellarators are toroidal fusion devices that use 3D magnetic field configurations to confine plasma, unlike tokamaks which rely on axisymmetric fields and plasma current. Key advantages include:\n- **Steady-state operation**: No need for plasma current drive\n- **Reduced MHD instabilities**: 3D field provides additional stability\n- **Flexible design**: Can optimize for various physics objectives\n\n### Neoclassical Transport\nNeoclassical transport in stellarators differs from tokamaks due to:\n- **3D magnetic field geometry**: Affects particle orbits and transport\n- **Magnetic field ripple**: Creates additional transport channels\n- **Quasi-symmetry**: Can reduce transport to tokamak-like levels\n\n### Optimisation Objectives\n- **Quasi-Symmetry**: Minimize magnetic field asymmetry to reduce transport\n- **Quasi-Isodynamicity**: Optimise for isodynamic magnetic fields\n- **Magnetic Well**: Maximize magnetic well depth for stability\n- **Transport**: Minimize neoclassical transport coefficients\n\n## Contributing\n\nContributions are welcome! Please see the contributing guidelines for details on:\n- Code style and formatting\n- Testing requirements\n- Documentation standards\n- Pull request process\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Citation\n\nIf you use this package in your research, please cite:\n\n```bibtex\n@software{stellarator_physics,\n  title={Stellarator Physics Analysis Package},\n  author={Stellarator Research Team},\n  year={2024},\n  url={https://github.com/your-repo/stellarator-physics}\n}\n```\n\n## Acknowledgments\n\n- Based on stellarator physics theory and VMEC code\n- Inspired by the work of the stellarator research community\n- Built with the Julia scientific computing ecosystem\n\n## Support\n\nFor questions, issues, or contributions:\n- Open an issue on GitHub\n- Contact the development team\n- Check the documentation and examples\n\n---\n\n**Note**: This package is designed for research and educational purposes. For production fusion reactor design, consult with fusion physics experts and use validated codes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarvesh2304%2Fstellarator_simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarvesh2304%2Fstellarator_simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarvesh2304%2Fstellarator_simulation/lists"}