I want to estimate a function for flood wave which means the function first rises suddenly (in relative term) and drops slowly. I mean, it is not a perfect sine wave. It has been solved by trapezoidal method.
The function that you described can be approximated with a composite function, separated by the peak:
a) first part - hydrograph rise - linear function, until it reaches the peak F=ax+b, (where x represents time) or, if it is not quite linear and have a slight curvature, you can use higher order Polynomial function (y=ax*x +bx+c)... If you need to integrate the area underneath a Polynomial function, you end-up with the Polynomial function one order higher.
b) second part, hydrograph recession, is exponential decay function F= a e^ (-x/b), When you plot your hydrograph in semi-log scale, the recession of this part of hydrograph looks linear. It is analogue to radio-active decay function. The feature of this function is that you can calculate the time in which the function value halves (half-period). Integral of exponential function is exponential function.
If you are using numerical models to integrate these functions, you can space your integration points in the following way, following the basic principle: more non-linearity, more points:
For the recession your integration step increases, and it can double for each new step. So, the first step after the maximum at the time Xm is X(m+1)= Xm + Dx. The next step X(m+2)= X(m+1)+ 2Dx, etc... The interval Dx will depend on desired accuracy.
For the rise, you might want to experiment and see what works the best, depending on the non-linearity of the rise and the desired accuracy. Basically there are four possible cases:
a) If there is very little or no non-linearity you need zero divisions (do not need to subdivide) the interval from the start Xo and the maximum Xm. In maths, this would correspond to Polynomial order one-linear function.
b) In most cases (slight non-linearity, such as for creeks in hydrology) you need only one division - one mid point.
c) If the non-linearity is pronounced at the start of rise, and the function peaks steeply and looks linear from the middle to the peak, you can subdivide the first interval (Xo, Xm) creating the point X(m-1), and if this is not enough then half the first interval (Xo, X(m-1)) by creating new mid point, X(m-2) etc. (Polynomial order 2)
d) I encountered higher non-linearity in the hydrograph rise where catchments were huge. If your function has a certain smoothness of the peak, such as in a those huge catchments, you would need to increase the number of points where that happens. As I said, the principle is - more non-linearity, more points. If this is the case, the best thing is to find the inflection point (by testing for change in first derivative: where you tangent changes slope from rising to falling), and then start creating sub-intervals that are smaller and smaller towards the start of rise and the end of rise, as the area around the inflection point is usually the most linear. (In maths, this can be approximated with the Polynomial order 3 or more)
You can contact me and send the example if this is not clear enough or if I misunderstood your question.
Let h b the function that we wants to find at x and t. The initial condition h(x,0) is zero. The boundary condition h(x=0,t) = g(t) where g(t) is our input function in the form of wave heights. The boundary condition at other end h(x=inf,t) = 0 which means the function dies out completely at an infinite distance. Remember I want to solve 1D diffusion equation considering this equations governs propagation of waves in an aquifer adjoining a stream.
If you want to solve diffusion equation, which is just a form of wave equation, why don't you use standard Runge-kutta 4th order method? And if you need to make it even better, make it adaptive to step-size!