# ChatGPT - a tutorial writer?

Kia ora koutou

In exploring the role of ChatGPT in my courses I tried to test it with this question:

write grasshopper code for analysing the thermal performance of a school within the Ladybug Tools environment

Its extraordinary response is below. I am posting this with a view to engaging with others in building environmental performance education to try to brainstorm opportunities and caveats in regards to this new tool.

To analyze the thermal performance of a school within the Ladybug Tools environment, you can use Grasshopper, which is a graphical algorithm editor.

Here are the steps to follow:

1. First, make sure that you have installed Ladybug Tools and its necessary components on your computer.
2. Open a new Grasshopper canvas, and import the necessary Ladybug Tools components. You can do this by typing â€śLadybugâ€ť or â€śHoneybeeâ€ť in the Grasshopper search bar.
3. Load the school geometry into Grasshopper. You can do this by using the â€śImportâ€ť component in Ladybug Tools.
4. Define the building envelope by creating surfaces that represent the walls, roof, and floor of the building. You can use the â€śHB Generate Aperturesâ€ť component to create openings in the walls for windows and doors.
5. Set the location and orientation of the building using the â€śHB Weather Stationâ€ť and â€śHB Sun Pathâ€ť components. These components will provide information about the climate and sun position at the buildingâ€™s location.
6. Define the thermal properties of the building materials using the â€śHB Materialâ€ť component. This component allows you to set the material type, thickness, and other relevant properties.
7. Create an energy simulation using the â€śHB Run Energy Simulationâ€ť component. This will run a simulation to calculate the energy consumption and thermal performance of the building.
8. Analyze the simulation results using the â€śHB Visualize Resultsâ€ť component. This will allow you to visualize the data in a variety of ways, such as temperature maps, energy use graphs, and more.

Here is some sample Grasshopper code that performs these steps:

import â€śHoneybeeâ€ť as hb

school_geometry = lb.import_3dm_geometry(â€śpath/to/school.3dmâ€ť)

// Create building envelope
walls = hb.generate_walls(school_geometry)
roof = hb.generate_roof(school_geometry)
floor = hb.generate_floor(school_geometry)
apertures = hb.generate_apertures(walls)

// Set location and orientation
location = lb.location(51.5, -0.1) // Set the schoolâ€™s latitude and longitude
climate_file = lb.epw(â€śpath/to/climate.epwâ€ť) // Load a weather file
weather = lb.weather_data(climate_file, location)
sun = lb.sun_path(location)

// Define thermal properties
walls_material = hb.material(â€śBrickâ€ť, 0.2) // Set the wall material to brick with a thickness of 0.2 meters
roof_material = hb.material(â€śMetalâ€ť, 0.1) // Set the roof material to metal with a thickness of 0.1 meters
floor_material = hb.material(â€śConcreteâ€ť, 0.1) // Set the floor material to concrete with a thickness of 0.1 meters

// Create energy simulation
simulation = hb.run_energy_simulation(walls, roof, floor, apertures, walls_material, roof_material, floor_material, weather, sun)

// Visualize simulation results
temperature_map = hb.visualize_results(simulation, â€śTemperature Mapâ€ť)
energy_use_graph = hb.visualize_results(simulation, â€śEnergy Use Graphâ€ť)

Hi @MichaelDonn, curiously i started to give ChatGPT a try, ut just for the fun right now.
So far iâ€™ve found that many/some of the code statements are not existing. I recommend to check the code right away. The feeling is that there is a lot of debugging to do. Probably the code is not going to work as suggested by the ChatGPT.
Probably you can let the chat to know about those bugs to refine the code, but â€¦ i didnâ€™t went to far by now.
For your code above, there is plenty of mistakes when testing it â€¦
It is interesting and promising, though.
-A.

1 Like

Interesting topic.

Iâ€™ve tried playing with it, but my experience so far is not yet convincing when it comes to such tasks.
I find chatGPT really helpful when it comes to extending ideas or making it explain things, but asking it to do research or write steps that should include commands and links to resources: itâ€™s generating gibberish.

URLs, Youtube links, DOIs that look plausible, but none of them work - it makes me question which portion of its answers are to be trusted. It also makes up paper titles, tutorial content, etc., it has no idea where its knowledge is coming from.

Donâ€™t get me wrong, I find it astonishing when I ask it something and the answer just flows and I can skim through miriads of well structured ideas, Iâ€™m just not sure that this language model is adequate for tutorial writing, which should have pretty grounded semantics and logical understanding.

1 Like