iteration to convergence
이전 댓글 표시
I am very very new to Matlab and this will become quite apparent, but I am working on a problem where the variable I'm solving for is also in the equation. I was told this could be accomplished in Matlab.
v=(((2*Ke)/deltaZ)*log(Ar))+ sqrt((alpha+v^2)/2)
PS. this is a Hydrogeology equation to determine velocity using heat as a tracer
%Constants
lambdaE=2.8; %Effecitve Thermal Conductivity
p=2.7; %Density of Fluid and Sediment
c=4.2; %Heat Capacity of Fluid and Sediment
Ke=[lambdaE/(p*c)]; %Effective Thermal Diffusivity
f=2; %Frequency
P=(1/f); %Period
v=.3; %Fluid Velocity (initial)
deltaPhi = 0.004; %Phase shift between shallow and deep points [Measured in the Lab]
Ar = 0.1; %Amp ratio of shallow and deep points[Measured in the Lab]
deltaZ=.2; %Distance between shallow and deep points
alpha=sqrt(v^4+(8*pi*Ke/P)^2);
Amp Method
%Ar=exp((deltaZ/(2*Ke))*(v-sqrt((alpha + v^2)/2)))
%VAr
v=(((2*Ke)/deltaZ)*log(Ar))+ sqrt((alpha+v^2)/2)
I really hope someone out there can take pity and give me a brief walk through how this can be solved.
-Ethan
채택된 답변
추가 답변 (1개)
Walter Roberson
2011년 9월 8일
The solutions are
(4*Ke*ln(Ar) +/- (8*Ke^2*ln(Ar)^2+alpha*deltaZ^2)^(1/2)) / deltaZ
That is, can be done as a simple quadratic.
댓글 수: 4
x y
2011년 9월 8일
Walter Roberson
2011년 9월 8일
My "mad math skills" just consisted of pasting it in to a symbolic mathematics program ;-)
Walter Roberson
2011년 9월 8일
while true
new_v=(((2*Ke)/deltaZ)*log(Ar))+ sqrt((alpha+v^2)/2);
if abs(new_v - v) < 0.0001 %or as appropriate for tolerance
break; %we converged
end
v = new_v;
end
x y
2011년 9월 11일
카테고리
도움말 센터 및 File Exchange에서 Fluid Mechanics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!