top of page
  • Writer's picturePatrick Law

The Prompt Engineering Playbook: Streamline Your Engineering Projects with Calculation Template



In our previous articles, we've had a fascinating journey exploring the world of navigating and constructing powerful prompts. We've delved into effective techniques and guidelines that can transform the way we interact with AI models like ChatGPT. But now, it's time to roll up our sleeves and put those skills into action! We're going to walk you through a simple, step-by-step guide to formulating prompts that deliver the best and accurate results.


Being a sector that thrives in the engineering industry, we've chosen to focus on a practical application that many of you might find particularly useful: creating an Engineering Calculation Template using ChatGPT.


In this guide, we'll be focusing on designing a crucial piece of process engineering equipment - the heat exchanger. You've probably come across heat exchangers in various applications such as refrigeration, heating and air conditioning systems, power plants, chemical processing systems, and many others. But first, let's quickly go over the formula we'll be using: Q = UA (ΔT1 - ΔT2) / ln(ΔT1 / ΔT2).


Now that we're all on the same page, let's dive right into the simple, step-by-step guide to creating a fantastic engineering calculation template.


Step 1: Define the goal


Start by clearly understanding what you want to achieve. In our case, we aim to develop a calculation template that's easy to use and can be seamlessly integrated with Google Sheets - a tool frequently used by engineers.


Step 2: Identify necessary variables


Make a list of all the variables needed for the calculation, such as measurements, units, and material properties. For our heat exchanger design, we'll be using the input variables (U, A, ΔT1, ΔT2) and the output variable (Q) in our ChatGPT prompt, where:

  • Q is the rate of heat transfer (W)

  • U is the overall heat transfer coefficient (W/m²K)

  • A is the surface area of the heat exchanger (m²)

  • ΔT1 is the temperature difference between the hot and cold fluids at one end (K/°C/°F)

  • ΔT2 is the temperature difference at the other end (K/°C/°F)

Step 3: Develop your prompt


Craft a concise and clear prompt that communicates your needs to ChatGPT. Break down the request into smaller tasks, and include essential information like the formula and desired format, just like this one:


“Please create a table that can be copied into Google Sheets. I want to be able to simply copy the data and paste it directly into Google Sheets using the formula Q = UA (ΔT1 - ΔT2) / ln(ΔT1 / ΔT2). Follow the format guidelines:

  1. Use this formula: Q = UA (ΔT1 - ΔT2) / ln(ΔT1 / ΔT2) "

Where:

Q is the rate of heat transfer (W)

U is the overall heat transfer coefficient (W/m²K)

A is the surface area of the heat exchanger (m²)

ΔT1 is the temperature difference between the hot and cold fluids at one end (K/°C/°F)

ΔT2 is the temperature difference at the other end (K/°C/°F)

  1. Column A : Variable (Write all the variables in this column.)

  2. Column B : Units (Write the corresponding units of that variable.)

  3. Column C : Values (This is where the input and output variables will be written. Write the cell reference instead of the variable name in the formulas so that it will automatically calculate the output variable after all user inputs are entered.)

The input variables are: U,A,ΔT1 ,ΔT2

The output variable is: Q


Step 4: Incorporate relevant context

To get the best answers, give helpful details and facts about the topic. This can help ChatGPT understand better. For example, we want ChatGPT to help with engineering stuff. So we give it a new question like this:


“Consider yourself a process engineer in the oil and gas industry. Please create a table that can be copied into Google Sheets. I want to be able to simply copy the data and paste it directly into Google Sheets using the formula Q = UA (ΔT1 - ΔT2) / ln(ΔT1 / ΔT2). Follow the format guidelines:

  1. Use this formula: Q = UA (ΔT1 - ΔT2) / ln(ΔT1 / ΔT2) "

Where:

Q is the rate of heat transfer (W)

U is the overall heat transfer coefficient (W/m²K)

A is the surface area of the heat exchanger (m²)

ΔT1 is the temperature difference between the hot and cold fluids at one end (K/°C/°F)

