Re: bvdae error when using NDSolve for initial value
- To: mathgroup at smc.vnet.net
- Subject: [mg102098] Re: [mg102063] bvdae error when using NDSolve for initial value
- From: DrMajorBob <btreat1 at austin.rr.com>
- Date: Wed, 29 Jul 2009 05:11:12 -0400 (EDT)
- References: <200907280605.CAA14835@smc.vnet.net>
- Reply-to: drmajorbob at bigfoot.com
The error message is complaining, I think, about the equation w[u]==w1[u]+w2[u] Also, the equation T'[u] == 0 makes T a constant. Hence, solving for T and w with NDSolve makes no sense. In addition, you can't specify "timer" both at 0 AND at 1, because then you have too many equations. If you eliminate some other equation, the two values for "timer" are probably inconsistent. Here's a code that works, at least, though it may not do everything you want: Clear[w1, w2, timer, w] w[u_] = w1[u] + w2[u]; T = 1; NDSolve[{w1'[u] == T w1[u]/w[u] (w1[u]/w[u])^(1 - \[Epsilon]), w2'[u] == T w2[u]/w[u] (w2[u]/w[u])^(1 - \[Epsilon]), timer'[u] == T (p1 w1[u] + p2 w2[u]), timer[0] == 0, w1[0] == 3/2, w2[0] == 1} /. {p1 -> 1/100, p2 -> 1/100, \[Epsilon] -> 1/2}, {w1, w2, timer}, {u, 0, 1}] Bobby On Tue, 28 Jul 2009 01:05:14 -0500, Damon <damonwischik at gmail.com> wrote: > I am trying to solve an initial value problem. I am getting the error > message "bvdae: Differential-algebraic equations must be given as > initial value problems". I don't know what the error means or how to > fix my equations. I would be grateful for any help. > > I started with the following differential equations. I want to find > the time T when timer[T]==8.3 (or some other arbitrary value), and I > want to evaluate w1[T] and w2[T] at that time. > > res = NDSolve[{ > w1'[u]==w1[u] 1/w[u] (w1[u]/w[u])^(1-\[Epsilon]), > w2'[u]==w2[u] 1/w[u] (w2[u]/w[u])^(1-\[Epsilon]), > w[u]==w1[u]+w2[u], > timer'[u]==(p1 w1[u]+p2 w2[u]), > timer[0]==0, > w1[0]==1.5, > w2[0]==1 > } /. {p1->.01,p2->.01,\[Epsilon]->.5}, > {w1,w2,w,timer},{u,0,11} > ] > > I transformed this into an initial value problem in standard form as > follows. > > Clear[w1,w2,timer]; > res = NDSolve[{ > w1'[u]==T[u] w1[u] 1/w[u] (w1[u]/w[u])^(1-\[Epsilon]), > w2'[u]==T[u] w2[u] 1/w[u] (w2[u]/w[u])^(1-\[Epsilon]), > w[u]==w1[u]+w2[u], > T'[u]==0, > timer'[u]==T[u] (p1 w1[u]+p2 w2[u]), > timer[0]==0, > w1[0]==1.5, > w2[0]==1, > timer[1]==8.3 > } /. {p1->.01,p2->.01,\[Epsilon]->.5}, > {w1,w2,w,T,timer},{u,0,1} > ] > > This gives me the error I quoted at the top of this post. I would be > grateful for hints about what I should do to solve my problem. > > Damon. > -- DrMajorBob at bigfoot.com
- References:
- bvdae error when using NDSolve for initial value problem
- From: Damon <damonwischik@gmail.com>
- bvdae error when using NDSolve for initial value problem