Solving Diffrential equations which include PID Controller
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello, I have four diffrential equations which depends on each other and one of the diffrential equation contain a PID controller. I want to solve these diffrential equations by incorporating that PID controller but don't know how to incorporate PID controller while solving these equations.
Here is the picture of those equation
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/236782/image.png)
0 comentarios
Respuestas (1)
Alex Gros-Balthazard
el 3 de Sept. de 2019
Hello,
That looks like a system of linear differential equations that I believe matlab can find a close form symbolic solution for.
Make each derivative one of your state variables. Then express the derivative of each state variable as linear combination of the other state variables. Suppose you had 3 state variables: you should be able to write this in state variable form:
dx1/dt = c11*x1 + c12*x2 + c13*x3 + f1(t)
dx2/dt = c21*x1 + c22*x2 + c23*x3 + f2(t)
dx3/dt = c31*x1 + c32*x2 + c33*x3 + f3(t)
See matlab manual pages in symbolic toolbox on using dsolve to solve a system of linear differential equations and also on putting differential equations into matrix form. You CAN and should solve this by hand as well.
Your Proportional integral derivative controller function looks like it contains state variables. The forcing functions, f1 f2 and f3 cannot include any dependency on state variables.
I think matlab will handle and sort all that for you, if you just substitute your definition of Vpid into the other equations where it belongs. So you have four state variables, Ef, Vf, Vr and Va.
The derivative of each of those can be expressed as a linear combination of those state variables plus some forcing function. I believe you can actually just write those differential equations symbolically, substitute in your definition of Vpid where ever it belongs, because it contains state variables, part of which make up the coefficient matrix and part of which goes into the forcing functions. So you substitute Vpid, symbolically, and I think matlab will do rest automatically, without you having to even write them in the above format. Matlab will just do it internally. You can and should check what it does. Use equations to matrix format function to check what matlab is doing.
Check matlab functions:
dsolve
equationsToMatrix
Matlab will also solve that for you numerically, although it's simple enough that I believe matlab will find closed form symbolic solutions.
Best Regards
Alex GB
2 comentarios
Rik
el 13 de Sept. de 2019
Comment posted as flag by Muhammad Mudassar:
Still I couldn't able to incorporate PID controller which is in Laplace domain
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!