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.

Defining time parameter

Lampros Papadopoulos BFH Praktikant

Please login with a confirmed email address before reporting spam

I would like to insert a sinus waveform as an input for electric potential. For that to happen, I need to instert the time parameter. I have tried many ways but I get errors like":

"Error in multiphysics compilation. Syntax error in expression. - Expression: [sec] - Subexpression: [sec] - Position: 1"

Could anyone help? Thanks in advance.



6 Replies Last Post 8 set 2022, 08:35 GMT-4
Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 5 set 2022, 08:42 GMT-4

Hi Lampros,

To define seconds, use [s] or [second]; [sec] is not a valid unit in COMSOL Multiphysics. SI prefixes are also supported, such as [ms] for milliseconds, as well as [min], [h], and [a] for minutes, hours, and years, respectively. See the user documentation for a full list of supported unit systems, units, and SI prefixes.

Best regards,

Magnus

Hi Lampros, To define seconds, use `[s]` or `[second]`; `[sec]` is not a valid unit in COMSOL Multiphysics. SI prefixes are also supported, such as `[ms]` for milliseconds, as well as `[min]`, `[h]`, and `[a]` for minutes, hours, and years, respectively. See the user documentation for a full list of supported unit systems, units, and SI prefixes. Best regards, Magnus

Lampros Papadopoulos BFH Praktikant

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 5 set 2022, 09:05 GMT-4

Hello Magnus,

First of all, thank you for the quick responce. Yes, I have tried that too. That does not seem to be the problem. Even if I change [sec] to [s]. I get the exact same error:

"Error in multiphysics compilation. Syntax error in expression. - Expression: [s] - Subexpression: [s] - Position: 1"

Best regards, Lampros

Hello Magnus, First of all, thank you for the quick responce. Yes, I have tried that too. That does not seem to be the problem. Even if I change [sec] to [s]. I get the exact same error: "Error in multiphysics compilation. Syntax error in expression. - Expression: [s] - Subexpression: [s] - Position: 1" Best regards, Lampros

Magnus Ringh COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 5 set 2022, 09:29 GMT-4

Hi Lampros,

Then there is some other issue with the expression. I think you need to display the entire expression for us to be able to pinpoint what could be wrong.

Best regards,

Magnus

Hi Lampros, Then there is some other issue with the expression. I think you need to display the entire expression for us to be able to pinpoint what could be wrong. Best regards, Magnus

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 5 set 2022, 13:41 GMT-4

The argument for the function Vin must be dimensionless. Try using Vin(t/1[s]).

The argument for the function Vin must be dimensionless. Try using Vin(t/1[s]).

Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 6 set 2022, 16:05 GMT-4

Hello Lampros,

The problem is your Variable 3 node, which you use to define a variable t as [sec]. In a time-dependent analysis, t is automatically defined as time, so you do not need to create this Variable 3 node at all, and you can -and should- remove it; as Magnus mentioned already [sec] is not a valid expression, it's not even the right notation for "second", [s] is ; this is causing the error. When you remove that node, the compilation error disappears.

With that said, I have not let your model run to completion, so there may be other issues with your set-up.

Best,

Jeff

-------------------
Jeff Hiller
Hello Lampros, The problem is your Variable 3 node, which you use to define a variable t as [sec]. In a time-dependent analysis, t is automatically defined as time, so you do not need to create this Variable 3 node at all, and you can -and should- remove it; as Magnus mentioned already [sec] is not a valid expression, it's not even the right notation for "second", [s] is ; this is causing the error. When you remove that node, the compilation error disappears. With that said, I have not let your model run to completion, so there may be other issues with your set-up. Best, Jeff

Lampros Papadopoulos BFH Praktikant

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 8 set 2022, 08:35 GMT-4

Ok, thank you all very much for your replies! Will look into it.

Ok, thank you all very much for your replies! Will look into it.

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.