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
- :
- Function will not converge

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

10-22-2013
03:45 AM

10-22-2013
03:45 AM

Function will not converge

Hi,

I am calculating dynamic pressures on a moving gate and cannot get the integral for vertical force Fv(t) to converge. I have tried adjusting the convergence tolerance but this does not seem to make any difference. Any clues would be appreciated.

Cheers

Ross

20 REPLIES 20

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

10-22-2013
04:41 AM

10-22-2013
04:41 AM

Re: Function will not converge

See if the attached helps.

Alan

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

10-23-2013
02:29 AM

10-23-2013
02:29 AM

Re: Function will not converge

Alan,

Yes indeed your modification did help. If I now take this function and wish to use it in an Odesolve block as the final step I hit the wall with another error. Any clues to de-bug this would be appreciated.

The problem I am trying to solve can be unstable with divergent response, however, it should be stable and converge when the damping (zeta) is a modest value (i have used 0.05 or 5%).

Thanks again

ross

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

10-23-2013
04:22 AM

10-23-2013
04:22 AM

Re: Function will not converge

Ross

The attached works - the ODE solver worked ok, it was just the plotting that confused it (because of a previously defined set of t's).

However, I notice that the solve block contains M(t), which is a function of Fv(t), which is in turn a function of pp(t,y), which is a function of dtheta/dt - in your case a previously set function of dtheta/dt, not the one you are currently solving for within the solve block. Is this what you intend?

Alan

Edit. Also, it is a function of theta, through F(t,s). Again this isn't the theta that the ODE block is solving for. Is this right?

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

10-23-2013
08:54 AM

10-23-2013
08:54 AM

Re: Function will not converge

Edit. Also, it is a function of theta, through F(t,s). Again this isn't the theta that the ODE block is solving for. Is this right?

Guess no and it makes quite a difference. See below.

BTW, I wondered why everytime I ran the sheet I had an Excel sheet ("height 2.xls") in the same directory the file would be in. At last I found that the evaluation of Z= is the cause - in its properties the creation of that file is activated. It was first introduced in Ross' version 5 sheet. Nasty, that hidden way to write to my disk. Its cleared in the attached sheet.

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

10-23-2013
09:08 AM

10-23-2013
09:08 AM

Re: Function will not converge

Although this gets in the thetadot term it doesn't account for the theta term under the integral in F(t,s), which is part of the definition of pp.

Hadn't noticed the spreadsheet! Good catch!

Alan

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

10-23-2013
09:27 AM

10-23-2013
09:27 AM

Re: Function will not converge

AlanStevens wrote:

Although this gets in the thetadot term it doesn't account for the theta term under the integral in F(t,s), which is part of the definition of pp.

Oh,yes. I missed that. Was a quick hack - too quick! So the the sheet would need some more modifications as I think odesolvbe will not work with a function to solve for as a parameter of another function involved.

Hadn't noticed the spreadsheet! Good catch!

To be honest I wasn't really fully aware that its so easy to export data using a simple evaluation ;-)

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

10-23-2013
11:01 AM

10-23-2013
11:01 AM

Re: Function will not converge

Werner Exinger wrote:

So the the sheet would need some more modifications as I think odesolvbe will not work with a function to solve for as a parameter of another function involved.

I think one would have to obtain dF(t,s)/dt and solve for F simultaneously with theta etc. However, it's possible that Ross has just used the same symbol (theta) for two entirely different parameters, so it's not worth thinking about in more detail until we hear from him!

Alan

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

10-23-2013
08:16 PM

10-23-2013
08:16 PM

Re: Function will not converge

Alan,Werner,

Again thanks for your interest.

Theta(t) is indeed consistent in all of the integral equations and equation of motion in the solve block.We could delete the assignment of theta(t) as a sinusoidal function at the top of the sheet. I included this to determine what a reasonable initial condition would be for thetadot(t), and I have used thetadot(0)=0.013 in the solve block. If the theta(t) defined at the top of the sheet is used throughout then this is not correct as the system would be forced continuously with this sinusoidal function. We really only need an inital velocity perturbation to get the system going to then see if unstable behaviour results.

The system response is expected to be a sinusoidal function that will vibrate at the natural frequency *w*o. The problem requires an initial disturbance thetadot(0) = some positive value, and the system will be stable/unstable depending on water height, damping etc.

If we elimiate this theta definition at the top of the sheet then F(t,s), pp(t,y), Fv(t), M(t) would all need to include theta as a variable.

When I included theta in F(t,s,theta) the symbolic solution gives an error as being recursive - which I guess makes sense. So I am bit stumped where to go from here?

Cheers

Ross

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

10-23-2013
10:17 PM

10-23-2013
10:17 PM

Re: Function will not converge

Yes, seems to be not that easy. Alan suggested to solve for F(), too and use the derivative of F in the solve block. But I am not quite sure, how.

Top Tags