<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Hammer Throw - Tag - Jorgen Bergstrom</title><link>https://bergstrom.org/tags/hammer-throw/</link><description>Hammer Throw - Tag - Jorgen Bergstrom</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>Jorgen Bergstrom</copyright><lastBuildDate>Sat, 01 Jun 2024 00:00:00 -0500</lastBuildDate><atom:link href="https://bergstrom.org/tags/hammer-throw/" rel="self" type="application/rss+xml"/><item><title>Can ChatGPT Predict Hammer Throw Distance?</title><link>https://bergstrom.org/posts/can_chatgpt_predict_hammer_distance/</link><pubDate>Sat, 01 Jun 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/can_chatgpt_predict_hammer_distance/</guid><description>Introduction In my previous articles in this series I have shown how to calculate how far spherical object will fly based on its initial velocity and angle. I used both physics and machine learning methods to solve the problem. In this article I will examine how much of this can be completely automated using a large language model like ChatGPT 4o.
Prompt: I am interested in predicting the distance as a function of the angle and velocity.</description></item><item><title>Neural Network Analysis of Hammer Throw Distance using PyTorch</title><link>https://bergstrom.org/posts/nn_hammer_distance_pytorch/</link><pubDate>Wed, 29 May 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/nn_hammer_distance_pytorch/</guid><description>Summary In this example I have used a “Sequential” neural network model to solve the regression problem of how far a hammer will fly given an initial velocity and angle. A sequential model is linear stack of layers, and allows you to create a Neural Network (NN) by simply adding layers sequentially. Both PyTorch and Keras are popular frameworks for building these NN models. Compared to Kears, the PyTorch approach is exposes more details which makes it more flexible and suitable for complex and dynamic models.</description></item><item><title>Neural Network Analysis of Hammer Throw Distance using Scikit-Learn</title><link>https://bergstrom.org/posts/nn_hammer_distance_sklearn/</link><pubDate>Tue, 28 May 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/nn_hammer_distance_sklearn/</guid><description>Summary The MLPRegressor in scikit-learn is a powerful tool for performing regression tasks using a multi-layer perceptron (MLP), which is a type of artificial neural network. It is a supervised learning algorithm that learns a function that maps input data to continuous output values. It can model complex relationships between features and the target variable.
Code Location You can find the code in this example here. import matplotlib.pyplot as plt import numpy as np from sklearn.</description></item><item><title>Neural Network Analysis of Hammer Throw Distance using TensorFlow Keras</title><link>https://bergstrom.org/posts/nn_hammer_distance_tensorflow/</link><pubDate>Tue, 28 May 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/nn_hammer_distance_tensorflow/</guid><description>Summary The Keras Sequential model is a simple and straightforward way to build neural networks in Keras, a high-level neural networks API running on top of TensorFlow. The Sequential model allows you to stack layers sequentially, meaning each layer has exactly one input tensor and one output tensor. You start by creating an instance of the Sequential model, then add layers to it one by one. Each layer, such as Dense (fully connected), Convolutional, or LSTM (Long Shor-Term Memory), is added using the add method.</description></item><item><title>Scikit-Learn Regression of Hammer Throw Distance</title><link>https://bergstrom.org/posts/regression_hammer_distance_sklearn/</link><pubDate>Mon, 27 May 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/regression_hammer_distance_sklearn/</guid><description>Linear Regression Linear regression is a fundamental statistical method used in machine learning to model the relationship between a dependent variable (often called the target or outcome) and one or more independent variables (often called features or predictors). In our example of hammer throwing we have 2 inputs (velocity and angle), and one output (distance). The regression equation therefore becomes: $d = b_0 + b_1 v + b_2 \alpha$. The goal of linear regression is to find the values of the coefficients ($b_i$) that minimize the difference between the predicted values and the actual values.</description></item><item><title>Hammer Throw: Generate Training Data</title><link>https://bergstrom.org/posts/hammer_throw_generate_training_data/</link><pubDate>Sun, 26 May 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/hammer_throw_generate_training_data/</guid><description>Training Data All machine learning algorithms require data for training the model. In this example, we can use physics calculations to generate a dataset with two input variables: velocity and angle, and one output variable: flight distance. The following Python code creates an input file named data_X.csv containing the input variables, and a results file with the flight distance. These files will be used in subsequent machine learning demonstrations.
import math import numpy as np import csv def calc_distance(angle, velocity): # fixed input parameters g = 9.</description></item><item><title>Hammer Throw Distance Calculation when No Air Drag</title><link>https://bergstrom.org/posts/hammer_distance_no_drag/</link><pubDate>Sat, 25 May 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/hammer_distance_no_drag/</guid><description>Introduction Welcome to the first article in my series on calculating the distance a projectile will travel based on its initial velocity and angle. Using hammer throwing, an Olympic track and field sport, as an example, I will demonstrate these calculations. However, the principles apply equally well to baseball and other sports.
Code Location You can find the code in this example in this file. For simplicity, I will focus solely on predicting the distance the hammer will fly, leaving the complete flight path for later discussion.</description></item><item><title>Physics Calculation of Hammer Throw Distance with Air Drag</title><link>https://bergstrom.org/posts/hammer_distance_with_drag/</link><pubDate>Sat, 25 May 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/hammer_distance_with_drag/</guid><description>Physics-Based Theory and Numerical Implementation The weight of the hammer ball is 7.26 kg, the material is steel and therefore the ball radius is given by $r = (3m/(4\pi \rho_s))^{1/3}$. The drag force from the air resistance is $F_d = \rho_a v^2 C_d A$, where $A$ is the cross-sectional area. In summary, Newton’s equation in the horizontal and vertical directions can be written in incremental form: $$ \displaystyle \Delta v_x = – \frac{F_d(v)}{m} \frac{v_x}{v} \Delta t$$ $$ \displaystyle \Delta v_y = – \left[ \frac{F_d(v)}{m} \frac{v_y}{v} + g \right] \Delta t$$</description></item></channel></rss>