For questions related to your modeling, please contact our Support team. The at operator lets you access the solution at any time in postprocessing. COMSOL Multiphysics provides the solution at that time using interpolation. Ivar. If I use the expression you suggested then xi comes back with a value of 0. -- 7 Replies, Please login with a confirmed email address before reporting spam. - the parameter line that calcualtes out your value (and translates the units) I think I've found a solution to my problem, although I'm not using it anymore in my simulation. Cite 15th Feb, 2018. As usual, the Combination Method gives you various options for how to combine the solutions. See the Global and Local Definitions chapter, under Operators, Functions, and Constants>Built-In Operators. So that if both T=300 and y=0 are true (then equal to one) then whatever the x coordinate at the point is gets assigned to xi. I would create an analytic equation with the expression: if ((x, Hi Jeff, matlab has several types of relational operators; some of the most common are listed below: 22 Replies, Please login with a confirmed email address before reporting spam. Complement Selection creates selections that are the inverse of . If else condition syntax in comsol multiphysics 4.2 In fact, I'm not having problems with units of time, since I can define that the argument t is in hours, then COMSOL makes the convertion automaticaly I believe. This works. The expression to evaluate then becomes intop1(u*(x>x1)*(xy1)*(y6), which evaluates to 0 for simulation times up to 6 seconds and to 5 after 6 seconds. Version 5.0 Discussion Closed This discussion was created more than 6 months ago and has been closed. Isn't it more correct? Operators, including the up and down operators, are documented in the COMSOL Multiphysics Reference Manual. You can use the at operator to compare two solutions at different times during results evaluation; for example, at (30,u)-at (20,u) is the difference between the solution at 30 s and the solution at 20 s. The first input argument is the time. Bavaria Schweisstechnik is an important producer of submerged arc welding consumables for the hydropower industry. S. Ivar, Hi Ivar, ((a+b*cos(2*pi*t/8760)+c*cos(2*pi*t/24))>0) or simply, ((f(t))>0) Hi Randhir, Discussion Closed This discussion was created more than 6 months ago and has been closed. Say that you have invented your own measure of structural stress. To start a new discussion with a link back to this one, click here. Discussion Closed This discussion was created more than 6 months ago and has been closed. Following up Jing Zhou: how to perform definite integral where the result is a field variable f(x,y) and where bounds are defined by the arbitrary space coordinates? However I wish to assign the variable xi to the value of x when T=300 and y=0. You can fix this by pressing 'F12' on your keyboard, Selecting 'Document Mode' and choosing 'standards' (or the latest version I understand what you are saying. Built-In Operators - COMSOL Multiphysics The purpose is to use the final time-step Temperature T1 of comp1 as the initial value T0 of comp2. Jeff. Thanks, Thanks! COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH), www.comsol.com/support/knowledgebase/905/, Reducing the amount of solution data stored in a model, Visualization for 2D Axisymmetric Electromagnetics Models. 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. d(sqrt(0.5*(tresca_smld^2+mises_smld^2)),t) is the time-derivative of your stress. I tried the following expression with no success: This is just the tip of the iceberg. I hope I have made my problem clear! There are some descriptions about the if operator in the User's Guide. of 2 [mm] * 3 [mm], but not along the two edges at x=2 and y=3. Am I right? Boolean expression error in variable. - COMSOL Multiphysics T= 293 for t. If I use following function in the boundary expression: If I use following function in the boundary expression: Did you for instance know that the letter d will differentiate any variable or expression with respect to time or space? there are two places whree aou can test out formulas: An example: Is that a bug or it this meant to be? -- ii) you have some numerical or strange model issues going on, ad one coul expect that to happen also if you sart with just one step Once you have created it, make sure that it has Data 1 set to Solution 1 and Data 2 set to Solution 2. By providing your email address, you consent to receive emails from COMSOL AB and its affiliates about the COMSOL Blog, and agree that COMSOL may process your information according to its Privacy Policy. Hello Jesus, - Variable: mod1.p I was working on a similar problem and had similar issues. Parameters, Variables, & Functions Plotting the expression at(20,p)-at(10,p) overrides the Solution at time setting and shows you the pressure increase between 10 and 20 seconds. Alexandre. Your internet explorer is in compatibility mode and may not be displaying the website correctly. You want it to be equal to the quadratic mean of the Tresca and von Mises stresses. Each solution comes from one step function. After I would created another one with a conditional statement: Simply type, for example, 5* (t>6), which evaluates to 0 for simulation times up to 6 seconds and to 5 after 6 seconds. if ( (x, [QUOTE] Good luck For plots that take vector inputs you must use the defined variables directly in the edit fields for the vector components. Filter - COMSOL Multiphysics I didn't tested it, but it seems that it would work. Jesus. How to Use Boolean and Adjacent Selections - COMSOL 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. Please: How to calculate this in Comsol 5.4:-8*Al*Al*integralof(dT/dz(r,0))*r*dr) from(0 to 1/2/Al). This consent may be withdrawn. The with operator lets you postprocess more than one parametric or eigensolution in a similar fashion. I really like the new COMSOL capability to join two separate solutions into one dataset using the Join functionality. x > 0.1 && x < 0.3 && y > 0.1 && y < 0.3. Am I right? - the analytical function, whcih allows you quickly to plot a function. I tried that: -- Hi, Hi, I'm trying to find an explanation of simple operators like up() and down() in the helpfor Comsol 5.0. You can fix this by pressing 'F12' on your keyboard, Selecting 'Document Mode' and choosing 'standards' (or the latest version Ivar, <1) works well for many cases meaning V=V0 for X<= 1 and V=V0+V1 above>>, Regarding the above statement, I don't see how this syntax communicates that V=V0 for X 100, then i = -1, if not i = 0, Hi like having an imaginary wall that prevents it to move downward. you need to separate each condition and multiply them, i.e. Magnus. Set Solutions to One in both the Data sections, and you will be able to pick any combination of parameter values. Online Support Center: https://www.comsol.com/support To start a new discussion with a link back to this one, click here. Adam Collins Send Private Message Flag post as spam Hi, I want to use and if statement in COMSOL but I need it to have two conditions. 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. I can easily plot the function f=(x, Hi What I did . Unterschleiheim ( Central Bavarian: Untaschleiheim) is a town in Bavaria, Germany. Posted Aug 17, 2009, 2:35 p.m. EDT Setting reference pressure does not affect my results at all, Operators not allowed in user-defined functions, Including Operators and Expressions in a Multiphysics Simulation Is Easier Than You Think. Solving time dependent models with inconsistent initial values, Solutions as Starting Point Values with LiveLink for MATLAB. I have a simple bi-metal assembly. good luck listed if standards is not an option). Thanks for the quick reply. Your internet explorer is in compatibility mode and may not be displaying the website correctly. Chances are it is non-zero but perfectly imaginary due to its 90-degree phase difference with a real-valued electric field. Youve mentioned how the d operator differentiates a variable wrt to time and space but how do we differentiate a variable wrt another dependent variable. [/QUOTE] For a simple rule of 2 variables x and y: if x<a then y=c1 else y=c2 In Comsol: y= if (x<a,c1,c2) Furthermore, i don't know how to link 2 rules with 3 variables x,y,z: if x<a then y=c1 else if z<b then y=c2 else y=c3 I will appreciate if anyone know the solution. listed if standards is not an option). Logical Expression - COMSOL Multiphysics Good luck -Adam, Hi Good luck Now all you need to do is enter sqrt(0.5*(tresca_smld^2+mises_smld^2)) in any of the Expression fields and click OK to see your new stress distribution. Please, could you tell me how to access (for instance with the WITH() operator, or by means of the JOIN node for data) to any value of two different parameterized solutions (say in one solution the parameter goes from 0 to 1 and in the other the parameters goes form 1 to 2)? Hi, Operators, including the up and down operators, are documented in the COMSOL Multiphysics Reference Manual. Magnus Ringh COMSOL Employee. 1 Reply, Please login with a confirmed email address before reporting spam. For plotting an coloured area for example: 0.1 < x < 0.3 and 0.1 < y < 0.3 the correct logical expression is as follwed: Hi Consider for example a temperature gradient on a boundary between two subdomains with different conductivities. Conditional Statements within an Expression - COMSOL Multiphysics Reference for operators and expressions? - COMSOL Multiphysics For instance, suppose that you need to assign 5 to a variable on a rectangular surface with the dimensions Hi Alexandre, Is it possible to "paste" two functions in COMSOL? i have a boolean logic expression, if t >= 0, t < 0.2 F = 1./ (1+exp (-140* (t-0.08))) if t >= 0.2 and t< 1 F = 1./ (1+exp (60.61* (t-0.35))) when i use below boolean expression in the variable, it end up that the the two statement is added up and the maximum y magnitude jump to 2, while when i use matlab, it is 1. expression - COMSOL Multiphysics an expression V = V0+V1*(x>1) works well for many cases meaning V=V0 for X1) to turn on the force F after 1 second is a "hard" way to go for your solver, try the heaviside functions to smoothen the turn on/off (search for heaviside in the doc 293-10*flc2hs(t,0)*(600, Hi With up(gradT_ht) and down(gradT_ht) however, you can decide which side you are interested in. have you tried the filter and (x2) condition, or whatever Boolena condition you need ? Posted Feb 1, 2010, 12:54 p.m. EST i) your BC is oscillating, but you should be able to plot that function (or define it as a function first and then plot it from the user function menu) I also studied the logical expressions list in the users manual, without success. if ( (x, [QUOTE] Then use the sections below to specify the geometric entities to split, the expression, and the split condition. In my case, I'm trying to type a cosine function to simulate solar radiation throghout a year, with daily and annual variation. To my opinion above expression should be intop1(u*(x2>x>x1)*(y1Built-In Operators. If you work with electromagnetics, you might have plotted the magnetic field in an eigenmode analysis only to find that it appears to be identically zero. listed if standards is not an option). d(c,z) gives the derivative of a concentration c with respect to the z-coordinate. This is handy if you want to see changes over a time interval. This is handy if you want to see changes over a time interval. The way this works is that comparisons evaluate to 1 if they are true and 0 if they are false. Hi Selection of solution dataset based on a boolean expression in COMSOL? Yes you can. -- regards Best regards, http://www.comsol.com/support/knowledgebase/905/ Thank you for your answer. Good luck cannot suggest more like taht ;) How to Create High-Quality Model Images in COMSOL Multiphysics, Developing a Silicon MEMS Chip for On-Demand DNA Synthesis, Predictive Analytics Capabilities of SmartUQ for COMSOL. To add a Logical Expression node, right-click a 2D or 3D Mesh node (that has an imported mesh) and select Logical Expression from the Partition Entities menu. I mostly write my complex fomulas as functions, as then I can plot them easily to check how they look, its so easy to forget a sign, or an offset. if(f(t)>0, f(t), 0) listed if standards is not an option). You can fix this by pressing 'F12' on your keyboard, Selecting 'Document Mode' and choosing 'standards' (or the latest version For instance, suppose that you need to assign 5 to a variable on a rectangular surface with the dimensions COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH), How to Use State Variables in COMSOL Multiphysics. Your internet explorer is in compatibility mode and may not be displaying the website correctly. But I want that the function to be true only to values above 0. COMSOL Multiphysics provides smoothing functions that you can use to make, for example, smooth step functions that are continuous. an expression V = V0+V1* (x>1) works well for many cases meaning V=V0 for X<= 1 and V=V0+V1 above. Thanks in advance. [QUOTE] Thank you! -- Version 5.2a Ivar. Using 'if' statement with two conditions - COMSOL Multiphysics the discontinuity issue is when you use such Dirac functions for the physics, then the solver might "jump over them" I had an expression as "max(p,-capillarypressure*(phils, Susant, Best, Suppose you have an integration operator intop1 and an expression u that you want to integrate over the rectangle x1Operators, Functions, and Constants - COMSOL Multiphysics My Email: athenaserra@gmail.com. Problem solved! You can also use max(f(t), 0). Good luck Hi Jing, glad you found it useful. Discontinuous functions like the step function above might cause numerical difficulties. say, integrating an field-expression within bounds of (x1,,y1) and (x,y) in a 2d model (x1 I found the solution and I'm going to share it with you. then what about: To start a new discussion with a link back to this one, click here. Best, I get an error message when trying to open my glTF-file in an external viewer, Using the Previous Solution Operator in Transient Modeling. A logical expression is a statement that evaluates to either "true" or "false." Relational operators are a type of logical operator, and compare two values such as 5 > 4 (true) or 3 4 (false). Unterschleiheim. COMSOL offers a whole range of useful ones, not all equally obvious. Discussion Closed This discussion was created more than 6 months ago and has been closed. Best regards, Best regards, I have a similar problem. Alexandre. I am trying to use an if statement to get the value I want but keep getting a value of 0 for xi: Logical Expression - an overview | ScienceDirect Topics The with operator lets you postprocess more than one parametric or eigensolution in a similar fashion. Unterschleiheim - Wikipedia As most skilled COMSOL users, I am sure you know that you are not limited to just selecting what is in our drop-down lists. Go to Plot Parameters to find out what these predefined stresses are called (tresca_smsld and mises_smsld if you are modeling in 3D with the Structural Mechanics Module). I believe its not balck and white, it depends ;) but what is certain, and I'm sure this reminds you something from your math courses one should keep driving equations (for the solver) continuous, and derivative at least once, if nottwice. To add to Jeff's reply, COMSOL Multiphysics includes units for hour, day, and year, so you can use, for example, To add to Jeff's reply, COMSOL Multiphysics includes units for hour, day, and year, so you can use, for example, Your_value = (y==0)*(T==300)*(My_New_Value - Some_other_value) + Some_other_value To start a new discussion with a link back to this one, click here. In this way you ensure that the jacobian of your system can be evaluated without too much noise, hence the solver wil step through your discontinuity without failure Email: support@comsol.com. Duplicate variable name. You can fix this by pressing 'F12' on your keyboard, Selecting 'Document Mode' and choosing 'standards' (or the latest version Under Element Selection, enter a Logical expression for inclusion.Enter any logical expression using predefined variables and unit syntax if desired. They live on boundaries and help you evaluate anything with discontinuities. I didn't tested it, but it seems that it would work. I believe a Join data set should do the trick. Including Operators and Expressions in a Multiphysics - COMSOL Geometric Entity Selection Problems using logical expressions for "partly-coloured plot" - COMSOL What worked for me is V0(v. Hi, And if I want a whole expression to be above 0, for example? matlab returns a 1 to indicate true and 0 to indicate false. Learn Conditional Statements Within An Expression in COMSOL Multiphysics. You can see the Guide for details. You probably didnt think of it, but in the expression I just mentioned, sqrt, ^, and even + are all examples of operators. I can only think of two reasons for "oscillations": / 48.28333N 11.56667E / 48.28333; 11.56667. If not, please contact support@comsol.com with your model, and we should be able to give you some more specific advice. Ivar, Are there any way to make a 2D function? So I would advice to use a step function or a heaviside function with a smooth (but short) transition width f(t) = a+b*cos(2*pi*t/8760)+c*cos(2*pi*t/24) Alwaysmverify and validate your work,in steps it's easier ;) if(f(t)>0, f(t), 0) - Variable: mod1.p Ivar, Hi, It must be there, but where?? If you provide a description, COMSOL uses that and it appears among the other expressions in alphabetical order; otherwise the variable name appears within parentheses. 1 Reply Last Post Apr 23, 2015, 2:43 a.m. EDT. My intention is to plot a 2D Model where only a part is shown coloured. Conditional Statements Within An Expression in COMSOL Multiphysics I am using the d operator but it isnt working for me. enter it in as a function and plot it, that is the easiest way I know to check equations in COMSOL I want to calculate the value of the x coordinate when y = 0 and T=300. I would really appreciate some help! For example: 0.1 < x < 0.3 and -0.1 < y < 0.1. How can a funtion be applied in a boundary expression? If you have created your own subdomain expression my_stress containing your stress definition, d(my_stress,t) gives the same results. hi, i wonder could i set a condition that means "the time when temperature reaches to a certain level"? For example, x>2[cm] filters the plot to only include the part of the geometry where x > 2 cm. Halima Kazdaba. Thanks for any help. i.e. See the COMSOL Multiphysics User's Guide and the following Knowledge Base entry for details: -- if(T==300 && y == 0,xi == x) I tried to implement as a prescribed displacement : V0*(v, Hi gradT_ht will silently evaluate this gradient on both sides of the boundary and give you the average. (x==0)*(T==300)*YourValue You can fix this by pressing 'F12' on your keyboard, Selecting 'Document Mode' and choosing 'standards' (or the latest version Ivar, Hi, In 1D, the filter is applied to the points on the curves plotted using the plot node to which you add a Filter subnode. After I would created another one with a conditional statement: I need to couple two components comp1 and comp2 in logiciel Comsol. I tried the following expression with no success: Good luck 1 Reply, Please login with a confirmed email address before reporting spam. Error in multiphysics compilation. It said the expression is if(cond, expr1, expr2), I am not sure whether expr2 is necessary or not. Posted: 7 years ago. i = -(h>100) I have a similar problem in Darcy flow simulation where I want to change the field variable p only when a another field variable phils is below a certain value, the first error is: I have a similar problem in Darcy flow simulation where I want to change the field variable p only when a another field variable phils is below a certain value, the first error is: Hello my freinds, 1[a] Bavaria Schweisstechnik - Bavaria Welding where the last two expressions both evaluate to the number of seconds in an astronomical year (31557600 s). Best regards, Dinh An Posted Apr 23, 2015, 1:54 a.m. GMT+2 of 2 [mm] * 3 [mm], but not along the two edges at x=2 and y=3. Can anyone give an advice on how to implement a conditional statement with two arguments? In the COMSOL Multiphysics software, using Boolean and adjacent selections, you can create customized groups of geometric entities that update automatically when you change your model geometry. Your internet explorer is in compatibility mode and may not be displaying the website correctly. hi, i wonder could i set a condition that means "the time when temperature reaches to a certain level"? Discontinuous functions like the step function above might cause numerical difficulties. Unfortunately COMSOL replies with an Syntax Error when I try to realize this example. / 48.28333N 11.56667E / 48.28333; 11.56667. The numbers 24 and 8760 in your expression suggest to me that perhaps you think t is in hours (8760 is the number of hours in a year, 24 the number of hours in a day), when it's in seconds, the SI unit for time. Many thanks to the author for this useful information! Note that the default plot for complex fields shows the real part. I took the minimum temperature of a domain and i want to imply that the time when the minimum temperature in a system reaches 50 degC ? Your internet explorer is in compatibility mode and may not be displaying the website correctly. All of the following selection types use previously defined selections as input. How can a funtion be applied in a boundary expression? (^2) can change negetive sign to positive but why we should use abs before for example; abs(ewfd.s11)^2 to calculate norm of S11? These tables list the unary and binary operators ( Table 5-1 and Table 5-2 ), special operators ( Table 5-8 ), mathematical functions and constants ( Table 5-6 ), and physical constants predefined as variables ( Table 5-7) that are available in COMSOL Multiphysics. Good luck -- By the way, do you how to express an integral? Magnus Ringh, COMSOL. Yes you can. This is useful to add a conditional statement in expressions within the software. Something like: if (y ==0 and T == 300, xi == x) Would the AND logical operator (&&) work instead of the and in my above statement? This is done from Definitions > Model Couplings. I want to apply following step function in my temperature boundary condition: 8760[h] Best Regards, Can anyone give an advice on how to implement a conditional statement with two arguments? Use the imag operator to show its imaginary part, abs to plot the norm, or arg to see the phase angle. I hope this helps.
Multicraft Startup Parameters, Lenovo Singapore Career, Methionine Tablet Uses, Rile Hornets Crossword Clue, Techniques Of Group Decision-making,