-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
good first issueGood for newcomersGood for newcomersinternal devModification to the code is requested and should not affect user experimentModification to the code is requested and should not affect user experiment
Description
Make an AI assistant to correct / update a definition of an optimal control problem.
aidefinition(
code="ocp = @def begin
t ∈ [0, 1], time
x ∈ R², state
u ∈ R, control
x(0) == [ -1, 0 ]
x(2) == [ 0, 0 ] # this should be x(1)
ẋ(t) == [ x₂(t), u(t) ]
∫( 0.5u(t)^2 ) → min
end",
prompt=""
)
and this correct the definition. The argument prompt
is something we can write which is added to the inner prompt. For instance, we could write:
aidefinition(
code="ocp = @def begin
t ∈ [0, 1], time
x ∈ R², state
u ∈ R, control
x(0) == [ -1, 0 ]
x(2) == [ 0, 0 ] # this should be x(1)
ẋ(t) == [ x₂(t), u(t) ]
∫( 0.5u(t)^2 ) → min
end",
prompt="Replace the state x by q."
)
Remark. The function returns the corrected code and a log if asked to explain the changes.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersinternal devModification to the code is requested and should not affect user experimentModification to the code is requested and should not affect user experiment