Skip to main content
February 26, 2010
Question

ODE with too many IC- another one

  • February 26, 2010
  • 8 replies
  • 4687 views
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

1-Visitor
February 26, 2010
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
February 27, 2010
Sorry. Left over from the last attempt. Without the subscript the Too Many IC error shows up.
1-Visitor
February 27, 2010
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