# Discussion Forum

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 step function in kinetic reaction simulation

Hi

I am trying to simulate the kinetic reaction of biomolecule interaction in fludic channel expecting to have association and dissociation phase (concentration of complex versus time) in the same curve. I knew that it is possible to use step function or smoothed Heaviside step function from COMSOL in order to change the concentration of analyte species at the inlet from C=x mol/m3 to C=0 mol/m3 at a certain time. I have no idea how to find this function and what kind of variables I need to defind. Anyone has any experience on this?

Regards,

Pattamon

5 Replies Last Post 29/01/2013, 04:01 GMT-05:00
Posted: 5 years ago
Hi

in v4 you find these under root-Globa-Definitions, or better: Model-Definitions-Functions, use the dynamic doc and search the HTML or PDF doc

--
Good luck
Ivar

Posted: 5 years ago
Hi,

I have tried to put the step function where I want to change the inlet concentration from c0 to 0 at time = 400s.
I defined the step function for concentration in the variables. It didn't not work for now. I guess my function is not correct or I need to add something more. I also attached my short simulation model here.

Pattamon

Posted: 5 years ago
Hi

first of all your shape is very thin, with only 1 element across you do not resolve a lot, try to scale the vertical axis by i.e 100 in the mesh advanced tab.

Then your process is over in 4 seconds, your solver steps seem to be far too long, what about cutting your rectangle with a layer (geometry tab) at te half height of 0.3 um, then solve and look at the concentration along this central line in a line plot

--
Good luck
Ivar

Posted: 5 years ago
Hi,

The step function uses the concentration as the input argument (the switch), but that should be the time t. Also the step amplitude is the concentration c0, so I don't see why that value is multiplied with the step output in the variable intl: c0*step1((c0-0)[m^3/mol])

I think that you should use:

step1(t[1/s])[mol/m^3]

where "[1/s]" is used to make the argument unitless and the unit of the output is mol/m^3 for a concentration.

Also, perhaps the initial value should be c0 rather than 0? Now the initial value and the boundary condition for the concentration don't match at the start of the simulation.

Best regards,
Magnus Ringh, COMSOL

Posted: 5 years ago
Hi

Thank you so much for all advices. It works now :)

Best Regards,

Pattamon

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.