ΔT2 is the temperature difference at the other end (K/°C/°F)

  1. Column A : Variable (Write all the variables in this column.)

  2. Column B : Units (Write the corresponding units of that variable.)

  3. Column C : Values (This is where the input and output variables will be written. Write the cell reference instead of the variable name in the formulas so that it will automatically calculate the output variable after all user inputs are entered.)

The input variables are: U,A,ΔT1 ,ΔT2

The output variables are: Q


In simpler terms, we must integrate ChatGPT's system with engineering practices and research, or establish a context that enables ChatGPT to comprehend our prompt. By incorporating a single line into our prompt, we ultimately develop an improved version that could potentially surpass its previous copy.


Step 5: Test and refine


After crafting your initial prompt, test it with ChatGPT to gauge its response quality. It's crucial to iteratively refine your prompt based on the feedback received, making necessary adjustments to enhance the AI's comprehension and response quality.


Upon inputting our prompt, ChatGPT provided the following response:


To create a table that can be copied into Google Sheets, I will represent the table here using a text-based format. You can then copy the text below, and paste it directly into a new Google Sheets file:

Variable,Units,Values

U,W/m²K,<<Input U Value>>

A,m²,<<Input A Value>>

ΔT1,K/°C/°F,<<Input ΔT1 Value>>

ΔT2,K/°C/°F,<<Input ΔT2 Value>>

Q,W,=(C1*C2*(C3-C4))/LN(C3/C4)


Copy the content between the two horizontal lines and paste it directly into Google Sheets. This will create a table with the desired columns, variables, and formula for calculating the heat transfer rate, Q. Replace the placeholders like <<Input U Value>> with the actual values you have for each variable. The formula will then automatically calculate the value of Q in the designated cell.”


You may notice that ChatGPT's response is not a table, which can be easily remedied by using Google Sheets' Data tab and selecting Split text to columns.


NOTE: From experience, it is preferable to maintain data in CSV (comma-separated value) format instead of table form. Writing MS Excel/Google Sheet formulas in table form can cause cell references to merge with numbers (e.g., "=C5*23" becomes "=C523"), leading to formula failure. As a pro tip, command ChatGPT to rewrite the data as code inside a code block or snippet to avoid data merging.


If your MS Excel/Google Sheet formulas include commas (e.g., conditional formulas), it is better to instruct ChatGPT to rewrite the data using "|" as a separator. To transfer data with "|" as a separator, access the Data tab, click Split text to columns, and input "|" as the separator.


After pasting and splitting the data into columns in Google Sheets, you may find that the Q value doesn't reflect its output formula. To resolve this, format Column C as Number format using the Format tab.


Another issue may arise: the Q value is in error due to incorrect cell references in the formula. Instruct ChatGPT to correct the formula, specifying the proper cell locations:


There was an error in the output value of Q (#Value!). Please fix the formula. Also note that the column label should be in Row 1, so all the input and output values should start from C2.”

ChatGPT then responded:


“Apologies for the oversight. I have adjusted the formula to fix the error and shifted the input and output values to start from C2. You can copy the text below and paste it directly into a new Google Sheets file:


Variable,Units,Values

U,W/m²K,<<Input U Value>>

A,m²,<<Input A Value>>

ΔT1,K/°C/°F,<<Input ΔT1 Value>>

ΔT2,K/°C/°F,<<Input ΔT2 Value>>

Q,W,=(C2*C3*(C4-C5))/LN(C4/C5)


Copy the content between the two horizontal lines and paste it into Google Sheets. Replace the placeholders like <<Input U Value>> with the actual values you have for each variable. The formula will then automatically calculate the value of Q in the designated cell.”

Repeat the steps earlier with the updated data to ensure it works. Enter your input variables (U, A, ΔT1, ΔT2) and, voilà, you have a functional engineering calculation template.


You can apply these concepts and techniques to various formulas in a similar manner. Just remember to utilize the principles and methods discussed in this guide.


I hope this information has demonstrated how ChatGPT can be integrated into engineering systems and designs. As we continue to advance into this new industrial revolution, we will undoubtedly encounter more AI integrations in our work processes, making our jobs more efficient and streamlined. Embracing these technologies will help us to adapt and thrive in an increasingly connected and automated world.














5 views0 comments

Comments


bottom of page