cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Translate the entire conversation x

Struggling with what seems like it should be a simple solve block

AL_13142368
2-Explorer

Struggling with what seems like it should be a simple solve block

Hello,

 

I'm working in Mathcad Prime 10

 

I am struggling to get a solve block working. I'm attempting to calculate a grid convergence index based on a published guidance document, and it requires an iterative approach which I thought could be executed by a solve block. I'm receiving various errors (see one in the image below) depending on what I try. I have attached my current workbook. Thanks for any help you can provide.

 

AL_13142368_0-1743182070225.png

 

ACCEPTED SOLUTION

Accepted Solutions

1. q() is a functon and should be defined outside solve block.

2. ln() is a function and requres (postive) arguement.

3. "Parameterize" solve block with guess value to get p.

4. Use function q(p) to get q.

 

Prime 10 file attached.

View solution in original post

6 REPLIES 6
LucMeekes
23-Emerald IV
(To:AL_13142368)

Change the all occurrences of

q(p)

to

q

and see how that helps

 

Success!
Luc

Thanks for the suggestion. I've made that change and there's still an error, but the error message is different. It used to say "Initial guess must consist of numbers and matrices" and it now says "This value must be a scalar or a matrix."

 

AL_13142368_0-1743185317138.png

 

1. q() is a functon and should be defined outside solve block.

2. ln() is a function and requres (postive) arguement.

3. "Parameterize" solve block with guess value to get p.

4. Use function q(p) to get q.

 

Prime 10 file attached.

Thank you so much! That was so helpful.

Werner_E
25-Diamond I
(To:AL_13142368)

The problem is that you have in implicit multiplication after "ln". Even if the absolute value bars in manual writing may replace the argument parenthesis you must always use parenthesis when using functions in Prime:

Werner_E_1-1743193286224.png

 

But defining q(p) as a function is probably the better solution anyway. If you do so, you could also use the "root" function in one of its two flavors:

Werner_E_2-1743193843960.png

 

LucMeekes
23-Emerald IV
(To:AL_13142368)

You could also use the symbolic solver:

LucMeekes_3-1743187721576.png

Check:

LucMeekes_2-1743187608289.png

Success!

Luc

Announcements

Top Tags