File Exchange > Data Analysis >    Fit ODE

Author:
OriginLab Technical Support
Date Added:
11/27/2018
Last Update:
6/27/2022
Downloads (90 Days):
136
Total Ratings:
7
File Size:
1093 KB
Average Rating:
File Name:
Fit ODE.opx
File Version:
1.40
Minimum Versions:
License:
Free
Type:
App
Summary:

Fit ordinary differential equation

Screen Shot and Video:
Description:

  • Purpose
    This app is capable of fitting ordinary differential equation.
  • Installation
    Download the file "Fit ODE.opx", and then drag-and-drop onto the Origin workspace. An icon will appear in the Apps gallery window.
  • Operation
    1. Import the related XY data into Origin.
    2. Create a 2d scatter or line plot using the imported data.
    3. With this graph activated, click the icon of this app from the Apps gallery window to bring up the main dialog.
    4. Then set the equation, integration for equation and initial conditions.
    5. Click the Create FDF button to create fitting function with the settings. You can also save the fitting function by clicking Save FDF button.
    6. Click Fit Control button to open Fit Control dialog.
    7. In Fit Control dialog, input the initial values for parameters, or load/save/reinit the parameters. You can also change the settings for iteration, together to change the output result options. Click 1 Iter./Fit button to perform the fitting. And click OK button to go back the main dialog.
    8. In the main dialog, if fitting is not done yet, you can also click the Fit button to perform fitting. Click OK button to generate the report.
  • Dialog Settings:
    • Equation(s) Group
      • Type: Options include
        • Equation: Solve ordinary differential equation.
        • System of Equations: Solve system of first order differential equations.
      • Order: If Type is Equation, this specifies order of the differential equation.
      • y'': Specify the ordinary differntial equation.
      • Parameters: The fitting parameters parsed from the specified equation.
      • Number of Equations: If Type is System of Equations, this specifies number of equations of the system.
      • dy#/dx =: Specify the system of differential equations.
      • Choose Dependent: For system of differential equations, this is for choosing y# as dependent of fitting, at lease one is chosen.
      • y#: Select plot data for the dependent.
    • Integration
      • Range: Specify the start and end values of integration interval.
      • Number of Points: Specify number of points to output. The points are evenly sampled from the integration interval.
      • Method: Specify integration algorithm. Options include Runge-Kutta (usually this is your first choice), Adams, and BDF(Stiff) (Backward Differentiation Formulae, is suitable for stiff problems). For Runge-Kutta, RK order is avaiable, and options include RK23, RK45 and RK78.
      • Relative Tolerance: This is for controlling the error in the integration, and is avaiable for Runge-Kutta and BDF(Stiff) methods. When method is Runge-Kutta, experience suggests for relative tolerance are as following according to RK order: RK23 - (1e-2~1e-4), RK45 - (1e-3 1e-6), RK78 - (1e-5).
      • Mixed Tolerance: This is available when method is Adams. It is used to control the error in the integration.
    • Initial Conditions
      • Initial Value: Specify initial values of the independent variable.
      • Include as Parameter: If include the initial value as parameter of the fitting function.
      • Parameter Name: Specify the parameter name of the initial value used in fitting function.
      • Fixed: Specify if to fix this initial value in fitting function.
    • Output Derivatives: Specify derivatives to output. This is available only when Equation has been selected for Type and Order is larger than 1.
    • Buttons
      • Fit Control: Open the Fit Control for the fitting settings.
      • Fit: Perform the fitting with the created/saved FDF (fitting function) on the current data.
      • OK: Output report and close dialog. If fitting is not done, make it done first.
      • Create FDF: Create FDF file (fitting function) using the current settings.
      • Save FDF: Save the created FDF file to User Files Folder.
      • Cancel: Do nothing but close dialog.
    • Fit Control Dialog
      • Parameters Tab: In the table, all parameters are listed. You can change their initial values, whether to fix them, and set lower/upper bounds for them.
      • Fit Control Tab: Please refer to Fit Control and Constraints for details.
      • Quantities Tab: Please refer to Quantities to Compute for the details.
      • Buttons
        • Load: Load initial settings for parameters.
        • Save: Save the current initial settings of parameters.
        • Reinit: Re-initialize parameter values.
        • 1 Iter.: Perform 1 iteration with current parameter settings.
        • Fit: Perform fitting until converged or the max number of iterations is reached, or meet the tolerance.
        • OK: Close the Fit Control dialog.

Updates:

v1.4: Check for missing value
v1.3: Fix bug for German OS issue
v1.2: Support for solving system of equations with different datasets
v1.1: Fix bug using reserved function name as parameter name

Reviews and Comments:
10/09/2020OriginLabHi QIQI521,
Please use “exp(1)” to represent “'e=2,178281828...”.

10/05/2020QIQI521How is 'e=2,178281828...' represented in the equation, because the software automatically recognizes 'e' as a parameter, but it's not a parameter it's just a constant

09/22/2020OriginLabHi ggiorgianni, the algorithm is the same as that of NLfit dialog. More information here:
https://www.originlab.com/doc/Origin-Help/NLFit-Theory#:~:text=The%20aim%20of%20nonlinear%20fitting,points%20closer%20to%20the%20curve.

09/21/2020ggiorgianniHello, I was curious about the fitting algorithm. Is this app using the least square method or other specialized methods for estimating the parameters for ODE systems?

09/21/2019tmdxyz2006Dear Sir, I have sent an email to tech@originlab.com

09/20/2019OriginLabHi tmdxyz2006@163.com,

1) There should not be any problem to specify parameter with more than 2 characters
2) Could you provide more details what operations you did when you saw the delay?
3) There is no problem to include the dependent variable in ODE functions. If you specify the type as equation, dependent variable is y, and if you specify system of equations, you can still add y in your equation. What is your equation and how did you use the tool to make you think that does not work?

However, It would help if you can send email to tech@originlab.com, we can further discuss your problems in your case.

09/19/2019tmdxyz2006when fitting one ODE, it works well. But when fitting system of equations, there will be many questions.
(1) the character number of parameter seems can not be longer than 2 ?
(2) the parameters dialogue always responses delay.
(2) the ODE function can not include the dependent variable itself, which is common in ODE equations.