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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

Inverse function

athurin
4-Participant

Inverse function

Hi,

I am studying a power converter, who is a combination of well know topologies, but that uses fuzzy logic for its control. The consequence of the combination of toppologies + fuzzy logic causes the input to output voltage ratio to be not trival, and defined differently depending on the operating point. Here is a sheet with a simplified expression of my input to output voltage ratio ( z(d) ) (it is more complicated than that in the application, as the transition between x(d) and y(d) is more ... fuzzy).

To simplify the problem, I can make the function continuous, derivable and bijective (athough it will probably not be the case in the final application).

Having defined the input to output voltage ratio, I want to analyse the stress on my components in certain use cases, meaning for a few (input voltage, output voltage) combination. Which means that I would like to find the inverse function of my arbitrarily-defined ratio (here, I want to find rev(z) such that rev(z) = d). And I have absolutely no idea how to do that with Mathcad.

Note that a symbolic expression of rev(z) would be nice, but would would happily settle for a numerical solving of the problem.

Anyone has a idea on how to do that ?

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Mathcad won't be able to provide a symbolic solution because it cannot decide on the different branches of min, max or an if statement with a variable, symbolic argument

For a numeric solution you may use a simple solve block. In the example you provided it works OK var values of d up to 2. z(d)=1 for d>2, so z is not bijective outside the interval you have chosen and so the inverse can't works. rev(z) would yield 1 for z=1.

In your final application one problem could be that a single, constant guess value for d (in my sheet I had chosen d=1) does not work for the whole range of z-values provided. But we'll deal with this issue when we get to it.

1.png

View solution in original post

8 REPLIES 8

Mathcad won't be able to provide a symbolic solution because it cannot decide on the different branches of min, max or an if statement with a variable, symbolic argument

For a numeric solution you may use a simple solve block. In the example you provided it works OK var values of d up to 2. z(d)=1 for d>2, so z is not bijective outside the interval you have chosen and so the inverse can't works. rev(z) would yield 1 for z=1.

In your final application one problem could be that a single, constant guess value for d (in my sheet I had chosen d=1) does not work for the whole range of z-values provided. But we'll deal with this issue when we get to it.

1.png

athurin
4-Participant
(To:Werner_E)

Thank you very much Werner. I remebered there was a way to do it, I think you helped me with another problem in the past using this type of solve bloc "outputing" a function, but I couldn't figure out how to set it up properly ! I will keep this sheet very preciously, as it is a very interesting method to solve a lot of problems.

My apologies, by the way, I should have specified that I was working for d in [0,2[ (d is actually the sum of 2 duty cycles, each one between 0 and 1). It is such an "obvious" hypothesis for me, because I am so focused on the problem, that it became kind of implicit. So you are right, it wouldn't work out of this interval.

You are also right that, in this example, the min in the x function is not necesary. In the application, I do use x with d in the whole range of d, so I just mechanically put the min whith application in mind. Once again, hypothesis that are implicit considering the application, but are absolutely not obvious when asking for help.

Next time, I will try to be more rigourous, and add these "implicit hypothesis".

Once again, thank you very much !

My apologies, by the way, I should have specified that I was working for d in [0,2[ (d is actually the sum of 2 duty cycles, each one between 0 and 1). It is such an "obvious" hypothesis for me, because I am so focused on the problem, that it became kind of implicit. So you are right, it wouldn't work out of this interval.

You are also right that, in this example, the min in the x function is not necesary. In the application, I do use x with d in the whole range of d, so I just mechanically put the min whith application in mind. Once again, hypothesis that are implicit considering the application, but are absolutely not obvious when asking for help.

No problem. If you stay with d in the range [0;2[ you would also not need the max() function either as 1/(2-d) would always be larger than 1 for d>1. But I already guessed that your original problem would be a bit more complex.

EDIT: Here is an alternative approach without the need of a guess value using the root() function:

1.png

Mine Solution:

2015-01-12_085303.jpg

When the function is an even function, Werner's method couldn't work, because root or find only return one root or can't find any root in the guess value range.

208dc31349540923a6b739ed9158d109b2de4907.jpg

I guess you haven't looked at Adrien's original function because you have not access to Prime.

Here is a pdf printout so you can try your luck using the symbolics

Keep in mind that we must use the min, max and if statements, as Adrien's original function is more complex and requires that.

Oh, sorry, Werner, the solve symbolic calculation really can't solve that function

I haven't install Mathcad Prime, so I haven't read the original article. If use the numerical root or find, my method is the same as yours, and seems more troublesome...

zhu laojianke wrote:

Oh, sorry, Werner, the solve symbolic calculation really can't solve that function

Yes - the problem are the conditionals and also max and min. The symbolics can't evaluate them (symbolically woithout any concrete values) and so it fails.

athurin
4-Participant
(To:Werner_E)

Thanks a lot for your help everyone !

Zhu, even if your solution doesn't work for this precise example, I will keep it in mind. It is something I have never done before, I am sure it will be very useful to me at some point !

Top Tags