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.
how to program this equation
Posted 2010年2月26日 GMT+8 07:11 5 Replies
Please login with a confirmed email address before reporting spam
How to program such equation with COMSOL.
ds/dt +d(D(s)ds/dx)dx=R with D(s)=a+b*s^2+c*s^3
I'm a new user. and my probleme is about the second term wich coefficient depend of the variable (s)
d(D(s)ds/dx)dx
Thanks for your help
Please login with a confirmed email address before reporting spam
1. Open a new project, general form, 1D, dependent variable s
2. Draw a line, any length. hit mesh once
3. Options -> Constants, enter values for a, b, c, R, then Apply
4. Options -> Global expression, enter D, a+b*s^2+c^s^3, then Apply
5. Under Subdomain settings, set Gamma = D*sx, F=R, ea=0, da=1
6. Under Solver parameters, adjust time stepping as desired
7. Hit Solve Button
8. Go to Plot parameters to view results.
The constants a, b, c, and F0 are set in Step 3. above.
They are combined into the expression for D, which is also a function
of the dependent parameter s.
Your term D(s)ds/dx is the flux term Gamma in the general form.
D(s) is calculated according to the expression in Step 4.
The ds/dx term is expressed in Comsol as sx (could also use d(s,x))
hence the flux term in Step 5 is written as D*sx.
You may need to adjust your parameter values a, b, c and R to get
actual solutions - not everything has real solutions. Also, you can
adjust the boundary conditions.
You could also do this same problem using the coefficient form,
or (less easily) set it up using the weak form.
Hope this helps.
Good luck!
Please login with a confirmed email address before reporting spam
Please login with a confirmed email address before reporting spam
I want to know how to put a constant boundary like s=1 or s=0.2. with PDE mode
The PDE mode give me a Dirichlet and Neumann condition.
But it's a flux ?
Thanks
Attachments:
Please login with a confirmed email address before reporting spam
Hi
I want to know how to put a constant boundary like s=1 or s=0.2. with PDE mode
The PDE mode give me a Dirichlet and Neumann condition.
But it's a flux ?
Thanks
The boundary conditions are of two types. (a) a value (Dirichlet) or slope (Neumann).
For your problem above, setting values would be using Dirichlet BCs.
To set these, in the Boundary mode, Boundary Settings, you'll see two items
listed in Boundary selections, one for each boundary. Select Item 1, corresponding
to the left boundary. The point on the line will be highlighted in red. In the
right panel under the Coefficients tab, select the Dirichlet boundary condition
radio button. At the top you'll see the equation template with the variables
and their context. You'll only need to be concerned with the R=0 part of this,
so leave G=0. R=0 is the equation that has to be satisfied on the boundary,
so for the left boundary if you want to set s=1, you would write it as s-1=0,
and in the entry for R you would then have s-1.
For the second boundary it's the same procedure, only for R you would enter s-0.2.
Please login with a confirmed email address before reporting spam
You know more about COMSOL.
good!
I have an other question.
The value of (s) should be between 0 and 1. 0<= s<1.
So I want this equation and other equation be resolved only for 0<= s<1.
So where or how can I put this condition?
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.
Suggested Content
- BLOG Best Papers and Posters: COMSOL Conference 2020 North America
- 
                    KNOWLEDGE BASE
                    How can I see the equations COMSOL is defining?  
 How do I implement a user-defined Multiphysics coupling?
- FORUM calling up a varible defined by program
- FORUM How to Program the Geometry in Comsol
- FORUM Fatal error when starting program
