Optimizing/minimizing functions that use absolute value.

I am trying to optimize the integrated absolute error IAE and integrated time absolute error functions. These are ways of determining best gains for control transfer functions. In the IAE the absolute value of the error is added to a sum. In the ITAE the absolute value of the error at each time period is multiplied by the time and added to a sum. Normally I use the sum of squared error SSE and it works well and optimizes easily. The SSE squares the error at each time period and adds it to as sum. The SSE results in a continuos and smooth function However, the IAE and ITAE do not. It seems that the discontinuity cause by the abs function GREATY hinders the efficiency of quasi Newton methods of finding minimums. Is this my imagination or is it real?

Also, these coefficients that result in the minimum IAE or ITAE were calculated about 50 years ago. There were computers back then but I doubt they had the techniques or the processing power to compute these coefficients. They must have been calculated by hand. How does one integrate functions ,that use absolute functions, by hand?. It seems to me that one would need to do a separate integration each time the sign of the error changed. These guys must have been very dedicated. However, the coefficients that have been handed down over the years are not quite right. I can prove it for orders up to 5 but the time it takes to find the best coefficients by using optimizing functions is very long. My Mathcad doesn't seem to converge if for 6th order models and above.

Peter Nachtwey

Reply to
Peter Nachtwey
Loading thread data ...

Could you please give us a reference to the literature, showing the coefficients which were calculated?

The following comment might be useless for you, but anyway... In some computer algebra systems (such as Mathematica), if one wants to deal with an absolute value of a real function so that the absolute value may be differentiated or integrated, one should not use the built-in absolute value function (e.g., Abs in Mathematica). That's because Mathematica thinks of Abs as having a potentially complex argument and so derivatives and integrals involving Abs remain essentially unevaluated. The work-around, when one knows that the argument is always real, is to write your own absolute value function:

absreal[x_]:= Sqrt[x^2]

There is then no trouble differentiating or integrating absreal.

David

Reply to
David W. Cantrell

No such luck for me. Mathcad refuses. Can Mathematica solve problems like this?

Peter Nachtwey

Reply to
Peter Nachtwey

That depends on how simple the problem is. For example, it succeeds with both differentiation and integration of absreal itself:

In[9]:= absreal[x_] := Sqrt[x^2]

In[10]:= D[absreal[x], x]

Out[10]= x/Sqrt[x^2]

In[11]:= Integrate[absreal[x], x]

Out[11]= (x*Sqrt[x^2])/2

(By constrast, it returns D[Abs[x], x] and Integrate[Abs[x], x] unevaluated.)

It always succeeds with problems of the form D[absreal[f[x]], x] if it knows how to differentiate f itself. For problems of the form Integrate[absreal[f[x]], x], whether it succeeds depends on the function f, as you might suspect.

David

Reply to
David W. Cantrell

I finally got answers but I had to do it this way ftp://ftp.deltacompsys.com/public/NG/Mathcad%20-%20MinITAE2.pdf I still think that Mathcad is doing this using numerically instead of symbolically. However the answer agree pretty much with what I have be calculating numerically. Mathcad chokes on the symbolic solutions. If I do try to get an answer it runs or locks up forever.

Peter Nactwey

Reply to
Peter Nachtwey

Using Maple (and assuming 0 < a < 2) I get

(cos(1/2*(-a^2+4)^(1/2)*t)+1/(-a^2+4)^(1/2)*a*sin(1/2*(-a^2+4)^(1/2)*t))*exp(-1/2*a*t)

for the inverse Laplace of (1-1/(s^2+a*s+1))/s, which equals your result.

If AbsErr(a,t) denotes its absolute value, then Int(AbsErr(a,t), t=0 ... infinity) can be done by summing the integrals between the zeros and for that I achieve

(1-(exp(-a*Pi/(-a^2+4)^(1/2))+1)/(exp(-a*Pi/(-a^2+4)^(1/2))-1))* exp(-(-arctan((-a^2+4)^(1/2)/a)+Pi)/(-a^2+4)^(1/2)*a)+a

But feel a bit unsure, whether that was the partial question ...

Reply to
Axel Vogt

x=ADp(-1/2*a*t)

The symbolic answer is impressive. My Mathcad can't do that. See my reply to Santa. Does Maple use multiple cores?

Peter Nachtwey

Reply to
pnachtwey

))*ex=ADp(-1/2*a*t)

It is a brute attack through slicing at the zeros, but Maple did the rest, see

formatting link
the graphics for smaller size, 15 KB).

Multicores and/or 64 bit ... not sure, but at most patially, you may ask at the Maple NG.

The problem with that for commercial CAS seems to be: they must work stable over 'all' platforms and operating systems (may be such algorithms taking full advantage not yet exist)

Reply to
Axel Vogt

(cos(1/2*(-a^2+4)^(1/2)*t)+1/(-a^2+4)^(1/2)*a*sin(1/2*(-a^2+4)^(1/2)*t))*ex­p(-1/2*a*t)

It is a brute attack through slicing at the zeros, but Maple did the rest, see

formatting link
the graphics for smaller size, 15 KB).

