Equation resolution

조회 수: 1 (최근 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
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 4월 24일
You have not defined the results for t=0 z=0

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

채택된 답변

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에서 General Physics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by