In this research we want to eliminate the harmful longitudinal vibration using resonance changer. In fact resonance changer is a hydraulic vibration absorber which is modeled by mass, spring and damper. In ships this device is used because resonance of axial forces damage the components of propulsion system. In submarines, moreover, there is probability of detection by sonar which is sensible to waves propagated in water from submarine body. In the case of ships and submarines, a major source of the radiated noise is due to excitation of the hull modes resulting from vibration transmission through the propeller-shafting system. Oscillations occur at the propeller due to small variations in thrust load when the propeller blades rotate through the non-uniform wake, resulting in axial excitation of the propeller at the blade pass frequency. This problem can be addressed by the use of a resonance changer. For designing and optimizing of resonance changer, first equations of system is written according to Newton laws and after that resonance changer parameters including mass, spring and damper will be dimensionless. For optimisation of these parameters boundry of them are specified and continuous genetic algorithm is used. Since the genetic algorithm execution technique is not dependent on the error surface, we can solve multi-dimensional, non-differential, non-continuous, and even non-parametrical problems. Cost function, in ships, is maximum amplitude of applied force to thrustmeter in operating range. Applied force to thrustmeter is measured at the end of propulsion system. Amplitude of this force in every frequency is obtained using impact function and fast fourier transformation and specified its maximum in operating range. When the impact is applied to a mechanical system, its frequencies is excited. We can product amplitude of input force to output response because system is linear. In submarines cost function is maximum time-averaged power of radiated sound getting from production of applied force to body and fluctuating velocity of submarine body. Also other cost function is considered as maximum amplitude of applied force to body. Using resonance changer causes more than ninety percent reduction in cost functions. In order to investigate the effect of resonance changer on other components of propulsion system graphs of their output are drawen. These output are applied force to thrust bearing, displacement of propeller and displacement of thrust bearing. Generally maximum of these parameters reduce by use of resonance changer. Keyword: Resonance changer, genetic algorithm, vibration absorber , impact function