If I understood correctly, you want to variate the shape of the part using analytical functions. How these functions describe the shape? Is the part a 3d solid, shell, beam or something else?
On the other hand, there is a possibility to use parametric shape variation in Abaqus. Maybe it is more appropriate.
You can script Abaqus using python, and you can use whatever script and function you want to use, including execution and post-processing of the results. Best way to get started is to record a macro.
If you want to create a function in Abaqus, you can use the "Analytical field" to define it, and use it to control the magnitude of loads, etc. Based on your post I'm not 100% sure what you want to achieve.
If you want to adjust the shape of something, you can set up dependencies between the variables in the geometry module, that might save you some trouble!
If you want to optimise, you might want to see if you have access to isight, it makes life a lot easier.
I want to create a cavity inside a solid media and then optimize the shape of cavity for an spatial goal by varying the cavity shape parameters. So for reduction in number of optimization variables.
For this mean in want to define the one or two line of cavity shape with an analytical function in part module of Abaqus CAE .
I think you have to create a wire in the Part module using Spline and, as David recommended, record a macro. In the script you can replace spline points by points of desired analytical function.