Week 2. Computer-Aided Design

Task:
Model (raster, vector, 2D, 3D, rendering, animation, simulation, …) a possible final project, compress your images and videos, and publish a description with your design files on your page.

Week’s Goals

Last week started off on the wrong foot. I barely had time to do anything.I forgot that I never follow my own advice.

This week I’m going to be more disciplined. The first thing I’m doing is defining my goals and setting a deadline to achieve them. It’s one of my favorite weeks because I love trying out new software. In order of preference, I’m planning to:

I think I may have overdone it. If I manage to do 1/4 of this, I’ll be more than happy.

OpenFOAM

The Navier-Stokes equation is a set of partial differential equations that describe fluid motion. In vector form and in a three-dimensional coordinate system, the Navier-Stokes equations for an incompressible fluid are:

\rho \left( \frac{\partial \mathbf{v}}{\partial t} + (\mathbf{v} \cdot \nabla)\mathbf{v} \right) = -\nabla p + \mu \nabla^2 \mathbf{v} + \rho \mathbf{g}

where:

This equation describes the conservation of momentum and the relationship between pressure, viscosity, and fluid acceleration. Solving these equations can be complex, especially in nonlinear or turbulent situations. If the fluid is compressible, things get a bit more complicated because \rho is not constant but can vary in time and space.

\frac{\partial \rho}{\partial t} + \nabla \cdot (\rho \mathbf{v}) = 0

These equations cannot be solved analytically; numerical methods must be used. That’s where OpenFOAMOpen Source Field Operation and Manipulation

, an open-source suite for numerical fluid simulations, comes in. OpenFOAM doesn’t have a graphical interface. All files, including the geometry, initial conditions, boundary conditions, model, etc., are introduced via text filesIf you use a graphical interface, you’ll soon be unemployed. Why do you think so much is invested in training language models?

.

Wing Profile Simulation

under development

I fly on an ICP Savannah S airplane with a modified NACA-65018The numbers are parameters that can be input into equations to generate the cross-sectional shape and calculate its properties.

wing profile. It’s not very fast, but it can take off and land on very short distances and fly at very low speeds without stallingA condition that occurs when the wing loses lift by exceeding the critical angle of attack.

. Near the leading edge of the wing, there are some plastic parts called vortex generators. Their role is to create micro-turbulences to prevent the boundary layer from detaching from the wing. The goal in OpenFOAM is to simulate a section of the wing with and without vortex generators and verify the difference.

Incompressible Fluid

under development

Ondsel

under development

Blender

under development

Javascript

under development

Artificial Intelligence

We’ve made progress, but we still have a long way to go. Today, February 5, 2024, I asked the 4 most well-known artificial intelligences (ChatGPT 3.5, ChatGPT4 Turbo, Bing, and Bard) to do something very simple:

I explain what TikZ is further down

Draw an Ikigai diagram in TikZ

I have two observations and one conclusion: The first observation is that none of the 4 intelligences did a good job. The second observation, also interesting, is that it is indistinguishable which one is especially better than the others. Despite some models being technically superior to others. The conclusion, therefore, is that it seems clear that the “artificial” intelligences have little to no reasoning ability in areas where they have not been trained. Even knowing the rules for creating the diagram, they were incapable of drawing 4 circles and a few labels.

Who’s who? Name which AI made each of these diagrams. Solution at the bottom of the page.

Interestingly, Bard (Gemini Pro model) couldn’t even generate correct code. I had to pass Bard’s code to Bing to have it corrected. Supposedly Bing is ChatGPT4, but I think that copy came out blurry. These models need a large amount of training data to recognize patterns; they do not reason in the human sense. I could have spent the entire afternoon trying to get the models to move the circles to their correct positions. There are people who do that, but I find it absurd. There’s a huge effort to achieve General AI capable of reasoning like a human. However, for now, we’ll have to continue training the models in the areas we want. That’s one of my goals at Fab Academy.

Images

under development

Imagemagick

It’s good for a bazillion things. You can slap a watermark on an image.
Or combine two or more images horizontally so that:
a) They have the same height
b) The images are separated by a transparent space

The composite photograph of the airplane and the airfoil profile was done this way.

