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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Find out the max and min level of a time domain piecewise signal

yhuang-3
1-Newbie

Find out the max and min level of a time domain piecewise signal

Hi All, I have a time domain signal, which is formed by a triangle discharge current to the series connection between a resistor and a cap. Would anyone told me how to find out the max and min value of this time domain piecewise signal? A simplified worksheet is attached. Thank you!timedomain piecewise.png

1 ACCEPTED SOLUTION

Accepted Solutions

How about  a brute force attack?

You may also use a function to do the same (no error checking implemented)

Werner

View solution in original post

5 REPLIES 5

Hi.

This is for first interval, for the second is the same: find critical points, which are the set of points where diff = 0, bounds of the interval, and discontinuities.

Best regards.

Alvaro.

cp.gif

Hi Alvaro, thank you so much for your advice!

(1) Do you think we can use a compact method to achieve the same goal? For example, in this case, from your code, we need to judge by ourselves that we should discard t10 because it is less than 0. Can we let the code judge the min and max, by using "if" sentence?

(2) In the example I provided above, in both time intervals, V(t) changes monotonically. So it is relatively easier to determine the max and min. However, if the function gets more complicated, it seems like we can only use dv(t) to find a critical point, either min or max, but needs extra effort in judging the other boundary. In the following example, between 0 to t1, we can use dv(t)=0 to find the max point "B". However, since v(t) is not monotonical between 0 to t1, we need extra code to judge if A or C can give us the minimum V(t). How can I implement this?

min and max.png

Thank you!

Hi Yhuang.

(1) Do you think we can use a compact method to achieve the same goal? For example, in this case, from your code, we need to judge by ourselves that we should discard t10 because it is less than 0. Can we let the code judge the min and max, by using "if" sentence?

You can, but question is if it is a good thing. In plane curve theory the triangle waveform is called "piecewise continuous", not for discontinuities in the function, which are called "solvables", but for the discontinuities in the first derivative. The treatment by hand is by the "pieces". You can apply the method for the two pieces if you use Phi function, which can be derived and integrated. But with the inconvenient that for the derivative, Delta isn't a function, is a "distribution" (Dirac delta function - Wikipedia, the free encyclopedia) with no hope to have an exact numeric representation.

In this case you have only one root, but you can have any number of roots. So, an if statment could be more complicated.

(2) In the example I provided above, in both time intervals, V(t) changes monotonically. So it is relatively easier to determine the max and min. However, if the function gets more complicated, it seems like we can only use dv(t) to find a critical point, either min or max, but needs extra effort in judging the other boundary. In the following example, between 0 to t1, we can use dv(t)=0 to find the max point "B". However, since v(t) is not monotonical between 0 to t1, we need extra code to judge if A or C can give us the minimum V(t). How can I implement this?

If C is a point where the function is continuous, but the derivative not, must to be include as "critical point".

If you collect the critical points and evaluate with vectorize, with max or min you can found the max or min of vector, but for where the max or min occur, can use match. Again, I guess that it is preferable the "inspection" method.

You can check here a lot of examples, or in the help for minimize:

Symbolic in two variables: Re: onlinear programming with constraints

Particular numeric method: https://www.ptcusercommunity.com/servlet/JiveServlet/download/2053-29969-135434-15924/minimize_parabolic_golden.mcd

Numeric for a family: Minimizing for a family of functions

Best regards.

Alvaro.

How about  a brute force attack?

You may also use a function to do the same (no error checking implemented)

Werner

-MFra-
21-Topaz II
(To:yhuang-3)

To be corrected!

effect of a current pulse in an RC circuit.jpg

Top Tags