Skip to main content
1-Visitor
November 2, 2021
Solved

Solving function with dependent functions

  • November 2, 2021
  • 2 replies
  • 3159 views

Hi!

So probably a pretty stupid and basic question.

The function. All functions are linear btw.

f0(x) := C(x)*f1(x)+f2(x)

And i want to solve for x when f0 = 5 (just a random number)

 

Hope it makes sense. Thanks in advance

Best answer by Werner_E

It would sure help if you post a picture and the worksheet itself to show the definition of the functions involved. Also we could then help by simply adding the necessary steps to your sheet rather than creating a new one from scratch. And last but not least we could see if aou are using real Mathcad (Version 15 and below) or Prime. In case of Prime you should also state which version you are using. In case of Prime a screenshot of the sheet or a pdf if the sheet is larger can be helpful, as some participants here can't read sheets from all versions (e.g. I can only read sheets up to Prime 6).

 

I guess that f2 and f2 are kown (and defined) functions. What about C? Guess its well known, too?

So you have at least three options to get the value of x.

a) Use the symbolic "solve" command

b) Use a numeric solve block

c) Use the numeric "root" command in one of its two flavours.

 

Keep in mind that if both f1(x) and C(x) are linear function, f0(x) will be a quadratic function and you'll have to expect two solutions for x.

Werner_E_1-1635851889660.png

The two numeric methods mentioned above will only return one of those solutions, depending on the range or the guess value you have to provide or depending on other constraints (if you are heading for the solve block).

 

 

2 replies

Werner_E25-Diamond IAnswer
25-Diamond I
November 2, 2021

It would sure help if you post a picture and the worksheet itself to show the definition of the functions involved. Also we could then help by simply adding the necessary steps to your sheet rather than creating a new one from scratch. And last but not least we could see if aou are using real Mathcad (Version 15 and below) or Prime. In case of Prime you should also state which version you are using. In case of Prime a screenshot of the sheet or a pdf if the sheet is larger can be helpful, as some participants here can't read sheets from all versions (e.g. I can only read sheets up to Prime 6).

 

I guess that f2 and f2 are kown (and defined) functions. What about C? Guess its well known, too?

So you have at least three options to get the value of x.

a) Use the symbolic "solve" command

b) Use a numeric solve block

c) Use the numeric "root" command in one of its two flavours.

 

Keep in mind that if both f1(x) and C(x) are linear function, f0(x) will be a quadratic function and you'll have to expect two solutions for x.

Werner_E_1-1635851889660.png

The two numeric methods mentioned above will only return one of those solutions, depending on the range or the guess value you have to provide or depending on other constraints (if you are heading for the solve block).

 

 

1-Visitor
November 2, 2021

Thank you Brother!

24-Ruby III
November 2, 2021

Here's another way to solve this problem:

 

Pic-1.png

25-Diamond I
November 2, 2021

Symbolic evaluation of solve blocks only work in real Mathcad. This feature was broken in Prime and chances are that the OP is using Prime 7 (given from another thread he opened a while ago). BTW, if you use symbolic eval, no guess value for x is necessary.

But of course the solve block can be evaluated numerically in all versions and if you add a constraint like x>0 or x<0, you have control over the solution calculated.

24-Ruby III
November 2, 2021

Out of habit, I set the initial condition, since I usually use a numerical solution. Symbolic result - to show the same answer as yours.