montage savannah.jpg naca65018.png -geometry +5+0 -tile 2x1\ 
  -resize x800 -background none -gravity West -extent x800 airplane.webp

PGF/TikZ

TikZ is a package for \LaTeX that allows creating figures and graphics. I used to use it in college. I’ve created the Ikigai figure I’ll be using on the final project page.
As you see, I’m using anything that uses code to be generated.

Source code

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}
% Circles
\fill[cyan!45, opacity=0.5, draw=cyan] (0,1) circle (2cm);
\fill[magenta!45, opacity=0.5, draw=magenta] (0,-1) circle (2cm);
\fill[yellow!45, opacity=0.5, draw=orange] (1,0) circle (2cm);
\fill[black!15, opacity=0.4, draw=gray] (-1,0) circle (2cm);
% Labels
\node[font=\small, align=center] at (-2.8,0) {What the\\ World needs};
\node[font=\small, align=center] at (2.8,0) {What you\\ are good at};
\node[font=\small, align=center] at (0,-2.4) {What you\\ can be paid for};
\node[font=\small] at (0,2.4) {What you love};
% Small Labels
\node[font=\tiny] at (1.35,-1.2) {Profession};
\node[font=\tiny] at (1.35,1.2) {Passion};
\node[font=\tiny] at (-1.35,-1.2) {Vocation};
\node[font=\tiny] at (-1.35,1.2) {Mission};
% Title
\node[font=\large] at (0,0) {Ikigai};
\end{tikzpicture}
\end{document}

To generate the svg figure you have to execute the command:
pdflatex ikigai.tex && pdf2svg ikigai.pdf ikigai.svg

Audio and video

under development

ffmpeg

Incredibly useful for a myriad of operations. It used to be hard to memorize the commands, but now you can just ask a language model.

yt-dlp

I use this terminal utility to download videos from Fab Academy hosted on Youtube or Vimeo. For example:

yt-dlp --write-sub --all-subs [Video URL]

Manim

You’ve likely seen a video by 3blue1brown.
Manim is the Python library he created to generate his animations.
Here’s my hello world!: manim -pqh hello_manim.py AnimatedSquareToCircle


Source code

from manim import *
class AnimatedSquareToCircle(Scene):
    def construct(self):
        circle = Circle()  # create a circle
        square = Square()  # create a square

        self.play(Create(square))  # show the square on screen
        self.play(square.animate.rotate(PI / 4))  # rotate the square
        self.play(
            ReplacementTransform(square, circle)
        )  # transform the square into a circle
        self.play(
            circle.animate.set_fill(BLUE, opacity=0.2)
        )  # color the circle on screen

Sonic Pi

I’m putting together a session using some audio samples from Fab Academy.
I can’t share more just yet.


Source code

use_bpm 130

live_loop  do # this is a metronome to sync the beats
  sleep 1
end

define  do |pattern|
  pattern.ring.tick == "x"
end

live_loop ,  do
  a = 2
  sample , a, 8, 110 if pattern("x-----x---x--x--")
  sleep 0.25
end

live_loop ,  do
  sleep 1
  sample , 1
  sleep 1
end

live_loop ,  do
  sample , 0.5 if pattern("x-x-x-x-xxx-x-x-")
  sleep 0.125
end

Conclusions

under development

Participants of Fab Academy are heroesInstructors are heroes too. Especially those from Puebla.

. I had completely forgotten how tough the course is. I admit it’s been a challenge for me. It’s Sunday, and I’ve accomplished less than 5% of what I had planned. Moreover, I keep making changes to the template, and when I fix one thing, I break another.

I’m glad to be participating again as a student. I still smile from the back row when you’re called to the board, but not as much. I’m more human. This experience will improve my social skills as an instructorI have a somewhat peculiar educational style. You could say I’m more like Homelander than Superman.

.

I’m particularly proud of putting into practice engineering skills I thought I had forgotten. Fab Academy has been the motivation I needed. I believe that combining these competencies with the power of AI, amazing results can be achieved.

Answer to the artificial intelligence section question: From left to right: GPT3.5, GPT4, Bing, and Bard. Did you guess it?