Is this event detection correct

1 次查看(过去 30 天)
Sreedhar
Sreedhar 2015-4-27
Hi I am solving a problem involving the expansion and contraction of a bubble in response to a sinusoidal pressure, Pa sin (wt). (Rayleigh Plesset equation)
The formula for pressure of the gas in the bubble during expansion (isothermal expansion - gamma = 1) is different from that during contraction (adiabaic compression - gamma = 1.33).
To change the formula I am using 'EVENTS' to detect the end of contraction (event 1) and end of expansion (event 2).
The bubble starts contracting initially from a radius R0 = 1e-4 m.
The condition used to detect end of contraction is : radial velocity Rdot is negative and increasing to zero
The condition used to detect end of expansion is : radial velocity Rdot is positive and decreasing to zero.
The initial condition is : R0 = 1e-4 and Rdot = 0
------------------- When I run this program I am getting 4 events. I was expecting only 2 (first after compression and second after expansion). Why is this happening ? How can I overcome this ?
Is this method of detecting event correct ? Since the radius never becomes zero I cannot use zero detection of radius as a condition.
The files used are attached :
RP7.m - is the main script file
eventsFuncn1.m is the events function
zdot7.m is the function giving the derivative
THANKS IN ADVANCE
  1 个评论
Chad Greene
Chad Greene 2015-4-27
Looks like the files didn't get uploaded. But realistically, you may have trouble getting a response if you upload multiple files and hope someone will sort through them.
Without having your files though, would an amplitude envelope do what you need? This could be done with a moving rms, or either of the methods discussed here.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Standard File Formats 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by