Gyroid mathematical model using primary principles