Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Solve non linear second order differential equatio...

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-28-2019
12:50 PM

02-28-2019
12:50 PM

Re: Solve non linear second order differential equation with initial and boundary condition

Thanks a lot Luc. F9 sorted that particular problem.

The 3 d plot is slightly confusing. How can I plot phi vs x for a particular time t. The particle volume fraction should be higher at the base (x=0) compared to the rest of the solution after sedimentation. Please see attached image. If I can get a profile similar to that, then I think the model is a success. Thanks a lot for the help.

Another question is if I want to do this in prime can I use numol instead of pdesolve.

Regards,

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-28-2019
12:50 PM

02-28-2019
12:50 PM

Re: Solve non linear second order differential equation with initial and boundary condition

Thanks a lot Luc. F9 sorted that particular problem.

The 3 d plot is slightly confusing. How can I plot phi vs x for a particular time t. The particle volume fraction should be higher at the base (x=0) compared to the rest of the solution after sedimentation. Please see attached image. If I can get a profile similar to that, then I think the model is a success. Thanks a lot for the help.

Another question is if I want to do this in prime can I use numol instead of pdesolve.

Regards,

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-28-2019
01:18 PM

02-28-2019
01:18 PM

Re: Solve non linear second order differential equation with initial and boundary condition

I should think that the attachment of my Mathcad 11 file today shows a plot of phi versus x at tp=20 h.

I was surprised that I got a result from pdesolve so quickly. Next I was surpised by the result itself, showing that the particle concentration at any given time would fluctuate over height, and realised that it doesn't match what the authors of the article found. That's why I hinted that I may have made a mistake somewhere. The authors indicate at some point that the numerical approximation is tricky. Maybe pdesolve is fooled and/or not the right tool for this problem.

As for numol: I have little experience with pdesolve (I can remember having used it only 1 time in the past 10 years, and that was somewhere in the past few days...), much less experience with numol. I just read the description, and it seems worth a try. Go ahead and share your results. But don't expect completely different results. It may very well be that the numeric algorithm underlying both pdesolve and numol are equivalent, if not the same.

Success!

Luc

P.S. Found one error, see attachment for correction.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-28-2019
02:14 PM

02-28-2019
02:14 PM

Re: Solve non linear second order differential equation with initial and boundary condition

Hi Luc,

Thanks. Just saw the plot.

What I am noticing is that the phi never reaches phi eff.max near the base. it is always around phi0. If I increase the phi0 value (lets say by 3 orders of magnitude or more), then it gives me an error saying that there is a singularity. I also noticed in the pde that the (1-phi (x,t)/phi effmax)^2 is missing. Maybe that can make a difference.

I don't know much about pdesolve to comment on how it might be getting tricked to give the wrong answer. Do you know why it can happen.

Regards

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-28-2019
02:16 PM

02-28-2019
02:16 PM

Re: Solve non linear second order differential equation with initial and boundary condition

Never mind. You replace it by a1. It must be due to something else.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-28-2019
03:31 PM

02-28-2019
03:31 PM

Re: Solve non linear second order differential equation with initial and boundary condition

Numerical instability. Small differences in numbers giving large differences in results.

Example: working with x close to 1 on the function 1/(1-x)...

Some numerical methods are more stable than others.

That's one of the reasons why my preference always is to find a symbolic solution first. In the case of your problem I don't see a way to that yet.

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-28-2019
04:38 PM

02-28-2019
04:38 PM

Re: Solve non linear second order differential equation with initial and boundary condition

Hi Luc,

The problem here is if I increase the volume fraction phi 0 (see attachment), it returns an error. Is there any way around this? The paper talk about breaking the pde into coupled system of ODEs. They used matlab though.

Regards.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-28-2019
04:49 PM

02-28-2019
04:49 PM

Re: Solve non linear second order differential equation with initial and boundary condition

This is the info on pdesolve in mathcad 11:

"Pdesolve(u, x, xrange, t, trange, [xpts], [tpts])) Returns a function or vector of functions of x and t that solve a 1-dimensional nonlinear PDE or system of PDEs. Values are interpolated from a matrix of solution points calculated using the numerical method of lines."

And this is the info on numol in Prime:

"

- numol(x_endpts, xpts, t_endpts, tpts, num_pde, num_pae, pde_func, pinit, bc_func)
Returns an [xpts x tpts] matrix containing the solutions to the one-dimensional Partial Differential Equation (PDE) in pde_func. Each column represents a solution over one-dimensional space at a single solution time. For a system of equations, the solution for each function is appended horizontally, so the matrix always has xpts rows and tpts * (num_pde + num_pae) columns. The solution is found using the numerical method of lines.

"

So numol will solve a matrix of points using the same 'numerical method of lines' that pdesolve uses to create a matrix and allow the result to be used as a function (by interpolation), similar to how rkfixed and odesolve are related for ODE's.

I can choose between 4 different interpolation methods for pdesolve in mathcad 11.

Sounds like you should be able to produce the very same 3D graph in Prime.

Success!

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-01-2019
12:37 PM

03-01-2019
12:37 PM

Re: Solve non linear second order differential equation with initial and boundary condition

Hi Luc,

I have tried to use numol in mathcad prime. Just wanted to see whether we get a different result. However, I am getting an error. I need some help with it (file attached).

Also from the paper , hindered settling velocity u(phi) is positive in the upward direction (direction opposite to settling). Kindly check attachment.

That may give a different result. For the time being I haven't made any changes. Just wanted to see what I get with numol. Thanks a lot for the help.

Regards

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

03-01-2019
05:29 PM

03-01-2019
05:29 PM

Re: Solve non linear second order differential equation with initial and boundary condition

Just above calling numol, you define bc_funct(t), in which you call the function bc() twice. But you call bc() with just one parameter, while it is defined (right above there) to have/require two parameters. That is what the error message, attached to the matrix M (below calling numol), is complaining about.

(Providing clear and to-the-point error emssages was never a strong point of Mathcad, and Prime didn't improve much on that point.)

Success!

Luc

Top Tags