Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Using a function as an input to simulate turn-on turn-off sequence

Please login with a confirmed email address before reporting spam

I'm using the Joule Heating module and I'm modeling a simple wire heater that heats up when I run a current trough it. I want to see how the temperature of the heater decays as a function of time in order to see if it falls off exponentially and check that the simulation is correct. However to do this I have to run the current for a while and then turn it off. To simulate this I created a piecewise function whose value is 2mA from 0 to 5s and then it's 0mA from 5 to 10s. I used continuous 1st derivative with a transition zone size of 0.1.

In my terminal node I write the name of my piecewise function rather than a number and I run the simulation. I get the error:

Failed to evaluate variable Jacobian.
- Variable: myfunc
- Global scope
- Feature: Time-Dependent Solver 1 (sol2/t1)

What am I doing wrong? How do implement a function as input for the current to simulate turning off the current?


2 Replies Last Post 21 janv. 2014, 09:19 UTC−5

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 20 janv. 2014, 03:07 UTC−5
I always use flc2hs function. Try

I0 = 2[mA]
ts = 5[s]
I = I0*(flc2hs(t,0.01)-flc2hs(t-ts,0.01))

Wish this helps
Lasse
I always use flc2hs function. Try I0 = 2[mA] ts = 5[s] I = I0*(flc2hs(t,0.01)-flc2hs(t-ts,0.01)) Wish this helps Lasse

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 21 janv. 2014, 09:19 UTC−5
Hello,

You can use the piecewise function,
Use the second derivative it's better.
Don't rename the piecewise function
In the terminal tape: pw1(t[1/s])
pw1 is where you have define your current in function of time.

Best regards

Julien
Hello, You can use the piecewise function, Use the second derivative it's better. Don't rename the piecewise function In the terminal tape: pw1(t[1/s]) pw1 is where you have define your current in function of time. Best regards Julien

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.