second order equation implementation if controllogix
1 Attachment(s)
Hello,
I want to implement second order differential equation in controllogix using RSlogix 5000. The equation as attached. How to implement it? Thanks. 
The math operations exist, break it down into smaller components. Epsilon may have to be hardwired. Down side? Floating point in Controllogix is only 32bit.

Why would you want to solve a differential equation in a PLC?
I suggest the first thing you do is substitute for the differentials in the first equation, and then solve for y  which I assume is your output value from a control algorithm. Then you can enter the equation in ladder logic as a straight algebraic equation using the ControlLogix math functions. 
I have math formula for application that required second order equation.

1 Attachment(s)
OK  but you also show the equivalents of the derivatives. So attached is the substitution. Now solve for your dependent (output) variable using ordinary algebra and, magically, the differentials are gone.

PLCs don't "solve" equations; they use equations to calculate values.
If you substitute your bottom 2 equations into your first, you get: kČe^{kx}  3ke^{kx} + 2y = 0 or y =  (kČe^{kx}  3ke^{kx}) ) / 2 Measure x with the PLC, you can calculate y. If you're measuring y, well then god help you figure out how to solve the equation for x. [EDIT: Tom beat me to the same answer] 
Based on the equations for the first and second derivatives, you already know that y is equal to e to the power kx, so you can calculate the value of y for any value of x if k is a known constant. Is your need to find a value of k for each value of x to satisfy the differential equation?

1 Attachment(s)
Thank you for reply.
d2y(t)/dt2 = ab 2 e bt (second order differential as attached image) How to solve y(t)? 
This isn't really a PLC problem, is it?

bingo!!! It took this long to figure that out.
Quote:
On pole will be exp(t) and the other exp(2*t) There is no forcing function of input to this differential equation either. Yes, i can pretty much do simple diffEQs like this in my head. A more realistic problem would be y``+3*y`+2*y=f(t) notice that if f(t)=2 then y will be equal to 1 so the gain is 1/2. Now the two poles are negative and will decay over time and there is a forcing function that makes the system do something. 
Various transfer functions can be represented by differential equations. For example higher order (than just averaging...first order) filtering of noisy data to smooth it out with less delay than a first order solution.
My last/only experience with this was for aircraft flight control and stability augmentation systems in the late 1980's. We were just starting to use embedded microprocessors to replace the earlier analog circuits. Today's PLCs would be up to the computing task, but the redundancy requirements would be a problem. In general, you need to convert the differential equation into an approximately equivalent difference equation. You need to take the sampling time (must be greater than plc scan time) into account to prewarp the coefficients. Beware that higher order equations may exhibit oscillatory response (limit cycling) when converted to discreet time form when the the continuous time form was stable. For this reason it is better to design the system with discreet time/difference equations from the outset. 
Quote:
Quote:

1 Attachment(s)
Thank you for reply.
We want to implement the y(t) to model the anode voltage Vs alumina concentration to control anode voltage in smelting process. We plan to implement this model in PLC. can we use delta motion controller to implement this model? This is non linear with second order of differential and exponential as can seen in attached curve. 
Yes, the Delta RMC can do complex math real time.
It looks like you have solve the math and have the equations already so the RMC only needs to find the position as a function of Alumina concentration and the A/cm^2. The RMC can also use cubic interpolation between points but if the A/cm^2 value is constantly changing you have a two dimensional problem so equations would be best. What are the equations? I can enter them into RMCTools and show how long the calculations would take. That way the math part would be done. The RMC can execute the equation faster and easier than a Control Logix. The lines in the graph do not match the simple differential equation present in the first post. 
Hello Peter,
I have two different model: 1. Equation as previous post (d2y(t)/dt2) = a*(b^2)*(e^bt) where a and b is parameter that will define it as constant. 2. chart that I sent in last post. From this chart need to write or define the equation. 
All times are GMT 5. The time now is 08:56 PM. 
.