Multicores and/or 64 bit ... not sure, but at most patially, you may ask at the Maple NG.

The problem with that for commercial CAS seems to be: they must work stable over 'all' platforms and operating systems (may be such algorithms taking full advantage not yet exist)

JCH:

As partial solution you can solve such tasks. But in practice it is much more complicated to tackle IAE minimum problems.

See error e (Page 1 and 2, red lines) in

formatting link
Page 1: IAE via PID parameters in use (all purely numerically solved) Page 2: With feedforward and disturbance compensation without PID *) Page 3: Definitions

*) In practice one would use PID anyway.
Reply to
JCH

Does that link make sense to anybody? I don't see anything that is right.

Peter Nachtwey

Reply to
pnachtwey

formatting link
Does that link make sense to anybody? I don't see anything that is right.

Peter Nachtwey

JCH:

formatting link
The red line in Page 1 is error (example). That error is minimized numerically by IAE (integrated absolute error).

Page 2 shows improvements.

Reply to
JCH

JCH, would you stop posting links to your non-sense. Start you own thread if you want to do that. I don't see what your link has to do with finding minimum IAE or ITAE coefficients and it is a very bad example of how the IAE should be used.

What improvements? All you have done is to make PID control look bad again which really just shows you don't know how to use the PIDs or how to tune them.

I don't see what is so difficult after one has the minimum IAE or ITAE coefficients? It is calculating coefficients accurately that is difficult. If one has the minimum IAE coefficients for each order then all that is required is to plug the plant parameters into the formulas and out pop the PID gains. See page

5 of the link below.

It would be nice if the IAE and ITAE coefficients are calculated accurately using modern software tools and computers once so everyone else can use them. Not every one has access to Maple or Mathematica and multicore 64 bit computers. One of my complaints is that ITAE coefficients appear to be wrong and that people keep using them without question. I haven't looked into the IAE coefficients yet.

BTW, I prefer critically damped systems. They are simple to calculate because there is a binomial pattern to the coefficients. If I make A1 and A2 eqaul to 3 then I would have a critically damped response with no ringing.

Those gains don't look right to me. See the formulas on the bottom of page

  1. One can dispute the accuracy of my minimum IAE coefficients but they must be close. The ratio of your Ki of 1500 to a Kc ( Kp? ) of 1 is wrong. You don't show the coefficients you use or the minimum IAE that resulted. In any case your closed loop response looks a lot worse than mine and I bet my closed loop IAE is much lower than your feed forward IAE..

The graphs are STILL mislabeled. The main graph should be velocity and the two graphs below it should be acceleration and jerk. I don't know why you insist that position is proportional to the controller output instead of the velocity. When the power goes off the velocity goes to 0 and the position coasts to a stop and stays where it is at. When the power goes off, the position doesn't go to 0 as in your example.

Notice also that at time 0.25 the 'position' moves +0.1 instantly due to a disturbance. This requires an infinite amount of power. The disturbance act on the plant or actuator the same way the controller does. You need to add another term to your forcing function. Notice that I added a disturbance to my similar. I admit it is rather arbitrary because you provide no information on the distrubance. I just designed mine so the actual velocity is displaced by a litle more than 0.1 so it is similar to your disturbance. The difference is that my disturbance doesn't change the velocity instantly like your does. The response of the system is taken into account instead of just changing the position like you did. Notice that my PID recovers MUCH faster than yours.

How is it that the disturbances don't affect the feed forward control? This is not realistic at all. Also, the open loop system is already critically damped. So what is the point? The controller just outputs a open loop value proportional to the desired velocity. So what? The one reason to have a controller is that it can achieve a faster response than the open loop response.

What is the IAE for your feed forwards graph? You don't show any of your calculations so we can compae your feed forward response with a closed loop response. Your response is limited by the open loop response of the system. The feed forward graphs shows how the open loop control out is limited to

0.9. I can keep increasing omega, see page 5, to make the response as aggressive as is practical. My control output can drive the plant or actuator harder and reduce the my closed loop IAE below your feed forward IAE. This can give the closed loop control a big advantage when making small changes.

Yes feed forwards are cool. They seem to be your one trick.

To see how the coefficients are properly used see ftp://ftp.deltacompsys.com/public/NG/Mathcad%20-%20IAE3.pdf Omega is necessary to make the response faster and the corner frequency or bandwidth will roughly match omega. See tge Bode plot at the bottom. The equations on page 5 can be used to calculate the PID gains for ITAE, IAE or critically damped response. All one needs is the new set of coefficients. Hopefully someone will find the .pdf example useful. JCH should study my .pdf but I bet he will continue to deny and defy reality as he has done for the last 9 months..

Peter Nachtwey

Reply to
Peter Nachtwey

"Peter Nachtwey" schrieb im Newsbeitrag news:KcKdnbtU2IjI3ujanZ2dnUVZ snipped-for-privacy@comcast.com...

Read again what I have already written before:

I showed IAE (integrated absolute error) on an useful example!

formatting link
Tackling real practice problems isn't nonsense. If you don't like it skip it.

Reply to
JCH

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.