Re: NDSolve w/ vectors requires homogenous system in 5.0
- To: mathgroup at smc.vnet.net
- Subject: [mg42803] Re: [mg42789] NDSolve w/ vectors requires homogenous system in 5.0
- From: Selwyn Hollis <selwynh at earthlink.net>
- Date: Wed, 30 Jul 2003 04:07:29 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I've just noticed the same problem with nonhomogeneous systems. For instance, this works: NDSolve[ {x'[t] == {{-1, 1}, {1, -1}}.x[t], x[0] == {1, 1}}, x, {t, 0, 1} ] but this doesn't: NDSolve[ {x'[t] == {{-1, 1}, {1, -1}}.x[t] + {1, 0}, x[0] == {1, 1}}, x, {t, 0, 1} ] Pretty lame. ----- Selwyn Hollis http://www.math.armstrong.edu/faculty/hollis On Saturday, July 26, 2003, at 04:32 AM, Brian Dale wrote: > It seems that the NDSolve portion works fine, but that the functions > such as Cross and Plus have trouble working correctly with the > required mix of numeric and symbolic vectors. The effect of this is > to restrict vector diff eqts to homogenous systems. Here are my > results: > > The Bloch equation (fundamental equation for magnetic resonance > imaging) describes the motion of an isochromat in a magnetic field. > For all parameters = 1 (for simplicity) I can define the following: > > b = {1,1,0} represents the magnetic field > d = DiagonalMatrix[{1,1,1}] represents the signal decay > r = {0,0,1} represents the signal regrowth > bd = {{-1,0,-1},{0,-1,1},{1,-1,-1}} represents field and decay > bdr = {{-1,0,-1,0},{0,-1,1,0},{1,-1,-1,1},{0,0,0,0}} represents > everything for the augmented coordinate system {x,y,z,Mo} > > m0 = {0,0,1} initial magnetization > ma0 = {0,0,1,1} augmented initial magnetization > > The Bloch equation can be written in 3 ways: > > eq1:= {m'[t] == Cross[m[t],b] - d.m[t] + r , m[0] == m0} > eq2:= {m'[t] == bd.m[t] + r , m[0] == m0} > eq3:= {ma'[t] == bdr.ma[t] , ma[0] == ma0} > > NDSolve[eq1, m, {t,0,10}] generates the message Cross::nonn1 > (arguments should be equal-length vectors) and the message > NDSolve::ndfdmc (inconsistent dimensionality) and fails. > > NDSolve[eq2, m, {t,0,10}] generates the message NDSolve::ndfdmc > (inconsistent dimensionality) and fails. > > NDSolve[eq3, ma, {t,0,10}] succeeds. > > If I remove the r term from eq1 and eq2 then: > > NDSolve[eq1, m, {t,0,10}] still generates the message Cross::nonn1 but > succeeds (with no regrowth). > > NDSolve[eq2, m, {t,0,10}] succeeds (with no regrowth). > > The success with eq3 seems to indicate that NDSolve itself is capable > of solving the equation, but the failure of the others seems to show > that the equations must be entered such that each term contains an > unknown vector. > > Does anyone have any other experience with this? Perhaps there is an > easy work-around that doesn't require the augmented coordinate system > with its wasteful computation of the 4 the coordinate. Any input > would be appreciated. > > -Thanks > Brian Dale > > > > >