In my latest post, I explore the mechanics of Coulomb friction, focusing on how it affects motion between a body and a surface. I explain the distinction between static and kinetic friction, describing the force thresholds required to initiate movement and the constant resistance during sliding. Additionally, I cover tipping scenarios, where instead of slipping, a body might rotate around a contact edge due to an applied force. This creates a situation where the normal force shifts and the system reaches an impending tip condition.
In this post, I explore the fundamental principles of cable systems, focusing on how they operate under various loading conditions. Cables, which only resist tension, are incredibly efficient in spanning large distances with minimal material. I highlight examples like power lines, suspension bridges, and ski lifts to demonstrate their versatility. Whether it's handling self-weight, concentrated loads, or distributed loads, cables adapt their shape to balance forces. I also discuss the advantages of using cable systems in construction, particularly for their flexibility, strength under tensile forces, and ability to create lightweight, visually striking designs.
In my exploration of cantilever beams subjected to external forces, I focus on how internal forces manifest as shear forces and bending moments. Shear forces act perpendicular to the beam's cross-section, causing internal sliding, while bending moments induce curvature. I also examine how the equilibrium is maintained by these forces at various sections of the beam. Additionally, I cover the relationship between distributed loads, shear forces, and bending moments, including the differential equations that govern them. These insights are crucial for understanding the behavior of beams under load, particularly in mechanical and structural applications.
Recently, I developed a custom syntax highlighting solution for CMakeLists.txt files, targeting core elements like commands, variables, and quoted strings. The tool enhances readability by wrapping essential constructs in distinct CSS classes, streamlining the process of navigating and understanding build configurations.
In my work as a developer writing high-performance C++ libraries, I sometimes need to integrate them with Python using PyBind11. This lightweight tool allows me to maintain the speed and efficiency of C++ while providing Python's flexibility for scripting and automation. In this post, I will share tips and techniques for exposing C++ functions, classes, and handling memory directly between Python and C++. By using PyBind11, I ensure minimal overhead and optimal performance when working across the two languages, whether manipulating arrays, vectors, or binding complex data structures.
In this post, I will explain the fundamentals of trusses and outline the methods I use to analyze them. Trusses are structural frameworks designed to carry loads using triangular units and straight members that only experience axial forces. My approach involves assumptions that simplify the analysis, such as frictionless pin joints and negligible member weight, allowing for efficient force distribution calculations. I focus on the method of joints, where forces meet at single points, and the method of sections, which isolates portions of the truss for targeted analysis, ensuring clear and accurate force determination.
In this post, I will explore the key principles of 2-force and multi-force members in structural mechanics. A 2-force member is subjected to two equal and opposite forces acting along its axis, experiencing only tension or compression. I will also discuss multi-force members, which encounter forces at multiple points and can experience tension, compression, shear, and bending. By applying equilibrium conditions, I can analyze these components for complex structures like frames and machines. This article provides insights into the behavior of such members, aiding in understanding their roles in various mechanical and engineering applications.
In this blog post, I explore my approach to stabilizing the inverted pendulum on a cart using neural networks (NN) and genetic algorithms (GA). The pendulum system, well-known for its instability, is modeled using classical feedback control and augmented by an evolving NN trained with GA. This combined strategy adjusts the control force applied to the cart, maintaining the pendulum in a stable state. By iterating through generations, the GA fine-tunes the NN to improve control precision, outperforming traditional methods in nonlinear scenarios. My work focuses on the interplay between control theory and machine learning for advanced engineering applications.
In this article, I explore the implementation of feedback control for a simple pendulum system, focusing on stabilizing the pendulum near its equilibrium points. I derive the system's equations of motion using Newton's second law and linearize them for control design. To optimize the feedback control strategy, I developed a neural network trained using a genetic algorithm. This approach adjusts the control gain dynamically to minimize the pendulum's deviation from the desired reference point, making the system stable. I discuss how the genetic algorithm evolves the network, improving its performance over time, and provide code examples from my project.
In this post, I explore the quantum behavior of beat notes between laser beams using a beam splitter, focusing on heterodyne detection. By analyzing the interaction of two input laser modes and their resulting quantum states, I show how the photocurrent can be expressed in terms of photon flux, allowing precise measurements of the beat note. I highlight how the technique is used to stabilize laser frequencies and measure small quantum signals using a strong local oscillator. This method proves valuable in targeting atomic transitions and offers practical insights for experiments involving quantum fields and laser sources.
In this post, I will walk through my process of training neural networks on the MNIST dataset using both Stochastic Gradient Descent (SGD) and Genetic Algorithms (GA). I implemented three C++ programs that efficiently handle the loading of MNIST data, training, and testing. The programs highlight the effectiveness of SGD for image classification tasks, achieving over 90% accuracy, while also showing the limitations of GA for this specific problem. My work demonstrates practical insights into training neural networks, offering a foundation for further research in machine learning and optimization techniques.
In my implementation of feedforward neural networks using genetic algorithms (GA), the ANN_MLP_GA class builds on the base class ANN_MLP by introducing population-based training. Unlike stochastic gradient descent (SGD), which iterates over a single network, GA optimizes a population of networks through evolutionary methods such as selection, crossover, and mutation. The class manages the population of networks, evolves them over generations, and implements methods to train and test the population. This approach allows for broader exploration of the solution space.
In my extended implementation of the base class ANN_MLP, the ANN_MLP_SGD class focuses on training feedforward neural networks using stochastic gradient descent (SGD). The class builds on the base functionalities to implement the logic for training and testing the network using mini-batches, updating the network's weights and biases incrementally based on computed gradients. Core methods like TrainSGD and `TestSGD` handle training iterations and evaluate the network's performance. By leveraging the efficient gradient-based optimization provided by SGD, this derived class ensures the network learns effectively from data.