Physics
Expand the curriculum with exciting experiments in dynamics and gain insight into how modeling and simulation can enhance and strengthen understanding of physics and math concepts.
Golf and Soccer
This example will show how you can create very different scenarios using some concepts in SystemModeler and Modelica. In this case, both a soccer kick and a golf strike are included in the same model, using something called replaceable components.
To run this example, you'll need
The latest versions of System Modeler and Mathematica.
Please make a selection:
Get afree trial Continue
with download
From Soccer to Golf
Inside the sport model component are the two different models for golf and soccer. By redeclaring the top-layer sport model, you can choose which of these models to use.
Having preconfigured options that the user can choose between when changing parameters reduces the risk of making errors by trying to modify a scenario manually. Let the big changes be done by redeclaring models and the small changes, such as how fast the golf swing should be, be decided manually by the user.
Redeclare Models
If you redeclare the top-layer sport model to use the soccer model, it is basically the same model as was analyzed in the Bend It Like Beckham example. If you want to see what can be done with the soccer model, check out that example! Here you can focus on what the golf model contains.
Modeling Golf Club Hitting Golf Ball
The equations modeling the club hitting the ball are relatively simple and taken from the book Physics for Game Programmers. The velocity of the ball after striking is dependent on the velocity of the club at impact, the loft angle of the club, and the mass of the club and ball. To model different clubs, each club has a different club mass, loft angle, and impact velocity. To make it easy for the user to change clubs, the replaceable component Golf Bag has been implemented, with preconfigured different clubs inside.
How does a 3 iron compare to a 9 iron? First simulate the golf model with a 3 iron and then simulate the same model with a 9 iron. This is done by just redeclaring the club in the Golf Bag component and simulating again. The loft angles for the two clubs are 21° for the 3 iron and 43° for the 9 iron. Both strikes will be identical except for the different club properties.
Comparing the 3 iron and the 9 iron, they have different properties when it comes to club mass, loft angle, and striking velocity. Since the 3 iron has a lower loft angle, it will launch the ball at a lower inclination angle compared to the 9 iron. In the figures above, the strikes in the two cases are identical, apart from the difference in club properties. It is easy to see that the 3 iron will make the ball go further, but not as high as the 9 iron.
Effects of Drag Force and Magnus Force
You can analyze how the drag force and Magnus force affect the trajectory of a ball. The simplest way to see the effect of the forces is to compare the cases of a model without drag force and one with drag force, and the same for the Magnus force.
How to Cheat at Golf
It is really easy to understand how the ball is affected by these forces, but it might be a bit difficult to grasp from just using mathematics. You could have a real advantage if you managed to shoot the ball utilizing the Magnus effect but discarding the drag. Sadly, this is impossible. However, the plot shows quite well the effect of both the decelerating drag force and the lifting Magnus force.
Wolfram System Modeler
Try
Buy
System Modeler is available in English
and Japanese
on Windows, macOS & Linux »
Questions? Comments? Contact a Wolfram expert »