Grounded — Test Tomorrow Before It Arrives

What if we could find the exact chain of events that causes a hospital to lose power—and test how to prevent it before it ever happens?

🌐 Live Demo: https://grounded-peach.vercel.app

Inspiration

A hospital doesn't lose power just because a storm happens.

Sometimes it starts with something much smaller. A heatwave pushes electricity demand higher than usual. Solar generation drops. The grid goes down. Batteries start draining, and backup generators take time to respond.

Individually, none of these events might be enough to cause a serious problem. But when they happen together, critical services can suddenly become vulnerable.

That is what got us thinking.

We have weather forecasts, energy dashboards, and increasingly sophisticated AI systems. But knowing that a heatwave is coming is very different from knowing whether a hospital, its backup batteries, and the surrounding community can actually survive it.

And if an energy system has a weakness, why should we have to wait for a real emergency to discover it?

We wanted to build something that could answer a simple question:

What if we could test thousands of possible tomorrows, discover where infrastructure breaks, and find a better decision before the real disaster arrives?

That's how Grounded started.

ALT TEXT

What it does

Grounded is an interactive climate-resilience digital twin focused on a simulated microgrid in Jaipur, India.

It brings together a hospital, homes, solar panels, batteries, backup generators, the electricity grid, and EV charging into one connected system.

Instead of showing static energy statistics, Grounded lets you run the system through simulated emergencies and see what actually happens.

You can explore heatwaves, storms, electricity outages, unusually high demand, and situations where several things go wrong at once.

Each simulation covers 72 hours in 15-minute intervals, meaning the system makes 288 consecutive energy-dispatch decisions while tracking available power, battery charge, generator behavior, demand, costs, and service interruptions.

The interesting part is what happens when something fails.

Grounded doesn't just display a red warning saying "high risk." It lets you investigate the sequence of events that produced the failure.

Maybe the grid went down while solar generation was low. Maybe the batteries had already been depleted. Maybe the generator couldn't start quickly enough.

Once Grounded identifies the problem, you can test different interventions against the same simulated future.

Should we save more battery energy for emergencies? Delay EV charging? Shift some electricity demand earlier? Add more storage or generation?

Grounded evaluates these possibilities and compares the results.

The goal isn't just to find a solution that protects the hospital. It's to understand what that solution costs, what it changes for everyone else, and whether it still works under different conditions.

How we built it

We built Grounded primarily with TypeScript, React, Phaser, Vite, Web Workers, Node.js, Fastify, and SQLite.

One decision we made early was to keep the actual simulation engine separate from the interface.

We didn't want a dashboard where the numbers changed just because somebody clicked a button. We wanted the visual experience to be driven by a consistent computational model.

Building the simulation engine

At the center of Grounded is a stochastic microgrid simulation.

It models solar generation, electricity demand, grid availability, battery charging and discharging, generator startup and fuel constraints, and different priorities for hospital and community loads.

The hospital model includes four clinical demand tiers, allowing the system to distinguish more critical services from loads that can be curtailed.

We also added energy-balance checks and battery-state constraints so simulated energy cannot simply appear from nowhere.

For environmental inputs, we use NASA POWER climate data for Jaipur. The current reference implementation also uses publicly available operational electricity data from Australia.

That distinction matters: Grounded's current results are computational experiments, not measurements from a real Jaipur hospital.

Searching for better interventions

After building the simulator, we realized that manually trying different battery settings wasn't enough.

So we built an optimization engine that exhaustively evaluates 245 operational policy combinations, including battery reserves, EV charging flexibility, and demand pre-cooling.

We also implemented a separate infrastructure investment optimizer that evaluates options such as additional solar capacity, batteries, generators, and demand controls.

Instead of optimizing only one number, Grounded considers multiple competing objectives, including critical failure risk, unserved energy, operating costs, emissions, and intervention burden.

Making sure the results actually mean something

This became one of the hardest and most important parts of the project.

An intervention can look amazing if you only test it against the same scenarios used to discover it.

So Grounded doesn't stop there.

It uses independent validation scenarios, paired comparisons with identical random seeds, uncertainty bounds, and assumption-based stress tests.

We also built an 81-condition compound stress envelope to test how selected policies behave when several unfavorable assumptions change together.

And importantly, Grounded can refuse to call a recommendation successful when there isn't enough statistical evidence.

We wanted the system to be able to say "This looks promising, but we haven't proved it strongly enough yet" instead of confidently recommending something based on a lucky simulation.

Making the evidence replayable

Another major part of Grounded is deterministic replay.

Every simulation is associated with its configuration, model identity, input fingerprints, and random seeds.

That allows a user to revisit a simulated emergency, apply an intervention, and compare what happened under matching conditions.

We also built an evidence system that saves reports, validation results, and construction certificates, with consistency checks that help detect mismatched or corrupted records.

The idea is simple: if Grounded recommends something, you should be able to inspect how it reached that conclusion.

