# 1D Cubic Line Fit

### Description

• These step-by-step instructions will guide you through data fitting by using one-dimensional Hermite basis function.
• This fitting concept is to initiate the line element and then choose the proper basis function to fit the initial element and the data.
• An automated script that runs this tutorial is included in the Continuity installation: examples\data07\fitting1dCircle.py. To run it, click File→Scripts→Read script…

### Start Continuity

• Launch the Continuity Client
• check the fitting box under Use Modules:

• Click OK to bring up the main window

### Setting up the geometry

• Select rectangular cartesian in the Global Coordinates: pop-up menu

• Click OK to submit Coordinate Form

• Choose Hermite Basis Function→1D→Cubic

• Verify that the list of basis functions now contains:
• Cubic Hermite 3
• Click OK to submit Basis Form

• Click Import/Export/Graph button to open Continuity Table Manager

• Select tab-delimited nodes file ( nodes.xls )

• You should now have nodes numbered 1-4
• Click on the Field Vector 1 tab

• Select Cubic under Field Variable 1

• Click OK to submit Node Form

• Click Import/Export button to open Continuity Table Manager

• Select tab-delimited elements file ( elems.xls )

• You should now have 4 elements in the list
• Click OK to submit Element Form

• Click the lines radio button

• Click Render

• The mesh should now look similar to the first screenshot

### Setting up the data

• Select fitting and click OK

• The menu bar should now show the Fitting command
• Click Import/Export/Graph button to open Continuity Table Manager

• Select tab-delimited data file ( data.xls )

• You should now have Data numbered 1-64
• Click OK to submit Data Form

• For all three coordinates, fill in the values according to the table below (use these as a starting guide)
 s(1) s(1)s(1) s(2) s(1)(2) s(2)(2) s(3) s(1)s(3) s(2)s(3) s(3)s(3) 0.01 0.01 0.01 0.01 0.02 0.0 0.0 0.0 0.0

• Click OK to submit Fit Weights Form

• If the Dimensions Helper comes up, click Accept marked recommendations and click OK

• Fitting→Render→RawData…

• Make sure all appears in the Data Points text box

• Click OK to submit Render Data Form

• Select datapoints2 from the list on the left, click on the Properties tab, and set the Size field to 0.015. Then hit Enter

• At this point, it’s a good idea to save the problem.

### Perform fit

• In the Cooridinates tab, select coord_1, coord_2, coord_3 for the three coordinates

• In the Xi Projections tab, set the Ignore points with distance > field to 1.0.

• Click the Fit button on the bottom

• Close the window by clicking the X button
• Click the lines radio button

• Click Render

• Click on elements lines3 in the list on the left

• Click on the Colors tab

• Change the R,G,B color field to 1, 0, 0 to change the color to the brightest red and then hit Enter

• The mesh should now look similar to the second screenshot

### Pre-built model

This cont6 file contains all data and parameters for this problem: fit1.cont6