pub struct CollocationProblem<S: Scalar> { /* private fields */ }Expand description
Builder for direct collocation optimal control problems.
Implementations§
Source§impl<S: Scalar> CollocationProblem<S>
impl<S: Scalar> CollocationProblem<S>
Sourcepub fn free_final_time(self, tf_init: S, tf_bounds: (S, S)) -> Self
pub fn free_final_time(self, tf_init: S, tf_bounds: (S, S)) -> Self
Enable free final time.
Sourcepub fn n_intervals(self, n: usize) -> Self
pub fn n_intervals(self, n: usize) -> Self
Set the number of collocation intervals.
Sourcepub fn scheme(self, scheme: CollocationScheme) -> Self
pub fn scheme(self, scheme: CollocationScheme) -> Self
Set the collocation scheme.
Sourcepub fn terminal_cost<F>(self, f: F) -> Self
pub fn terminal_cost<F>(self, f: F) -> Self
Set the terminal cost phi(x(tf), tf).
Sourcepub fn running_cost<F>(self, f: F) -> Self
pub fn running_cost<F>(self, f: F) -> Self
Set the running cost L(t, x, u).
Sourcepub fn terminal_constraint<F>(self, f: F) -> Self
pub fn terminal_constraint<F>(self, f: F) -> Self
Set terminal equality constraints psi(x(tf)) = 0.
Sourcepub fn path_constraint<F>(self, f: F, bounds: &[(S, S)]) -> Self
pub fn path_constraint<F>(self, f: F, bounds: &[(S, S)]) -> Self
Set path constraints with bounds: lo <= c(t, x, u) <= hi.
Sourcepub fn control_bounds(self, bounds: &[(S, S)]) -> Self
pub fn control_bounds(self, bounds: &[(S, S)]) -> Self
Set bounds for each control variable (applied at every node).
Sourcepub fn state_bounds(self, bounds: &[(S, S)]) -> Self
pub fn state_bounds(self, bounds: &[(S, S)]) -> Self
Set bounds for each state variable (applied at every node).
Sourcepub fn param_bound(self, idx: usize, lo: S, hi: S) -> Self
pub fn param_bound(self, idx: usize, lo: S, hi: S) -> Self
Set bounds for a specific parameter.
Sourcepub fn solve(self) -> Result<CollocationResult<S>, OcpError>
pub fn solve(self) -> Result<CollocationResult<S>, OcpError>
Solve the collocation problem.
Auto Trait Implementations§
impl<S> Freeze for CollocationProblem<S>where
S: Freeze,
impl<S> !RefUnwindSafe for CollocationProblem<S>
impl<S> Send for CollocationProblem<S>
impl<S> Sync for CollocationProblem<S>
impl<S> Unpin for CollocationProblem<S>where
S: Unpin,
impl<S> UnsafeUnpin for CollocationProblem<S>where
S: UnsafeUnpin,
impl<S> !UnwindSafe for CollocationProblem<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more