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.
Simple example to solve ODE
Posted 10 mag 2013, 13:17 GMT-4 Modeling Tools & Definitions, Parameters, Variables, & Functions, Studies & Solvers Version 4.3a 2 Replies
Please login with a confirmed email address before reporting spam
Hi,
I am a complete newbie with COMSOL (I have the MultiPhysics module, version 4.3a), and I have only followed some initial tutorial examples in the manual (e.g. "the wrench").
However, as I understood, there are also ways to solve ODEs (ordinary differential equations). I wanted to start with something really simple, and on the internet I found some example involving the predatory model:
#rabbits: dr/dt = a*r - b*r*f
#foxes: df/dt = -c*f + d*r*f
However, the example I found is clearly meant for a different COMSOL version because the description of buttons/menus to use does not correspond to my version.
To give it a go anyway, I used the "Global ODEs and DAEs" node, and in the "Global Equations 1" settings window, defined:
r*(a-b*f)-rt (initial value r: 100, initial value rt: 0)
-f*(c-d*r)-ft (initial value f: 100, initial value ft: 0)
My question is (and this might come from a complete misunderstanding of how COMSOL works):
- Where do I define the upper and lower bounds for t? (In the geometry, but how?)
- how do I get a plot showing r and f versus t? (Do I need to use "parameter sweep" for this?)
- Is it possible to just solve a 1-D ODE without selecting any kind of other physics models?
- Is there any example around for version 4.3a?
- (I actually tried to just click on "Study1->Calculate" and while the program does not complain, I also have no idea how to get the plot I want)
Best regards,
Machiel
I am a complete newbie with COMSOL (I have the MultiPhysics module, version 4.3a), and I have only followed some initial tutorial examples in the manual (e.g. "the wrench").
However, as I understood, there are also ways to solve ODEs (ordinary differential equations). I wanted to start with something really simple, and on the internet I found some example involving the predatory model:
#rabbits: dr/dt = a*r - b*r*f
#foxes: df/dt = -c*f + d*r*f
However, the example I found is clearly meant for a different COMSOL version because the description of buttons/menus to use does not correspond to my version.
To give it a go anyway, I used the "Global ODEs and DAEs" node, and in the "Global Equations 1" settings window, defined:
r*(a-b*f)-rt (initial value r: 100, initial value rt: 0)
-f*(c-d*r)-ft (initial value f: 100, initial value ft: 0)
My question is (and this might come from a complete misunderstanding of how COMSOL works):
- Where do I define the upper and lower bounds for t? (In the geometry, but how?)
- how do I get a plot showing r and f versus t? (Do I need to use "parameter sweep" for this?)
- Is it possible to just solve a 1-D ODE without selecting any kind of other physics models?
- Is there any example around for version 4.3a?
- (I actually tried to just click on "Study1->Calculate" and while the program does not complain, I also have no idea how to get the plot I want)
Best regards,
Machiel
2 Replies Last Post 13 mag 2013, 09:32 GMT-4