Skip to main content
1-Visitor
May 20, 2014
Solved

Problem with Units in odesolve

  • May 20, 2014
  • 8 replies
  • 5212 views

Hello,

I'm trying to solve an ode in Mathcad Prime 3.0 using odesolve. I know the analytical solution (which I used to calculate the "initial" condition since the actual problem has a Neumann BC @ x=0 and I believe that for second order ode's we cannot use a Neumann bc as the "initial" condition).

The problem I'm having is that Mathcad says that the units are not compatible. However, I have triple checked the units and they are correct.

Please take a look at the worksheet attached and let me know your thoughts/comments/suggestions.

Thanks!

Best answer by ValeryOchkov

I think the odesolve is not for a boundary problem. Try pls solve a Coushy problem and than the boundary problem with shot method for example.

See pls the attsch.

8 replies

24-Ruby IV
May 20, 2014

I think the odesolve is not for a boundary problem. Try pls solve a Coushy problem and than the boundary problem with shot method for example.

See pls the attsch.

1-Visitor
May 20, 2014

Hello Valery,

Thank you so much for your help!

What is interesting is that if I remove the units, odesolve solves the equation with any combination of boundary conditions. For example, I can specify the Neumann BC @ x=0 and the prescribed temperature @ the right (or left) boundary. Likewise, I can specify the prescribed temperatures at the left and right boundary and odesolve still works. It is only when I introduce the units that I get into trouble.

As you indicate, it looks like in order to use odesolve with units, we need to specify the initial values for n-1 unknown functions. For instance, in this case we are solving a second order ODE (n=order +1=3), thus we need to specify the "initial" conditions for the the function and its derivative at x=0. It is important to note that we are actually transforming the boundary problem into an initial value problem. Also, we already had the analytical solution so we could use that to determine the value of the function at x=0. However, when this is not readily known, we use the built-in function sbval to find the initial value using the known boundary condition at a location other than x=0.

Thanks again!

Regards,

Josué

P.S. See the attched file in which I'm using sbval to determine the intial condition.

Message was edited by: Josue Adorno Nunez

24-Ruby IV
May 20, 2014

Does sbval work with units?

See pls http://communities.ptc.com/message/243550#243550