A result that surprised us

One of our most interesting findings came from testing battery reserve policies.

In one controlled experiment covering 500 simulated extreme-event scenarios, the baseline configuration experienced 16 critical hospital failures.

Increasing the battery reserve to 30% reduced the observed critical failures from 16 to 0.

At first, that looked like a clear win.

But then we looked at the rest of the results.

The higher reserve also increased the average amount of flexible electricity demand that couldn't be served by approximately 42%.

In other words, we had protected the hospital by making the energy situation worse for other loads.

That was exactly the kind of hidden trade-off we wanted Grounded to reveal.

We then tested a different combination: a 20% battery reserve, delayed EV charging, and demand pre-cooling.

It also produced zero observed critical failures in that experiment, but with a much smaller increase in unserved flexible energy.

This doesn't prove that either policy will eliminate failures in a real hospital. The outcomes depend on the simulated configuration and assumptions.

What it demonstrates is something we think matters much more than a single impressive percentage:

A resilience intervention isn't automatically a good decision just because it prevents one type of failure. You have to understand what happens to the rest of the system.

Evidence City — Making the results visible

We also wanted Grounded to feel like something people would actually enjoy exploring.

That's where Evidence City came in.

Using Phaser, we built an interactive world where progress in the simulation can be represented through construction.

But instead of giving users buildings for clicking buttons, Grounded ties construction to computational achievements.

Complete an audited simulation, and you can earn a tree.

Produce a stronger optimization result that passes the required validation checks, and you can unlock a building.

Construction is connected to evidence, with checks for eligibility, placement, and duplicate rewards.

We wanted every meaningful addition to the virtual world to represent work that had actually been completed inside the simulator.

It's our attempt to make a complex engineering process more approachable without turning the underlying results into arbitrary game points.

Challenges we ran into

The hardest challenge wasn't making Grounded look good. It was figuring out when we could actually trust what it was showing.

Getting the energy model to behave consistently across hundreds of scenarios took a lot of work. A small error in battery accounting or generator behavior could completely change the final risk results.

Optimization created another challenge. Finding a policy that performed well was relatively straightforward; figuring out whether it was genuinely better on unseen scenarios was much harder.

We also had to deal with performance. Running thousands of 72-hour scenarios while keeping an interactive application responsive requires careful separation of computation and rendering. Moving heavy simulation work into Web Workers helped us keep the public experience usable.

Finally, connecting scientific evidence to a persistent 3D world introduced its own complexity. We had to handle saved workspaces, replay compatibility, duplicate construction attempts, and reloading without losing progress.

Each of these problems pushed Grounded further away from a simple hackathon demo and closer to the kind of system we originally imagined.

Accomplishments we're proud of

We're proud that Grounded is built around an actual executable simulation rather than predetermined dashboard results.

We implemented a 72-hour energy model, a 245-policy operational optimizer, infrastructure investment comparisons, deterministic replay, independent validation, and an interactive evidence-driven world.

But the accomplishment that means the most to us is that Grounded doesn't have to pretend every intervention works.

It can show when a policy creates new problems, when an alternative performs better, and when the available evidence simply isn't strong enough.

Building a system that knows how to communicate uncertainty turned out to be one of the most valuable parts of the entire project.

Alt text

What we learned

We started by thinking about climate resilience mainly as an energy problem.

We ended up learning that it's just as much a decision-making problem.

Adding more batteries or solar panels isn't always the best answer. Sometimes changing when electricity is consumed can make a meaningful difference.

We also learned that a simulation result and a real-world prediction are not the same thing. The assumptions, data sources, and limitations have to stay visible.

And perhaps most importantly, we learned that a useful engineering tool shouldn't just give you an answer.

It should help you understand why that answer makes sense—and what evidence could change it.

What's next for Grounded?

Our next major goal is moving from reference-data simulation toward independently validated, site-specific resilience planning.

That means working with authorized local infrastructure data, improving our electrical and clinical-load models, and testing predictions against real operational measurements.

We also want to improve the cloud evidence system, add secure multi-user collaboration, make large optimization jobs more scalable, and expand Grounded to other critical infrastructure such as emergency shelters and community microgrids.

There is still a lot to build.

But the direction is clear.

We want Grounded to become a place where planners, engineers, researchers, and communities can explore difficult infrastructure decisions before making them in the real world.

Final thoughts

We can't prevent every storm, heatwave, or power outage.

And no simulation can promise that real infrastructure will never fail.

But we believe we can get much better at understanding what might go wrong, testing possible interventions, and making the evidence behind those decisions visible.

That's what we're trying to build with Grounded.

Don't wait for infrastructure to fail before asking how to protect it.

Grounded — Test Tomorrow Before It Arrives.

Simulate. Optimize. Validate. Prove.

Created during the time limit of hackathon.

Built With

Share this project:

Updates

Submission history