Here you can solve interesting problems using whatever programming language you like. Also you will earn SBI and sometimes STEM by doing so.

Also you might learn new things by doing so.

The tasks will be rather hard to solve without a programmable computer and some programming skills, but if you want to add a few million numbers by hand or similar, I would still give you the reward.*↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓*

# Rules

#### No upvote, No resteem, No follow required!

#### I will give 6 SBI randomly to those who solved the problem.

#### If two pieces of code are to closely related I might consider the later of them as copied which results in no prize for that person.

#### You have 4 days to solve it.

#### Even though this is about computation I will also accept algebraic solutions if you find one.

#### In order to get accepted you need to somehow attach your code.

*↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓*

# Problem

Today I want you to write some kind of physics simulation:

You should simulate a pendulum!

A pendulum can be described by the following equation, where phi is the current angle, gamma is some dampening constant and l is the length:

To solve this you can approximate dt with some small value and use the formula to calculate the change in velocity and position each time step.

Now you have to solve 2 problems that show that you made a working model:

- Consider a pendulum of length 1m and dampening constant 0.01/s and starting velocity of 360 °/s starting at a starting angle of 0°.

How many times will it circle around until it settles to a swinging movement. - What would the dampening constant need to be for the pendulum to stop after completing only 3 circles?

*↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓*

To everyone who already participated in a past contest, come back today and try a new problem(tell me if you don't want to be tagged):

@crokkon @kaeserotor @tonimontana

In case no one gets a result(which I doubt), I will give away the prize to the person who makes the most constructive description why the problem is too hard in your opinion.

*↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓↑↓*

@contrabourdon sponsors my contests with 2 STEEM weekly.

You can support him by using a witness vote on untersatz, so he can further support this and other contests.

## Comments 6

ok so here is my solution:

The output gives:

98.79413003199605

450.64399999625556

0.390625

2.536477974411837

You should be careful with degrees and radians. Your whole program works with degrees EXCEPT the numpy.sin(x) function which only accepts radians. So I think you just need to replace 360° with 2π everywhere.

You are right, I adjusted it and also had to manipulate the max_time approach. Now my results are:

In my simulation it makes one round.

It seems I took the worst example I could possibly take :(

The difference between your

`g = 9.81 m/s²`

and the real average`g = 9.80665 m/s²`

decides wether it succeeds over the tipping point or stops right before it.No need for you to change anything. This rounding error is ignored since g is not that constant all over earth.

Yes I remembered the value of g from school and already wondered where you are from and if g is different there :D

But what a fun coincidence :D