Approximating Differential Equation on the Basis of Measured Values



I'm back. OK JCH, one more chance. This should be simple. The control output is 1 and there are only 26 points just how you like it. The data is in CSV, comma separated variable, file format.
Time, Position, Control Output
0,0,1 0.1,0.0280961296169728,1 0.2,0.105480069053459,1 0.3,0.22321745414104,1 0.4,0.373993446175833,1 0.5,0.551819161757164,1 0.6,0.751791317868303,1 0.7,0.96989544591241,1 0.8,1.20284477699198,1 0.9,1.44794833233238,1 1,1.70300292485492,1 1.1,1.9662047375435,1 1.2,2.23607692993412,1 1.3,2.5114103673215,1 1.4,2.79121509393783,1 1.5,3.0746806025518,1 1.6,3.36114330596755,1 1.7,3.65005990494049,1 1.8,3.94098558367094,1 1.9,4.23355615778425,1 2,4.5274734583331,1 2.1,4.82249336523072,1 2.2,5.1184160098546,1 2.3,5.41507775361695,1 2.4,5.71234462057353,1 2.5,6.01010692049863,1
Have fun.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

See Page 1/2 http://home.arcor.de/janch/janch/_news/20071116-pd2iptf /
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

It isn't right. Not even close. Did you plot the estimated PV against the actual PV? Then it would be obvious.
I will post the solution after the week end if you don't find the solution before then.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

I did it again without normalization. Basically the same solution:
Time span is now real 0 to 100: http://home.arcor.de/janch/janch/_news/20071117-pd2iptf /
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

It is still wrong. Actually, I can't follow what you are doing. I don't know why you show disturbances because there are none. I don't know why you have PID gains when the model is wrong. My data is an open loop response to a step control output of 1. There is no noise, no dead time, no offset and only one time constant (hint). It is that simple. You didn't plot your estimated response and the given response to compare them.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

If no disturbance then there is nothing to control. I show a close loop control.
That is just PI-controlled with only 1 disturbance (z2): http://home.arcor.de/janch/janch/_news/20071117-pd2iptf /
This is feedforward PID-controlled with 2 disturbances (z1, z2): http://home.arcor.de/janch/janch/_news/20071117-d2pidz1z2 /
The estimated plot of process transfer function is black colored. The response is red colored but is covered by the black line.
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Your model, 0,1796511 y ' ' + 0,3153461 y ' + 0,01438058 y = 1, is still wrong. It is not even close. At steady state y' and y'' will be 0 there for y = 1/0,01438058 so y = 69.5. What is y? Is it a position or a velocity? If y is a position I can tell you it is wrong because as long as the control signal of 1 volt is applied the positoin will keep changing at not stop at 69.5. There is no steady state value for positon. If y is a velocity then you are indicating that the steady state velocity is 69.5 position units/second. This is clearly not right because you an the the velocity approaches steady state value of 3 poisition units per second from my data. Look at the last two data points.
2.4,5.71234462057353,1 2.5,6.01010692049863,1
The difference in time between the two points is 0.1 seconds and the difference between the two points is 6.01010692049863-5.71234462057353 is about 0.298 so the velocity is 2.98 positoin units per second.
I have now given away what the answer is. Truthfully, I could get a good estimate of what the transfer function is by just looking at a graph of the data this model is that simple.
You still haven't graphed the estimated position versus the actual position data given to see if your model matches the actual position data. If the model isn't right then the tuning values aren't right. Concentrate on the system model.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Your model, 0,1796511 y ' ' + 0,3153461 y ' + 0,01438058 y = 1, is still wrong. It is not even close. At steady state y' and y'' will be 0 there for y = 1/0,01438058 so y = 69.5. What is y? Is it a position or a velocity? If y is a position I can tell you it is wrong because as long as the control signal of 1 volt is applied the positoin will keep changing at not stop at 69.5. There is no steady state value for positon. If y is a velocity then you are indicating that the steady state velocity is 69.5 position units/second. This is clearly not right because you an the the velocity approaches steady state value of 3 poisition units per second from my data. Look at the last two data points.
2.4,5.71234462057353,1 2.5,6.01010692049863,1
The difference in time between the two points is 0.1 seconds and the difference between the two points is 6.01010692049863-5.71234462057353 is about 0.298 so the velocity is 2.98 positoin units per second.
I have now given away what the answer is. Truthfully, I could get a good estimate of what the transfer function is by just looking at a graph of the data this model is that simple.
You still haven't graphed the estimated position versus the actual position data given to see if your model matches the actual position data. If the model isn't right then the tuning values aren't right. Concentrate on the system model.

See the 2.2*10^-4 % Model: New http://home.arcor.de/janch/janch/_news/20071117-d2pidz1z2_a /
Compare with the 1.4 % Model: Old http://home.arcor.de/janch/janch/_news/20071117-d2pidz1z2 /
Can you see any difference in control performance?
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

New 0,1666572 y ' ' + 0,3333362 y ' + 2,174717E-06 y = 1
this is still wrong.

Why do you worry about controlling the wrong model? The controller and the model are wrong. Stick to the problem. Find the system gain and time constant. Let common sense guide the math and not the other way around.
Another hint. Differentiate my data. Then you will have velocity as a function of time. I am pretty sure you can find the solution then.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

