<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <atom:link href="http://www.comsol.se/community/forums/general/rss/thread/4025.rss" rel="self" type="application/rss+xml"/>
  <title>COMSOL Forums: Defining a parameter in 2 intervals</title>
  <link>http://www.comsol.se/community/forums/general/thread/4025/</link>
  <description>Most recent forum messages</description>
  <pubDate>Fri, 19 Mar 2010 20:26:04 +0000</pubDate>
  <image>
   <title>COMSOL Forums: Defining a parameter in 2 intervals</title>
   <url>http://www.comsol.se/shared/images/logos/comsol_logo.gif</url>
   <link>http://www.comsol.se/community/forums/general/thread/4025/</link>
  </image>
  <item>
   <title>Re: Defining a parameter in 2 intervals</title>
   <link>http://www.comsol.se/community/forums/general/thread/4025/#p10430</link>
   <description>Hi&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Well you do not tell us much of what you are modelling, but I will assume it's a fluid flow case, with probably an input pressure that you call Pin, applied to one boundary, then some walls along the tube (with normally I assume noslip boundary conditions), and an outlet with perhaps no pressure (free flow out)&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
In which case, if you do a transient analysis (time domain) and you define a time variable from 0 to say 12000 [s] in steps perhaps by 50 [s] that you define in the solver pane, it should be solvable.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Now to get your input pressure to change with time you must define on the &amp;quot;input&amp;quot; boundary the presure Pin.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
You can either define &lt;br /&gt;&#13;
a) a &amp;quot;function&amp;quot; depending on the time, with your constants defined in the &amp;quot;constant &amp;quot; section and then you use this function name as input; or &lt;br /&gt;&#13;
b) you define directly your time dependent equation in the boundary condition field for input pressure.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
as you have written:&lt;br /&gt;&#13;
Pin =  (a*t^3+ b*t^2 + c*t + d)*(t&amp;lt;900)+ (e*t +f)*(t&amp;gt;=900)*(t&amp;lt;12000)&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
The last  *(t&amp;lt;12000) is not required if you stop anyhow at 1200[s]&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
For the units you chould use:&lt;br /&gt;&#13;
0) none, COMSOL will say inconsitent units in red, but assume they are anyhow OK and ignore the warning&lt;br /&gt;&#13;
1) correct units in the definition of your constants a,b,... (I assume t is by default defined as [s]) and add something as *(t[1/s]&amp;lt;900) which makes &amp;quot;t[1/s]&amp;quot; dimensionless and would give correct results even if t is defined in minutes, or *(t&amp;lt;900[s]) (that should be equzivalent (pls correct COMSOL might not appreciate units in Bolean expressions and still say &amp;quot;warning&amp;quot;)&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
finally if the two functions are not really adjacent, with a steep step at the transition time, your could get into solver stability problems, you might need to make small steps at the border around 900[s], of you change slightly the function to make it &amp;quot;smooth&amp;quot; with a heaviside function (search for heavisie in th guide.pdf and command.pdf&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Hope this helps on the way&lt;br /&gt;&#13;
Have fun&lt;br /&gt;&#13;
Ivar</description>
   <pubDate>Fri, 19 Mar 2010 20:26:04 +0000</pubDate>
   <guid isPermaLink="false">4025.1269030364.10430</guid>
  </item>
  <item>
   <title>Defining a parameter in 2 intervals</title>
   <link>http://www.comsol.se/community/forums/general/thread/4025/#p10424</link>
   <description>I have the equations of input pressure as following&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Pin = a*t^3+ b*t^2 + c*t + d    for t&amp;lt;900 s and&lt;br /&gt;&#13;
Pin = e*t +f                              for 900&amp;lt;=t&amp;lt;12000&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
how and where do i define Pin in Comsol? </description>
   <pubDate>Fri, 19 Mar 2010 18:30:23 +0000</pubDate>
   <guid isPermaLink="false">4025.1269023423.10424</guid>
  </item>
 </channel>
</rss>
