Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Solving an unusual system of ODES
Replies: 7   Last Post: Apr 10, 2013 3:24 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
DRG

Posts: 44
Registered: 12/8/08
Solving an unusual system of ODES
Posted: Apr 9, 2013 6:55 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I'm quite new to ODE45, and have a form of an equation I wish to solve with some unusual features - C is a function of r. I want to evaluate it on the interval [RN RO] where RN is not equal to zero. It is a second order equation and I have reduced it into a series of first order equations so ODE45 can handle it. The X vector for these equations is


X(1) = C
X(2) = Z = C'


Now, I can convert this to two order ODES. In this case, J, H and K are known constants and I get.....

dX(1) = X(2)

dX(2) = (J*X(1) - (2/r)*(X(1) + K)*X(2))/(X(1) + K)

I know also that

C(RN) = 0 so then X(1) @ RN = 0
Z(RN) = 0 so then X(2) @ RN = 0

However, I'm confused about how to implement this for 2 reasons; (1) my equation dX(2) has an r term in it, which C is a function of; how do I make MATLAB recognise this?

and (2) My initial conditions (or in this case, an analog of initial conditions as r refers to radius rather than time) are not zero; all values of C from 0 to RN are already zero, and I want to evaluate the function between the limits [RN RO].

Does anyone know if this is possible, and how one would implement this? I'd be most grateful for answers, as my knowledge is limited here and it seems an unusual form so I can't find examples to work with...

DRG




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.