Hello, Masters:
I have a shock wave emission curve in water like this:
x is the distance from shock wave center and y is the shock wave pressure. The calculation was done by the Kirkwood-Bethe method.
However, this curve is physically "unreasonable" because liquid does not allow a broken wave.What we normally do is use a vertical guide line (as red line in figure) to let the left region equals the right region (as shown in the green line). After reshaping the wavefront, it should like this:
For less than 10 figures, we normally do it manually. However, we have now hundreds of these figures, and thus need a nice matlab algorithm to handle it.
Anyone has met this kind problem before? Would you please provide any idea to solve this problem...
Thank you!!!
Joe
p.s. the data is attached.

댓글 수: 3

José-Luis
José-Luis 2014년 3월 27일
Where should the vertical line be placed?
Joe Liang
Joe Liang 2014년 3월 28일
Hi, José-Luis:
You are right. Where to place the vertical line to make the left and right areas equal.
Regards,
Joe
Andrei Bobrov
Andrei Bobrov 2014년 3월 28일
Where all data?

댓글을 달려면 로그인하십시오.

 채택된 답변

Andrei Bobrov
Andrei Bobrov 2014년 3월 31일

0 개 추천

load data
[~,iymax] = max(y);
yx = griddedInterpolant(y(end:-1:iymax),x(end:-1:iymax),'pchip');
y0 = fminsearch(@(x)yx(x),y(end));
x0 = yx(y0);
jj = find(x(1:iymax)<x0,1,'last');
f1 = griddedInterpolant(x(jj:iymax),y(jj:iymax),'pchip');
xx = x(iymax:end);
yy = y(iymax:end);
t0 = yy > y0;
t00 = x0 < xx;
t1 = t0 & t00;
f2 = griddedInterpolant([x0;flipud(xx(t1))],[y0;flipud(yy(t1))],'pchip');
t2 = ~t0 & t00;
f3 = griddedInterpolant([x0;xx(t2)],[y0;yy(t2)],'pchip');
xout = fzero(@(X)integral2(@(x,y)ones(size(x)),X,x(iymax),@(x)f2(x),@(x)f1(x))...
- integral2(@(x,y)ones(size(x)),x0,X,@(x)f3(x),@(x)f2(x)),[x0,x(iymax)]);

댓글 수: 1

Joe Liang
Joe Liang 2014년 3월 31일
Dear Andrei Bobrov:
Thank you very very much for your reply! It works!
It's really a genius idea to segment lines in such a elegant way!Especially the use of function "griddedInterpolant". Great!
Regards,
Joe
One small questions on your last line of code.You use integral2 to integrate an area. Here you used @(x,y)ones(size(x)). Is it similar to use @(x,y)1 or the latter is not allowed in Matlab?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Time Series Events에 대해 자세히 알아보기

질문:

2014년 3월 27일

댓글:

2014년 3월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by