Quantcast
Channel: Solving, solving\ - Latest Discussions - COMSOL Forums
Viewing all articles
Browse latest Browse all 3988

Changing/resetting dependent variables while solving differential equations

$
0
0
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

Viewing all articles
Browse latest Browse all 3988

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>