New 0,1666572 y ' ' + 0,3333362 y ' + 2,174717E-06 y = 1
this is still wrong.

JCH
I regard a steady state error of ~2*10^-4 % as more than accurate for technical applications.
SHOW YOUR ANSWER!

Peter
Another hint. Differentiate my data. Then you will have velocity as a function of time. I am pretty sure you can find the solution then.

JCH
I see the differentiation whenever I look at my program.
See velocity: Page 2 http://home.arcor.de/janch/janch/_news/20071117-d2pidz1z2_b /
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Error between what and what? What is steady state? I have asked before, what is y? Is it a position or a velocity. In either case your equation is wrong. From you formula
0,1666572 y ' ' + 0,3333362 y ' + 2,174717E-06 y = 1
the steady state value of y, what ever that is, is 1/2,174717E-06 which is a very big number. It is way too big for a steady state velocity and there is no steady state position. I don't see how you expect that to match the given data. I bet you still haven't graphed your model and compared it with the given data. Do you want me to do it for you?
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

ftp://ftp.deltacompsys.com/public/NG/Mathcad%20-%20Type%201%20First%20Order%20System.pdf
One can see from the graph that the velocity increases and is reaching a steady 3 position units per second. Therefore one can see the gain is about 3 positions per second per control output unit. If one plots the velocity as a function of time one can see this is a first order system because there is no inflection point. in the response. One can also see that it takes about 2.5 seconds to get within 1% of 3 position units per second so the time constant must be around 0.5 seconds. Before I could do all the math I relied heavily on just analysing the graphical data.
One can see there is a big limitation to being limited to analysing only 25-30 points. One can see that the response to a step change takes about 5 time constants so that leaves only 5 to 6 samples per time constant. That isn't a high enough sample rate.
There are still some issues not addressed. This data is perfect. What if it one added some noise and quantized the data to reflect converting the feedback in to a digital format. What happens if there is a offset? In open loop system will often drift even when the output is about 0. This means one must add another term so the differential equation becomes
vel'=-alpha*vel+Gain*alpha*u(t)+offset
One can not identify a system like this when u(t) is just a step of 1. u(t) needs to change between different levels so the system identification can tell the difference between the output due to u(t) and the offset. No system identification can be done on a real system with a offset if the system is only excited with one step change.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

ftp://ftp.deltacompsys.com/public/NG/Mathcad%20-%20Type%201%20First%20Order%20System.pdf
Your data
K = 3 alpha = 2
K*alpha 1 ----------- = ------------------------ s*(s+alpha) 0.16666s^2+0.33333s + 0)
I approximated in Page 2 http://home.arcor.de/janch/janch/_news/20071117-d2pidz1z2_b / ^^^^^^^^ 0.1666572 y'' + 0.3333362 y' + 2.174717E-06 y = 1 0.1666572 y'' + 0.3333362 y' + 0 y = 1
For 2.174717E-06 ~ 0
The velocity is the green line (y') on the same page.
Any problems left?
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Newsbeitrag

That looks good. The other answers don't.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Velocity must be ok because y' is part of 0.1666572 y'' + 0.3333362 y' + 0 y = 1
http://home.arcor.de/janch/janch/_news/20071117-d2pidz1z2_b /
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Newsbeitrag

Yes, the velocity is OK. However, your web site is still wrong. The steady state position for the equation on your web site is 1/2,174717E-06 or 459830 which is not right. You must integrate velocity to get position so you can control position. The PID gains must be calculated for position feedback. The PID gains for velocity control and the PID gains for position control are different even if the gain and time constant are the same. For starters a first order velocity control system doesn't need a derivative gain.
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

1 T(s) = ----------------------------- 0.1666572s^2 + 0.3333362s + 0
The level goes theoretically to infinity as any 'level' process transfer function does if e.g. more water [m^3/h] is pumped in then goes out of a tank.
In simulations you can ignore an error of 2.174717E-06
--
Regards/Gre http://home.arcor.de/janch/janch/menue.htm
Jan C. Hoffmann eMail aktuell: snipped-for-privacy@nospam.arcornews.de
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

That is your hint that you need to use two differential equations like I showed in my pdf file. In this case the control output determines the steady state velocity. Then the velocity must be integrated to get position.

No, you just must use two differential equations. Not one.
See this ftp://ftp.deltacompsys.com/public/NG/Mathcad%20-%20Ode%20Opt%20First%20Order%20no%20offset.pdf
Peter Nachtwey
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

The answer is, approximately:
H(s) = 8.94 ---------------------------- s^2 + 4.904 s + 8.94
That was fun.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I am not sure if I understand what is being asked here. Are we trying to find the equation which produced that set of data? Or are we trying to find a differential equation for which that set of data is the solution?
I'll assume that we are looking for the equation which defines this set of data:
In the s domain, this set of data can be approximated by the following:
H(s) = 8.94 ------------------------- s^2 + 4.91 + 8.94
In the time domain, this is equivalent to:
H(t) = 1 - 1.75*e^(2.45t)*cos(1.71t-55)
Is this what is being asked for here?
Andy
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.