home | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Java example source code file (FieldStepInterpolator.java)

This example Java source code file (FieldStepInterpolator.java) is included in the alvinalexander.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Learn more about this Java project at its project page.

Java - Java tags/keywords

fieldodestateandderivative, fieldstepinterpolator, realfieldelement

The FieldStepInterpolator.java Java example source code

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.commons.math3.ode.sampling;

import org.apache.commons.math3.RealFieldElement;
import org.apache.commons.math3.ode.FieldODEStateAndDerivative;

/** This interface represents an interpolator over the last step
 * during an ODE integration.
 *
 * <p>The various ODE integrators provide objects implementing this
 * interface to the step handlers. These objects are often custom
 * objects tightly bound to the integrator internal algorithms. The
 * handlers can use these objects to retrieve the state vector at
 * intermediate times between the previous and the current grid points
 * (this feature is often called dense output).</p>
 *
 * @param <T> the type of the field elements
 * @see org.apache.commons.math3.ode.FirstOrderFieldIntegrator
 * @see FieldStepHandler
 * @since 3.6
 */

public interface FieldStepInterpolator<T extends RealFieldElement {

  /**
   * Get the state at previous grid point time.
   * @return state at previous grid point time
   */
  FieldODEStateAndDerivative<T> getPreviousState();

  /**
   * Get the state at current grid point time.
   * @return state at current grid point time
   */
  FieldODEStateAndDerivative<T> getCurrentState();

  /**
   * Get the state at interpolated time.
   * <p>Setting the time outside of the current step is allowed, but
   * should be used with care since the accuracy of the interpolator will
   * probably be very poor far from this step. This allowance has been
   * added to simplify implementation of search algorithms near the
   * step endpoints.</p>
   * @param time time of the interpolated point
   * @return state at interpolated time
   */
  FieldODEStateAndDerivative<T> getInterpolatedState(T time);

  /** Check if the natural integration direction is forward.
   * <p>This method provides the integration direction as specified by
   * the integrator itself, it avoid some nasty problems in
   * degenerated cases like null steps due to cancellation at step
   * initialization, step control or discrete events
   * triggering.</p>
   * @return true if the integration variable (time) increases during
   * integration
   */
  boolean isForward();

}

Other Java examples (source code examples)

Here is a short list of links related to this Java FieldStepInterpolator.java source code file:



my book on functional programming

 

new blog posts

 

Copyright 1998-2019 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.