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.

Changing/resetting dependent variables while solving differential equations

Please login with a confirmed email address before reporting spam

Hello,

I have a system of two differential equations in the form,

x' = a*x^2 + b*x + c*y

and

y'=c*x + d*y

a, b, c and d are parameters.

Depending variables has to change to different values depending on the following condition,

if x > A, then x = B and y = C

A,B and C are another set of parameters (constants).

Currently I'm solving the equations for a 1D system, where I've used Boundary ODEs and DAEs to setup the two equations. However I'm confused on how to introduce the reset equations to the system when the condition is satisfied. If I do this in MATLAB using euler method, I can easily add an if statement and change the values of x and y used for the next step. But I'm struggling to set this up in COMSOL. Any advice would be greatly appreciated.

Thank You
Saliya

0 Replies Last Post 06.01.2016, 14:51 GMT-5
COMSOL Moderator

Hello Saliya Kumara

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

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.