Find function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Find function
Mathcad Prime 7
I'm trying to find solution with solve block, but possibility to find result depends on "x" (would like to find) initial value. How to determine proper "x" initial value? I would like to use Mathcad for automation, but if it's not clear what initial value I must use, it will not be possible. Thank you!
Solved! Go to Solution.
- Labels:
-
Mathcad Usage
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@LucMeekes wrote:
It's the 'return from above', the other one is hard(er) to find.
I don't think that the second solution is harder to find, but its not positive so it may not be of interest 😉
Actually there are two negative solutions - one at -0.296 and the other at -249.4.
We have two vertical asymptotes and the two solutions are at the left of the leftmost and to the right of the rightmost asymptote.
You demand your solution to be in the interval from 0 to b.p1=0.36. So why a guess of x=1. Actually even higher guess values work OK, but I would rather use b.p1/2, a value sure within the interval the solution is supposed to be.
Prime does not help in automatically choosing an appropriate guess value (if Prime could do so, it would not be necessary at all to provide a guess value).
So its up to you to make a good guess, probably based on a plot like the one above.
Looking at this plot it seems that it may better to chose a guess to the right of the asymptote (greater than 0.151).
You may also parametrise the solve block, turning it into a function with the guess value as its argument.
That way you can easily test various guesses:
As you can see its hard to tell why a guess let the solve block fail. In your case higher guess values seem to be no problem.
Guess values in the range from the vertical asymptote up to 1 (and higher) seem to work all the time.
BTW, it also is dependent on the values of the system variables TOL and CTOL if the calculation fails or not.
But again, looking at the plot it seems not to be wise to use a guess value to the left of the rightmost vertical asymptote.
You may write a program which loops through a range of x values and uses "try ... on error...." to catch the errors and returns the values found.
You may also make the function get_x additionally dependent of the values lambda and alpha.cc if this is of interest.
If we disable the additional constraint we also can get the two negative solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I've plotted the left and right side of the equation you're trying to solve:
There are two points 'where the two shall meet', but you have to zoom in to find them:
Here is one of them:
It's the 'return from above', the other one is hard(er) to find.
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@LucMeekes wrote:
It's the 'return from above', the other one is hard(er) to find.
I don't think that the second solution is harder to find, but its not positive so it may not be of interest 😉
Actually there are two negative solutions - one at -0.296 and the other at -249.4.
We have two vertical asymptotes and the two solutions are at the left of the leftmost and to the right of the rightmost asymptote.
You demand your solution to be in the interval from 0 to b.p1=0.36. So why a guess of x=1. Actually even higher guess values work OK, but I would rather use b.p1/2, a value sure within the interval the solution is supposed to be.
Prime does not help in automatically choosing an appropriate guess value (if Prime could do so, it would not be necessary at all to provide a guess value).
So its up to you to make a good guess, probably based on a plot like the one above.
Looking at this plot it seems that it may better to chose a guess to the right of the asymptote (greater than 0.151).
You may also parametrise the solve block, turning it into a function with the guess value as its argument.
That way you can easily test various guesses:
As you can see its hard to tell why a guess let the solve block fail. In your case higher guess values seem to be no problem.
Guess values in the range from the vertical asymptote up to 1 (and higher) seem to work all the time.
BTW, it also is dependent on the values of the system variables TOL and CTOL if the calculation fails or not.
But again, looking at the plot it seems not to be wise to use a guess value to the left of the rightmost vertical asymptote.
You may write a program which loops through a range of x values and uses "try ... on error...." to catch the errors and returns the values found.
You may also make the function get_x additionally dependent of the values lambda and alpha.cc if this is of interest.
If we disable the additional constraint we also can get the two negative solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you! This will be good solution for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Actually there are three solutions, as symbolic solving shows:
But only the first is positive:
Success!
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
The problem is a small concrete section with one 30 dia bar under an axial force and bending moment.
It is a good start to take the effective lever arm of compressive concrete to tensile force as 90% of the effective depth of the bar.
As there is no diagram not sure what x stands for or what the section actually looks like?
Cheers
Terry
