Effacer les filtres
Effacer les filtres

Equation resolution

4 vues (au cours des 30 derniers jours)
mouna
mouna le 24 Avr 2011
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 commentaire
Walter Roberson
Walter Roberson le 24 Avr 2011
You have not defined the results for t=0 z=0

Connectez-vous pour commenter.

Réponse acceptée

Clemens
Clemens le 26 Avr 2011
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 commentaires
mouna
mouna le 26 Avr 2011
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 le 29 Avr 2011
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.

Connectez-vous pour commenter.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 24 Avr 2011
Solution: C0 = 0, C(z,t) = 0
  1 commentaire
mouna
mouna le 25 Avr 2011
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

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by