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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to call values from a table and then do the minerr() calculation?

ptc-5146913
1-Newbie

How to call values from a table and then do the minerr() calculation?

Hi all:

 

I am a MathCad new user and wanna ask questions about achieving the concept.

 

The concept is (pls see the attached .xls file):

 

Step 1: I will import the data from .xls to MathCad.==>I know how to do it.

X-parameter (1E15,2E15,...,9E15) is a function of Y-parameter (0.3,0.35,...,3).

 

Step 2: 5 guess values will be defined and then the corresponding value will be selected.==>Don't know how to do it yet.

For example, if 1E15 is chosen, 1,2,...15 from Y (0.3,0.35,...,3) will be chosen.

Then all these values will be calculated through an equation to obtain "t" as a function of Y-parameter (0.3,0.35,...,3).

 

Step3: Then minerr() will be used to compare the error between caucluated "t" and measured "t" (green column) to find out the best approach.

 

The problem to me is how to call values from the excel table in each loop and then use minerr() to find the best 5 X-parameter by comparing with measured "t".

 

Does anyone try the similar concept and willing to share your idea?


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
9 REPLIES 9

I am not sure I fully understand the application but the first thing that comes to mind is using relations with an IF statement. This might get extensive but it does give you the options you are asking for.

I am working on a similar problem. To keep the model, and therefore the number of relations, simple, I determined that I need to do the analysis in the assembly with flexible models. That way, the same model can be used for multiple solutions, simplifying the overhead. At this point, I am having trouble with the syntax of where and how to assign parameters and relations. This will significantly effect where I do the queries for each object.

I didn't think of using the IF statement.

My thinking is that minerr() should does the work of finding the right combination (5 variables) with minimum error automatically.

Therefore the question to me is to figure out the way to call variables (5 variables as a set) into the minerr() in each loop and also the rule to choose the next variable set.

Maybe that's where you mean to use the IF statement (the rule to choose the next variable set).

I hope there is a simple way to do it..

Yes, the IF statement can differentiate you 5 valid consition and contain the instructions for each condition. Nested IF statements will let you capture the hi-lo bounds. Also remember you have the ELSE statement to set default conditions in case of input errors.

M.....

This thinking is different from my original thought.

I expect minerr() has its bulit-in algorithm to automatically choose the next variable set in each loop.

Therefore, the concept of the code design is to call variables from the table into the minerr() and then let minerr() does it work.

But you are talking about the variable choosing in each loop using IF statement.

Do you mean that there is no way to do my concept using minerr()?

I am probably not understanding completely what you need to accomplish. I do not see a Creo Parametric function of minerr(). Where is this function used or available?

This is a built-in Mathcad function. Minerr(var1, var2, ...) - returns the values of var1, var2, ..., coming closest to satisfying a system of equations and constraints in a Solve Block. Returns a scalar if only one argument, otherwise returns a vector of answers. If Minerr cannot converge, it returns the results of the last iteration.

Pic_1.PNG

Hi Chih-Yu,

Please post your question in Mathcad community, here:

http://communities.ptc.com/community/post!input.jspa?containerType=14&container=2003

Thanks!!

I have posted questions to the link you mentioned and in here I ask the same question.

My question is more than just using the minerr().

I have two questions:

1) As I read the minerr() instruction, var1, var2, .. should be either integer or complex number.

Can var1, var2 be vectors?

2) Is there any way to call var1, var2 from a separated table and then put them into minerr()?

So this question has nothing to do with Creo Parametric? I noticed already that the minerr() function is a Mathcad function. If you look at Creo parametric, we have a very limited set of functions. In most cases, we define our own functions through extensive coding with a weak set of tools.

I suspect that Creo users can offer little advice for Mathcad specific problems. We geometry guys just don't think the same way

Top Tags