Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Complex PDE

Please login with a confirmed email address before reporting spam

Hello,

I have a complex set of three PDEs which I am trying to simulate in MATLAB:

Here are the equations:

da/dt=k1*(1/(1+s^m))*(a^n/(1+a^n))-a-d1/(1+Ta)*a*(1-c)+D1/c*da/dx(dotproduct)dc/dx
ds/dt=k2*c*(a^n/(1+a^n))-d2*s*D2*d2s/dx2
dc/dt=d1/(1+Ta)*c*(1-c)+D3*d2c/dx2

I have simulated with the PDE form before when I do not have the last term of the first equation. However, this term D1/c*da/dx(dotproduct)dc/dx makes the problem very complex. Can I do the simulations with the PDE app or do I have to start from scratch on an m file? If I do my own m file, what would the syntax be for this set of PDEs?

Any help would be greatly appreciated as I am having much difficulty with this.

Thank you,

Stephen

5 Replies Last Post 04.02.2010, 11:27 GMT-5
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27.01.2010, 04:20 GMT-5
Hi

Sorry but I have some problems to understand you, could you be somewhat more explicit about your variables:

I understand that you have :

space variables and time: x, t

dependent variables : a, c, s all functions of (x,t)

constants: k1, k2, d1, d2, D1, D2, D3, Ta, n, m

to use COMSOL notations: da/dt = at, da/dx = ax, d^2s/dx^2 = sxx, etc.

You rewrite your expression to the type "something = 0" to be plug-in compatible with COMSOL

Now remains the "ax(dotprduct)cx" but if a=a(x,t) and the same for c, then isn't the "dotproduct" simply the scalar product ? If not isnt it just to write it out related to the variables I may have missed ?

I'm missing something essential here I believe ;)

Good luck
Ivar
Hi Sorry but I have some problems to understand you, could you be somewhat more explicit about your variables: I understand that you have : space variables and time: x, t dependent variables : a, c, s all functions of (x,t) constants: k1, k2, d1, d2, D1, D2, D3, Ta, n, m to use COMSOL notations: da/dt = at, da/dx = ax, d^2s/dx^2 = sxx, etc. You rewrite your expression to the type "something = 0" to be plug-in compatible with COMSOL Now remains the "ax(dotprduct)cx" but if a=a(x,t) and the same for c, then isn't the "dotproduct" simply the scalar product ? If not isnt it just to write it out related to the variables I may have missed ? I'm missing something essential here I believe ;) Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27.01.2010, 15:54 GMT-5
Thank you so much for your response.

Your assumptions are all correct except T is a constant and a is the depedent variable. The term here in question is the dot product between the gradient of a and the gradient of c with D2/c being the coefficient. So, yes, this does give you a scalar, but this scalar is dependent on both space (since it depends on the gradients) and time (since both variables vary with time). My problem is that I do not know if there is a built-in module of this PDE type or if I need to do it from scratch. If I do it from scratch, I am not sure the proper notation as I have not seen anything like this in the manual.

Any help would be greatly appreciated,

Stephen
Thank you so much for your response. Your assumptions are all correct except T is a constant and a is the depedent variable. The term here in question is the dot product between the gradient of a and the gradient of c with D2/c being the coefficient. So, yes, this does give you a scalar, but this scalar is dependent on both space (since it depends on the gradients) and time (since both variables vary with time). My problem is that I do not know if there is a built-in module of this PDE type or if I need to do it from scratch. If I do it from scratch, I am not sure the proper notation as I have not seen anything like this in the manual. Any help would be greatly appreciated, Stephen

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27.01.2010, 16:44 GMT-5
Hi

great then the "Ta" is a typo and should be read "T*a" with "T" a constant.

so the three equations become:

at=k1*(1/(1+s^m))*(a^n/(1+a^n))-a-d1/(1+T*a)*a*(1-c)+D1/c*ax*cx
st=k2*c*(a^n/(1+a^n))-d2*s*D2*sxx
ct=d1/(1+T*a)*c*(1-c)+D3*cxx

space variables: x,t
dependent variables: a,s,c
k1,d1,T,D1,k2,d2,D2,D3,m,n all constants and with implicit:
a=a(x,t) at=da(x,t)/dt ax=da(x,t)/dx ...
s=s(x,t) st=ds(x,t)/dt sx=ds(x,t)/dx sxx=d^2s(x,t)/dx^2 ...
c=c(x,t) ct=dc(x,t)/dt cx=dc(x,t)/dx cxx=d^2c(x,t)/dx^2 ...


So far I understand it, one must now reorder the equations with some algebra to get them to fit the canonical coefficient form of COMSOL, unfortunately I have not been playing that much with arbitrary PDEs and COMSOL so I would need some time to sort it out (if possible), and it's getting late form me just now. Furthermore, I still havnt catched the reason why the dotproduct, in this case makes it so much worse (I find it awfull enough as is, OK ;)

In anycase I would typically start to read through my copy of :

www.comsol.com/academic/books/mmwfem/

to be inspired. There are some good exercices therein starting from the PDE's and reordering them to be COMSOL compliant, so I can only propose that you borrow this book, or perhaps you have it already ?

