cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

ODE with too many IC- another one

tdoupe-disabled
1-Newbie

ODE with too many IC- another one

I am building my up to a "real" problem. I can do a simple integration and was able to follow the example in the V11 Manual. ( I have V13- but the manuals were more thorough back then.)

I tried to replace the last term with a function. That works. I put the function Q(t) in the Solve block - not particularly useful- but that also works. SecondOrder -2 section

I then added a differential equation that should result in the same function being generated (Q(t)) -- but get too many IC error. SecondOrder-3 section.

How do I get a solution for both P(t) and Q(t). There shouldn't be any numerical issues if the example solution exists?

Attached in V11.
8 REPLIES 8

You cannot put a function definition in a solve block. You can (with MC12+) physically place a definition so that it appears to be within the solve block. But it is not logically a part of the solve block, and does not actually work as you might expect. This is even more true if you use the global assignment, which causes the definition to be evaluated outside the normal ordering.

Your sheet does not show a too manyt IC error. Your problem in the definition of QQ and PP is that you have defined T to be just one element of the ODESolve result (by using a subscript) but then attempt to assign both values with a parallel assignment. Either get rid of the subscript (so that T returns a vector of functions), or get rid of the parallel assignment (assign the scalar result to a simple name).
__________________
� � � � Tom Gutman

Sorry. Left over from the last attempt. Without the subscript the Too Many IC error shows up.

Exactly what version of Mathcad are you using, and which of the various examples in the sheet are you complaining about? I don't see any too may IC errors in the sheet under MC14. The example where you had the extra subscript works correctly without it.

The hidden example for the Windkessel complains about α being undefined. But that block does in fact have too many initial conditions, Count them, and count up the requirements. You have on first order ODE, which requires one initial condition, and one algebraic constraint, which requires one initial condition. But your solve block has four initial conditions. Why would you expect it to work?
__________________
� � � � Tom Gutman

I am using V13. Here is the V13 sheet with just the problem of interest(for now) on it.
I get the Too Many IC error when I call T(100,10,101)

I was able to formulate the same problem using the command line function (rkfixed). This worked as expected.

I can proceed using rkfixed. Just curious if anyone else using V13 sees the Too Many IC error when using ODESolve. Clearly, Tom G is not seeing it in V14.

Thanks for your help, Tom.

Tom Doupe

I don't see the error using MC13.1. It might be a problem in the original release of MC13, fixed with the service pack. You should get the service pack and see if the problem goes away.
__________________
� � � � Tom Gutman

Good news. Bad news.

Good news: Service pack 13.1 did get an answer to the problem in the previous sheet.

Bad news: I pulled a parallel RLC circuit from a EE101 text book. It is solved analytically with two initial conditions -- makes sense for a second order equation.

V13.1 and the trial version of V14 give "Too many Initial Conditions" error.

What am I missing?

Tom D

While in the ODE itself you can use either Leibnitz notation or prime notation for derivatives, in the initial conditions you must use prime notation. You cannot use Leibnitz notation (note that in the initial conditions the argument to the unkown function is not a variable but a constant).

In ODESolve the name of the unknown function is optional and should be omitted when there is only one unknown function. If it is included, it must still have the form of a vector of names, not just a scalar.
__________________
� � � � Tom Gutman
Top Tags