Skip to content

Instantly share code, notes, and snippets.

@aszekMosek
aszekMosek / lights.py
Created December 12, 2023 09:31
Christmas lights
# Some informal experiments with Christmas Lights for the MOSEK blogpost
from mosek.fusion import *
import numpy as np
import sys
def exRandom():
D = 2 # Dimension of the tree
N = 20 # Number of lights
P = 35 # Number of decorations to shine upon
T = 10 # Tree top
from mosek.fusion import *
import numpy as np
import matplotlib.pyplot as plt
import sys, itertools
# For a scalar variable x returns a new variable
# exactly representing abs(x)
def abs(M, x):
absx = M.variable()