How to express a function both time and spatial dimension dependent?
1 次查看(过去 30 天)
显示 更早的评论
Hi there,
It seems an easy one but I guess it is not that easy. I have a fluid flowing through a vessel. I want to measure its velocity u1 and u2. the vessel coordinetes from the lateral position x=0 to x=1 in time from t=0 to t=3. The code is :
ii=101;
dt=0.1;
t = 0:dt:10;
dx=0.01; %step size
fik=0.4;
for i=1:ii;
x=(i-1)*dx;
H1D=0.1;
H1=0;
A=0;
AD=0.1;
fikness=fik*sin(pi*x);
ub1(i)=(c1b-H1D*(x-0.5)+AD/2*(x-0.5)^2)/(H1-0.5*fikness-A*(x-0.5));
ub2(i)=(c2b+H1D*(x-0.5)-AD/2*(x-0.5)^2)/(1-H1+0.5*fikness+A*(x-0.5));
end
H1D=H1D+dt*H1DDOT %------lets say these H1D, H1DDOT, H1 are time dependent functions.
H1=H1+dt*H1
AD=AD+dt*ADDOT;
A=A+dt*AD
Matlab runs the program above but it is not showing time. For example if I want to see in time t=2 what are the velocities u1 and u2 over the whole vessel (from x=0 to x=1)? How can I plot and see the results Thanks in advance
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!