Tychos

uno scenario con parecchi gadget:

https://www.tychos.org/en/scenarios/WmOMoF

come usare l'if senza impazzire:

https://www.tychos.org/en/scenarios/EUpS7q

Simulazione 1: teorema dell'impulso

  Initial State

        ball=Particle([0,0],5,"blue")

        ball.v = [0, 0]

        # Define a 2D force as a matrix

        force1 = [10, 0]

        # Define a mass property and give it a value

        ball.mass = 10

        g_xpos = Graph("X Position vs. Time")

        tabella=table.setColumns(["istante","posizione"])

    Calculation

        # Define a change in momentum

        dp = force1 * dt

        # Calculate the change in velocity

        dv = dp / ball.mass

        # Update the ball's velocity

        ball.v = ball.v + dv

        # Update the ball's position

        ball.pos = ball.pos + ball.v * dt

        g_xpos.plot(t,ball.pos[X])

        table.addRow([t, x])

RISULTATO: