Micro-Simulations for Education

An interview with Valerie Lockhart of Code Savvy

Dan McCreary
5 min readNov 4, 2023
Micro-simulations allow teachers to generate customized simulations for classrooms and individual students quickly. Image-DALL-E 3

One day, during meditation, an idea came to Val Lockhart. Could we use generative AI to generate small simulations that could be quickly customized to the needs of a classroom? Would GPT-4 know enough about the powerful animation library Processing (p5.js) to develop a working animation?

It turns out Val’s intuition was right! And she has named these tools “MicroSims”.

Val is the Executive Director of Code Savvy. Code Savvy’s mission is to provide accessible CS mentoring and educational programming for students, teachers, and the community. Val also has extensive experience with visual communications. In the last several months, she has been promoting the use of “MicroSims” to quickly create visualizations and animations that can be used by both teachers and students in the classroom. And as you will see, the results are fantastic!

Val has also been working with Troy Peterson to create “C.R.E.A.T.E Cards,” which are printed playing-card-sized cards that classrooms can use to suggest prompts for teachers and students.

Using generative AI to create animations and simulations for educational purposes could revolutionize the learning experience in many ways. Val and I set up an interview to discuss how she came up with the idea of coupling GPT-4 with the latest version of the powerful Processing Language and Processing Editor.

You can watch the full video here:

Outcomes of MicroSims

Getting started creating your own MicroSims with GPT-4 is easy. It requires you to have some ideas, and then know how to copy the generated code from GPT-4 into the p5.js editor. But the consequences are huge!

Here is a summary of some of the ideas that GPT-4 suggested might be outcomes of being able to create microsimulations quickly. I have edited the descriptions and added Val’s comments on each topic. I also use Grammarly to improve my writing and have the correct tone.

Here is the prompt I gave GPT-4 to outline our discussion:

GPT-4 Prompt: What if we could quickly create new animations and simulations for education using generative AI? What would we be able to do with these simulations in education?

Personalized Learning Experiences

AI can create animations and simulations tailored to individual learning styles, making complex concepts easier to understand for different types of learners.

Interactive Learning

Simulations can become interactive experiences where students can experiment with variables in real time, allowing for experiential learning that reinforces theory through practice.

Students can use virtual labs to conduct experiments that might be too dangerous, expensive, or impossible in a regular classroom setting.

Visualizing Complex Concepts

Abstract ideas in subjects like quantum physics, advanced mathematics, or molecular biology could be visualized, making them more accessible and understandable.

Historical events could be recreated with simulations, providing a vivid, immersive learning experience.

Scalability and Shareability

Once an animation or simulation is created, it can be used by an unlimited number of students across different locations, enhancing the scalability of high-quality education resources.

Note that Val thinks we need to work on this. It will not happen automatically.

Increased Engagement

Animations and simulations can make learning more engaging and fun, increasing motivation and potentially improving retention rates.

Support for Teachers

Teachers can use these tools to illustrate concepts that are beyond the capabilities of traditional teaching aids like textbooks or static diagrams.

Cost-Effective Experimentation

For schools with limited resources, virtual simulations can substitute for expensive lab equipment and supplies.

Rapid Content Creation

New curriculum content or responses to current scientific discoveries can be quickly integrated into the educational process through updated simulations.

Language and Accessibility

AI-generated content can be produced in multiple languages and adapted for students with disabilities, increasing accessibility.

Val agrees with some caveats. We need to provide training to developers to promote more accessibility and multi-language support.

Collaborative Learning

Simulations could support collaborative environments where students worldwide work together in a virtual space.

Note: Val also suggested creating websites with search engines to find the right MicroSims with their prompts.

Soft Skills Development

Simulations can be used for role-playing activities that develop communication, problem-solving, and decision-making skills.

Note: Val would also like us to teach people how to use personas to create new perspectives of these simulations.

Global Education

With internet access, these resources can be distributed worldwide, potentially equalizing educational opportunities.

Val thinks we have a long way to go, such as providing solid, fast, and reliable internet access.

Assessment and Feedback

Simulations can track student interactions, providing real-time feedback and assessments that help learners and educators identify areas for improvement.

Professional Training

Beyond K-12 and higher education, such simulations can be used for professional and technical training in various fields, from healthcare to engineering.

Cultural Education

Simulations can recreate historical environments or cultural experiences, aiding in the teaching of anthropology, history, and social studies.

Note: Val agrees, but with some caveats. Val is concerned that GPT-4 sims could also hallucinate or create cultural bias.

Centralized Search

Val and her team will also be creating search engines in the future that will provide both keyword and taxonomic search (faceted search).

The potential of AI in creating such educational tools is vast. While there are also considerations regarding the accuracy, ethics, and pedagogical effectiveness of these simulations, the benefits they could provide to the educational sector are significant.

MicroSim Contests

Val and the team at Code Savvy will be putting together contests to promote these ideas. She indicated that there would be some cool prizes for the winners of these contests.

Tutorial and Prompting Tips

Here is how can start your prompt:

GPT-4 Prompt: Generate a single p5.js sketch file that demonstrates…

If you would like to have interactive controls you can add the following:

Allow the users to change parametes X, Y, Z…Create range control sliders below the sketch to allow the parameters to vary. Include the label and value of the parameters to the left of the slider. Make the sliders span the width of the sketch.

If you are interested in learning more about how to create your MicroSims, here are some links:

Sample Visualizations done by Val and Troy: https://sites.google.com/view/p5jsai/

Single Page Instructions:

Sample simulations on the GenAI for Teachers Site: https://www.coderdojotc.org/chatgpt-for-teachers/demos/p5/

We also encourage everyone to take a class on prompt engineering and share the prompts they are using to generate these MicroSims.



Dan McCreary

Distinguished Engineer that loves knowledge graphs, AI, and Systems Thinking. Fan of STEM, microcontrollers, robotics, PKGs, and the AI Racing League.