@@ -224,9 +224,9 @@ function p_alias!(p, p_ocp, a, e; log=false)
224224 a isa Symbol || return __throw (" forbidden alias name: $a " , p. lnum, p. line)
225225 aa = QuoteNode (a)
226226 ee = QuoteNode (e)
227- for i in 1 : 9
228- p. aliases[Symbol (a, CTBase. ctupperscripts (i))] = :($ a^ $ i)
229- end
227+ # for i in 1:9
228+ # p.aliases[Symbol(a, CTBase.ctupperscripts(i))] = :($a^$i) # todo: remove? (cf. such aliases now removed for variable, state and control )
229+ # end
230230 p. aliases[a] = e
231231 code = :(LineNumberNode (0 , " alias: " * string ($ aa) * " = " * string ($ ee)))
232232 return __wrap (code, p. lnum, p. line)
@@ -246,13 +246,10 @@ function p_variable!(p, p_ocp, v, q; components_names=nothing, log=false)
246246 qq = q isa Int ? q : 9
247247 for i in 1 : qq
248248 p. aliases[Symbol (v, CTBase. ctindices (i))] = :($ v[$ i])
249- end # make: v₁, v₂... if the variable is named v
249+ end # make v₁, v₂... if the variable is named v
250250 for i in 1 : qq
251251 p. aliases[Symbol (v, i)] = :($ v[$ i])
252- end # make: v1, v2... if the variable is named v
253- for i in 1 : 9
254- p. aliases[Symbol (v, CTBase. ctupperscripts (i))] = :($ v^ $ i)
255- end # make: v¹, v²... if the variable is named v
252+ end # make v1, v2... if the variable is named v
256253 if (isnothing (components_names))
257254 code = :($ prefix. variable! ($ p_ocp, $ q, $ vv))
258255 else
@@ -326,13 +323,10 @@ function p_state!(p, p_ocp, x, n; components_names=nothing, log=false)
326323 nn = n isa Int ? n : 9
327324 for i in 1 : nn
328325 p. aliases[Symbol (x, CTBase. ctindices (i))] = :($ x[$ i])
329- end # Make x₁, x₂... if the state is named x
326+ end # make x₁, x₂... if the state is named x
330327 for i in 1 : nn
331328 p. aliases[Symbol (x, i)] = :($ x[$ i])
332- end # Make x1, x2... if the state is named x
333- for i in 1 : 9
334- p. aliases[Symbol (x, CTBase. ctupperscripts (i))] = :($ x^ $ i)
335- end # Make x¹, x²... if the state is named x
329+ end # make x1, x2... if the state is named x
336330 if (isnothing (components_names))
337331 code = :($ prefix. state! ($ p_ocp, $ n, $ xx))
338332 else
@@ -362,13 +356,10 @@ function p_control!(p, p_ocp, u, m; components_names=nothing, log=false)
362356 mm = m isa Int ? m : 9
363357 for i in 1 : mm
364358 p. aliases[Symbol (u, CTBase. ctindices (i))] = :($ u[$ i])
365- end # make: u₁, u₂... if the control is named u
359+ end # make u₁, u₂... if the control is named u
366360 for i in 1 : mm
367361 p. aliases[Symbol (u, i)] = :($ u[$ i])
368- end # make: u1, u2... if the control is named u
369- for i in 1 : 9
370- p. aliases[Symbol (u, CTBase. ctupperscripts (i))] = :($ u^ $ i)
371- end # make: u¹, u²... if the control is named u
362+ end # make u1, u2... if the control is named u
372363 if (isnothing (components_names))
373364 code = :($ prefix. control! ($ p_ocp, $ m, $ uu))
374365 else
0 commit comments