Equation resolution

4 次查看(过去 30 天)
mouna
mouna 2011-4-24
Hi,
I would like to write this equation in Matlab :
A (dC/dt)+ B (dC/dz)=0
with these conditions :
for t=0 and z>0 : C=C0, for z=0 and t>0 : C=0, for z=L and t>0 : dC/dz=0,
and how to resolve it. thanks for your help in advance

采纳的回答

Clemens
Clemens 2011-4-26
I also only see the trivial solution C(z,t) = 0
But let me take some notes and see if a something more general is possible.
Let's write as product: C(z,t) = f(z)g(t) then you got the boundary conditions:
z>0: g(0) = 0;
t>0: f(0)=0;
f'(L) =0;
Then you could choose f any function that solves these conditions.
and solve g...
A f(z) g'(t) + B f'(z) g(t) == 0
simplify to
g'(t) = - B/A f'(z)/f(z) g(t)
So the general solution would be:
g(t) = D * exp(-B/A f'/f t)
but with g(0)=0 it requires D=0
unless one is nitpicking...
  • if A=0 and B=0 - you are free to choose g to anything that fullfills the boundaries.
  • what if only one is 0: then either g(t)=0 or g'(t) = 0. Both together with your boundary lead to C(z,t) = 0.
  • maybe if f=0 or f'=0... no then the outcome for C would C(z,t) = 0
  • well actually if you construct f such that it is 0 in the range [0,L] then you could solve g without any more conditions.
  • and/or if you make g such that it is 0 for t >=0 you are free to solve f analogous.
but reading the question I think the interesting area would be t>0 and z=[0,L]. So only C(z,t) = 0 in that range.
Or someone with better math skills comes for help :D
  2 个评论
mouna
mouna 2011-4-26
thanks for your help
but g(0)isn't =0 i have g(0) =C0 that's why D=C0
i'm very sorry but this the first time that i use matlab,i have a project and i need a programmation with matlab and until now i don't know how to write this equation with these conditions in algorithm in matlab.i need really a help!!!!!!!!!!!!!
thanks for your help in advance
Clemens
Clemens 2011-4-29
First things first. When you say "write" there are several ways depending on what you want.
I suppose you are after a numerical solution. You can use bvp4c for that. There is an example in the help.
You can also input it symbolicaly. But I never used that, so no help from me there.
But keep in mind the first post. f is not uniquely defined. So you might get many different solutions.

请先登录,再进行评论。

更多回答(1 个)

Walter Roberson
Walter Roberson 2011-4-24
Solution: C0 = 0, C(z,t) = 0
  1 个评论
mouna
mouna 2011-4-25
hi,
for t=0 and z=0:C=0
this is the first time I use matlab
and I do not know how I can write +(and resolve)this equation in matlab
thanks for your help in advance

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Numbers and Precision 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by