TDA Wildfire Simulation Project (A Topology-Based Framework for Assessing the Statistical Robustness of Multi-Layer Coastal Infrastructures)
The increasing frequency and intensity of climate-related threats, particularly in coastal regions, expose the profound vulnerabilities of modern society's critical infrastructure. The systems providing energy, transportation, and telecommunications are not independent entities but form a complex, interconnected web where a failure in one can trigger a cascade of disruptions across the others. Traditional risk assessment methods, which often analyze these sectors in isolation, are no longer sufficient to capture the systemic vulnerabilities that emerge from these interdependencies. This report introduces a novel methodology for quantifying the resilience of these coupled systems by developing a Topology-based Statistical Robustness (TSR) metric.
This TDA project is an interactive Shiny application designed to analyze the impact of wildfires on electrical power grid infrastructure in the western United States. This tool combines geospatial analysis, network science, and topological data analysis (TDA) to assess grid vulnerability and resilience under wildfire conditions, it has been refactored and updated into a modular structure to improve code organization, maintainability, and readability.

- RAM: Minimum 16 GB (32-64 GB recommended for large-scale analysis)
- Storage: At least 5 GB of free disk space for data and cache files
- Processor: Multi-core processor recommended (application uses parallel processing)
- Display: 1920x1080 resolution or higher recommended for optimal visualization
The application runs on any platform that supports R:
- Windows: Windows 10 or later
- macOS: macOS 10.14 (Mojave) or later
- Linux: Ubuntu 18.04+, Debian 10+, or other modern distributions
- R: Version 4.0.0 or higher (4.3.0+ recommended)
- RStudio: Latest version recommended (optional but helpful for development)
- Web Browser: Modern browser (Chrome, Firefox, Safari, or Edge) for viewing the Shiny app
- Visit CRAN
- Download the latest R installer (e.g.,
R-4.3.2-win.exe) - Run the installer and follow the installation wizard
- Accept default settings unless you have specific preferences
- Visit CRAN
- Download the appropriate
.pkgfile for your macOS version - Open the downloaded file and follow installation instructions
- You may need to install XQuartz for certain graphics features: https://www.xquartz.org/
# Update package list
sudo apt update
# Install R
sudo apt install r-base r-base-dev
# Verify installation
R --versionFor other Linux distributions, see: https://cran.r-project.org/bin/linux/
- Visit RStudio Download Page
- Download the installer for your operating system
- Install following the provided instructions
- Launch RStudio to verify installation
Open R or RStudio and run the following commands to install all required packages:
# Install CRAN packages
install.packages(c(
"shiny", # Web application framework
"leaflet", # Interactive maps
"sf", # Spatial data handling
"igraph", # Network analysis
"dplyr", # Data manipulation
"data.table", # Fast data processing
"lubridate", # Date/time handling
"future.apply", # Parallel processing
"maps", # Map data
"ggplot2", # Visualization
"tidyr", # Data tidying
"R6", # Object-oriented programming
"shinyjs" # JavaScript operations in Shiny
))
# Install TDA (Topological Data Analysis) packages
install.packages(c(
"TDA", # Topological data analysis
"ripserr", # Persistent homology
"TDAstats" # TDA statistics
))Note: Package installation may take 10-30 minutes depending on your internet connection and system speed.
-
Download all project files including:
app.R(main entry point)server.R(server logic)ui.R(user interface)global.R(global configuration)AttackAndCascade.R(cascade simulation)TopologicalDataWorkflowWF.R(TDA workflow)modules/folder (all module files)- Data files (bus, branch, generator, wildfire data)
-
Place all files in a single directory (e.g.,
programs/)
Ensure you have all required data files in the appropriate directories:
- Power grid data (bus, branch, generator CSV files)
- Wildfire perimeter data (RDS or shapefile format)
- Spatial reference data
Note: Some data files may need to be obtained separately due to size or licensing restrictions.
- Open RStudio
- Set working directory:
Session > Set Working Directory > Choose Directory... - Set to:
REU-PSU-Research-Project/Programs/West_10k_program/ - Navigate to your project folder
- Open
app.R - Click the "Run App" button in the top-right of the editor
- The app will launch in a new window or your default browser
- REU-PSU-Research-Project/Programs/West_10k_program/Perseus/perseus.exe
- REU-PSU-Research-Project/Programs/West_10k_program/databases/
- REU-PSU-Research-Project/Programs/West_10k_program/modules/
- REU-PSU-Research-Project/Programs/West_10k_program/
- Data Coverage: Wildfire data may not cover all years or all geographic regions
- Real-time Data: Application uses historical data only; no real-time fire tracking
- Grid Model: Power grid model is simplified and may not reflect actual operational constraints
- Performance: Large-scale analyses may be slow or memory-intensive
-
Memory Leaks
- Long-running sessions may consume increasing memory
- Workaround: Restart the app periodically for extended analysis sessions
-
Parallel Processing Warnings
- May see warnings about future/parallel processing on some systems
- Impact: Usually harmless but may affect performance
- Workaround: Check console for specific errors; most can be ignored
-
Map Rendering
- Leaflet map may occasionally fail to render properly on first load
- Workaround: Refresh the page or restart the app
-
Large Fire Events
- Very large fire perimeters (>100,000 acres) may cause visualization slowdowns
- Workaround: Adjust analysis radius or filter to smaller fire events
-
TDA Computation Time
- Topological data analysis can be computationally expensive
- Large networks may take several minutes to analyze
- Workaround: Be patient; progress is shown in the R console
-
Browser Compatibility
- Best performance in Chrome or Firefox
- Safari may have occasional rendering issues with complex maps
- Workaround: Use Chrome or Firefox for best experience
-
Data File Paths
- Application assumes specific directory structure for data files
- Workaround: Verify
global.Rconfiguration matches your file locations
-
Compound Fire Analysis
- Analysis of multiple simultaneous fires is experimental
- Results may be less stable than single-fire analysis
- Workaround: Use with caution; verify results carefully
-
Error Handling
- Some edge cases may produce cryptic error messages
- Workaround: Check R console for detailed error information; restart app if needed
-
Session State
- Browser refresh will reset all analysis progress
- Workaround: Use download buttons to save results before refreshing
- Wildfire perimeter data is sourced from publicly available government databases
- Power grid data represents a simplified model and may not reflect actual utility infrastructure
- Analysis results are for research and educational purposes only
- DO NOT use this application for operational decision-making without proper validation
When making changes to the application:
- Identify the right module - Find which module contains the function you need to modify
- Edit the module - Make your changes in the appropriate module file
- Test thoroughly - Ensure your changes don't break functionality in dependent modules
- Update documentation - Add comments explaining your changes
The original WildfireServer.R file is preserved and fully functional, but i would NOT use it, as its incredibly cluttered with multiple functions and features jammed into one file, making it 4000+ lines.
- All functionality is maintained that WildfireServer.R had the modular files have,
- The modular structure uses identical logic, just reorganized for clarity, but both versions can coexist in the same directory