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

Nested function in Mathcad 14

ptc-4537713
1-Newbie

Nested function in Mathcad 14

Hi everyone,

Right now, I am working with series of function for my final project but I have difficulty presenting them.

For example:

a(x,y):= x+y

b(x,y,z):=a(x,y)+z

c(x,y,z,xy):=b(x,y,z)+a(x,y)+xy^2

I want to iterate function c with its variables. How can I short above series of equations ? Some of equations are very long because series of its variable.

Help is always appreciated

3 REPLIES 3

Why do you want to shorten the equations? What is the problem with presenting them as they are if they show the structure of the problem?

You could try using the symbolic processor to simplify the equations, but that would mean 'simplify' in a symbolic sense and it may not look any simpler (in fact, often worse) than the arrangement you currently have.

If it's a matter of numerical performance, then rewriting the functions so as to calculate and store the nested functions prior to calling later functions might be beneficial, at the cost of making the writing more complex to write and test and decreasing readability and maintainability.

OTOH, if you have a very deeply nested set of equations, but with a known structure, and want to take the drudge out of writing the structure in the first place, then programming (perhaps with some symbolic aid) may be the route. If so, then some more details about the problem will help people look for solutions.

Stuart

Thank you for the response

I have many equations that thanks for its many variable name (f(x1,x2,x3,x4):= a(x1,x2,x3,x4)....) can not be write in paper. I think its also hard to understand by reader because its length. I looking for way to present it more neatly to people.

A couple of other methods, for presentation.

I use the first method extensively because my functions are in referenced files and I use over and over, and passing a matrix is by far the easiest way for me to deal with a lot of arguments.

Top Tags