10 Replies Latest reply: Nov 3, 2011 1:34 AM by Efried

# Solve second order ordinary differential equations with boundary conditions

i have been able to solve second order ordinary differential equations but with initial conditions for the function and its first derivative. i need to solve the same differential equation with boundary conditions.

Rogelio

• ###### Re: Solve second order ordinary differential equations with boundary conditions

A solution for one equation:

• ###### Re: Solve second order ordinary differential equations with boundary conditions

Is it possible to embedd this odesolve block in another solve block?

Please find attached an axample which does not work.

any hep is highly appreciated.

thanks

• ###### Re: Solve second order ordinary differential equations with boundary conditions

In your document many indefinite variables (if you want to use procedure "Given-Find" for the numerical solution of the equations).

• ###### Re: Solve second order ordinary differential equations with boundary conditions

That would be a surprise that Mathcad needs a definition of the variables before calling the function where they appear.

Mathcad is able to solve the solve block if there is a vector asignement but fails miserably (hangs, shows wrong errors) if the same solve block ends with an assignement of the solution to a function .

• ###### Re: Solve second order ordinary differential equations with boundary conditions

Error disappears if you remove the units from the last assignment. You'd have to put them back after assigning individual parameters to the solution.

Alan

• ###### Re: Solve second order ordinary differential equations with boundary conditions

Hello Alan,

you saved my week end- it looks ugly removing alsway the unist (because this is an Mathcad's USP) and and I don't understand the trick (because the units are removed once more in the solve block where necessary), but it helps indeed!

many thanks

• ###### Re: Solve second order ordinary differential equations with boundary conditions

Hello Alan,

I'm sorry the results are just random - doing this way the calculation is not made properly.

best regards

Gerfried

• ###### Re: Solve second order ordinary differential equations with boundary conditions

Gerfried Cebrat wrote:

Hello Alan,

you saved my week end- it looks ugly removing alsway the unist (because this is an Mathcad's USP) and and I don't understand the trick (because the units are removed once more in the solve block where necessary), but it helps indeed!

many thanks

The final Given ... Find solve block assigns the results to a single vector, in effect. Mathcad (prior to Prime) doesn't accept vectors whose elements have different units. Removing the units from the output arguments simply allows the block to do the final assignment.

The validity of the results is a different matter. Your problem is obviously a heat transfer one of some sort. However, you have not provided enough information to allow us to pin down the problem any further. You need to provide comments on what each part of the program is trying to achieve, give an indication of the sort of results you are expecting, and, most importantly, provide values of the many parameters used as input arguments to your solve blocks, so we can run test calculations.

Alan

• ###### Re: Solve second order ordinary differential equations with boundary conditions

Hello,

looking at the response from mathcad 14 like "interal error" or "bad_pattern" I get more confused but will try to create a set-up where you might help me.

regards

• ###### Re: Solve second order ordinary differential equations with boundary conditions

For solution of the system of odes you can use the function sbval for the finding the initial conditions (a Coushy task) and than use functions rkfixed, rkadapt odesolve etc