Good luck
Ivar
Hi great then the "Ta" is a typo and should be read "T*a" with "T" a constant. so the three equations become: at=k1*(1/(1+s^m))*(a^n/(1+a^n))-a-d1/(1+T*a)*a*(1-c)+D1/c*ax*cx st=k2*c*(a^n/(1+a^n))-d2*s*D2*sxx ct=d1/(1+T*a)*c*(1-c)+D3*cxx space variables: x,t dependent variables: a,s,c k1,d1,T,D1,k2,d2,D2,D3,m,n all constants and with implicit: a=a(x,t) at=da(x,t)/dt ax=da(x,t)/dx ... s=s(x,t) st=ds(x,t)/dt sx=ds(x,t)/dx sxx=d^2s(x,t)/dx^2 ... c=c(x,t) ct=dc(x,t)/dt cx=dc(x,t)/dx cxx=d^2c(x,t)/dx^2 ... So far I understand it, one must now reorder the equations with some algebra to get them to fit the canonical coefficient form of COMSOL, unfortunately I have not been playing that much with arbitrary PDEs and COMSOL so I would need some time to sort it out (if possible), and it's getting late form me just now. Furthermore, I still havnt catched the reason why the dotproduct, in this case makes it so much worse (I find it awfull enough as is, OK ;) In anycase I would typically start to read through my copy of : http://www.comsol.com/academic/books/mmwfem/ to be inspired. There are some good exercices therein starting from the PDE's and reordering them to be COMSOL compliant, so I can only propose that you borrow this book, or perhaps you have it already ? Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 27.01.2010, 16:55 GMT-5
Thank you so much for your help. One small thing: st=k2*c*(a^n/(1+a^n))-d2*s*D2*sxx should be st=k2*c*(a^n/(1+a^n))-d2*s+D2*sxx (maybe it was a typo). Anyways, the book you mentioned: is this available for free online? Thank you again for your help, and I hope to hear from you regarding getting the equations in the canonical coefficient form of COMSOL.

Stephen


Hi

great then the "Ta" is a typo and should be read "T*a" with "T" a constant.

so the three equations become:

at=k1*(1/(1+s^m))*(a^n/(1+a^n))-a-d1/(1+T*a)*a*(1-c)+D1/c*ax*cx
st=k2*c*(a^n/(1+a^n))-d2*s*D2*sxx
ct=d1/(1+T*a)*c*(1-c)+D3*cxx

space variables: x,t
dependent variables: a,s,c
k1,d1,T,D1,k2,d2,D2,D3,m,n all constants and with implicit:
a=a(x,t) at=da(x,t)/dt ax=da(x,t)/dx ...
s=s(x,t) st=ds(x,t)/dt sx=ds(x,t)/dx sxx=d^2s(x,t)/dx^2 ...
c=c(x,t) ct=dc(x,t)/dt cx=dc(x,t)/dx cxx=d^2c(x,t)/dx^2 ...


So far I understand it, one must now reorder the equations with some algebra to get them to fit the canonical coefficient form of COMSOL, unfortunately I have not been playing that much with arbitrary PDEs and COMSOL so I would need some time to sort it out (if possible), and it's getting late form me just now. Furthermore, I still havnt catched the reason why the dotproduct, in this case makes it so much worse (I find it awfull enough as is, OK ;)

In anycase I would typically start to read through my copy of :

www.comsol.com/academic/books/mmwfem/

to be inspired. There are some good exercices therein starting from the PDE's and reordering them to be COMSOL compliant, so I can only propose that you borrow this book, or perhaps you have it already ?

Good luck
Ivar


Thank you so much for your help. One small thing: st=k2*c*(a^n/(1+a^n))-d2*s*D2*sxx should be st=k2*c*(a^n/(1+a^n))-d2*s+D2*sxx (maybe it was a typo). Anyways, the book you mentioned: is this available for free online? Thank you again for your help, and I hope to hear from you regarding getting the equations in the canonical coefficient form of COMSOL. Stephen [QUOTE] Hi great then the "Ta" is a typo and should be read "T*a" with "T" a constant. so the three equations become: at=k1*(1/(1+s^m))*(a^n/(1+a^n))-a-d1/(1+T*a)*a*(1-c)+D1/c*ax*cx st=k2*c*(a^n/(1+a^n))-d2*s*D2*sxx ct=d1/(1+T*a)*c*(1-c)+D3*cxx space variables: x,t dependent variables: a,s,c k1,d1,T,D1,k2,d2,D2,D3,m,n all constants and with implicit: a=a(x,t) at=da(x,t)/dt ax=da(x,t)/dx ... s=s(x,t) st=ds(x,t)/dt sx=ds(x,t)/dx sxx=d^2s(x,t)/dx^2 ... c=c(x,t) ct=dc(x,t)/dt cx=dc(x,t)/dx cxx=d^2c(x,t)/dx^2 ... So far I understand it, one must now reorder the equations with some algebra to get them to fit the canonical coefficient form of COMSOL, unfortunately I have not been playing that much with arbitrary PDEs and COMSOL so I would need some time to sort it out (if possible), and it's getting late form me just now. Furthermore, I still havnt catched the reason why the dotproduct, in this case makes it so much worse (I find it awfull enough as is, OK ;) In anycase I would typically start to read through my copy of : http://www.comsol.com/academic/books/mmwfem/ to be inspired. There are some good exercices therein starting from the PDE's and reordering them to be COMSOL compliant, so I can only propose that you borrow this book, or perhaps you have it already ? Good luck Ivar [/QUOTE]

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 04.02.2010, 11:27 GMT-5
I was wondering if you had any additional thoughts on this. We're really struggling trying to find a form which COMSOL can handle.

Stephen
I was wondering if you had any additional thoughts on this. We're really struggling trying to find a form which COMSOL can handle. Stephen

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.