APMonitor is a community for the fourth industrial revolution (Industry 4.0). Content is for those interested in data science, programming, optimization, automation, and machine learning. APMonitor and Gekko software are for solving large-scale and complex problems with advanced simulation and optimization.
Пікірлер
how should I modifies the code if I wanted to to schedule multiple task to the same type of machine that runs parallelly ? great video btw thankyou ! 😄🤝
5:45 this is a great explanation of the PI control. I was wondering what happens with the controller output when you need an output to keep the process at the setpoint, but the answer is that the integral terms is nonzero even if the error is 0. So the I-component keeps the process at the setpoint even when the error is zero. I sort of knew the I-component, but not how it works in detail. Thank you.
That's a good summary and you are correct that the integral acts as a new constant controller output when the process reaches the new steady state. In practice, the PID equation is used in velocity form. See types A-C here: apmonitor.com/pdc/index.php/Main/ProportionalIntegralDerivative
I will try and update
It was not worked when tried to import It have not showed any xlsx file only mat files shown
Can you please provide a research paper based on your code or dataset. I have to write a research paper based on your code or dataset, and I'm worried about finding a research paper that suits to your dataset :(
This dataset isn't published elsewhere. You can just cite this website: apmonitor.com/pds/index.php/Main/SoilClassification
Hey, I am building a game with a friend where you can fly an aircraft and other aircraft are controlled by AI center controllers. We really want to spend some time learning and trying different optimization algorithms to find their optimal routes (to ensure safety and minimize fuel). The game also has weather which we want to take into account. Now comes my question: does anyone know which algorithms would fit the problem? It would be cool to have some simple ones but you can also suggest more time-intensive algorithms that we can try out! Thanks a lot :)
Optimization algorithms for aircraft routing are essential for ensuring efficient flight operations, minimizing costs, and maximizing safety. Mixed Integer Linear Programming is a popular method for scheduling optimization. Nonlinear Programming is used for trajectory optimization. Here is a recent review paper: academic.oup.com/iti/article/doi/10.1093/iti/liad026/7459776
@@apmthanks for the answer? Do you think more complex approaches like Reinforcement Learning or Model Predictive Control could work? I'm not sure what to do when they don't give a solution.. e.g. you could plan ahead using RL but if there would be a crash in the future what would I do?
@@apmAnd is nonlinear optimization fast enough if I have many agents?
@@zemanntill MPC uses linear or nonlinear programming to calculate the new trajectory. The speed depends on the number of equations and degree of nonlinearity. RL can be useful if you have a simulated environment where it can learn from the trials. RL is typically slow, but iteratively improves.
I know it’s a stupid question but aren’t websockets requiring internet to work?
@@alaaosama7679 websockets communicate over TCP/IP. WebSockets in Python do not inherently require the Internet to work. WebSockets are designed to establish a full-duplex communication channel over a single TCP connection, which can be used on local networks as well as over the Internet. Whether they need the Internet depends on the specific application and the endpoints involved in the communication. If both the WebSocket client and server are on the same local network or even the same machine, the Internet is not required.
Well done.
Amazing!!!
Thank you!
Great session! Thanks professor!
Thank you for this video. I wanted to ask you a question: in the case where we have data containing a control input u, a disturbance d, and an output y, how can we perform the identification with Gekko?
You can have 2 inputs to the system with [u,d] and one output [y].
If your system is composed of the two rivers and the pump, then there will be no potential energy change for that system. I guess your system as per your calculation is from pipe inlet to pipe outlet including the pump ? The potential energy will be based on system inlet to system outlet, which is 40 ft.
This is the way to teach. The jupyterlab is prepared so there is no time wasted writing on a chalkboard. Also, there are files to play with. This is much better than the MIT lectures where the professor talks with his back to the students while copying his notes to a blackboard where the students must take notes but there is no working solution.
thanks so much for the video, it is a great tutorial.Could I ask you if is it possible make a multivariate system identification with LSTM and Would you have an example?
Sure, see Exercise 2: apmonitor.com/do/index.php/Main/LSTMNetwork
This works fine. But each client has its own socket with the server. Is there a way to make it like all clients see the changes other client does on server? For example having them connected to the same socket, or server sends info via each socket once DB changes?
MQTT has a broker that serves as a database: apmonitor.com/dde/index.php/Main/MQTTProtocol MQTT is often used for devices that are intermittently connected and where fault tolerance is needed. OPC UA has server where values are stored: apmonitor.com/dde/index.php/Main/OPCTransfer OPC is used in industrial automation. Modbus has a server / client function: apmonitor.com/dde/index.php/Main/ModbusTransfer It is an older standard that is fast and reliable.
Thanks, this is exactly what I was looking for
Can you share the link to the Linear Programming video you suggest watching before this video? I'm having trouble finding it.
you can show Ethernet IP protocol ? . Thank
Hi thank you very much for the video. How would I proceed with critically damped systems?
Here is more information on underdamped, critically damped, and overdamped second order systems: apmonitor.com/pdc/index.php/Main/SecondOrderSystems
is there a reason you nested the uri within the function rather than an outside variable that's easier to visually identify? (say when needing to change when going from dev to production)
is there a reason you nest the uri within a function rather than being declared outside as a variable that can easier be visually identified when needing to be changed? (say going from dev to production)
Great idea - it just adds an additional input parameter to the function, but makes the code more modular and reusable for other applications.
Thank you so much for sharing this interesting project. Just had a question that if we use 'ReLU' activation function for the first layer in our Neural Network, then the ouput of each node from the first layer would be non-negative. Would adding constraints for the parameters of the first layer in this case also help to improve the performance of the model?
That's an interesting observation and likely another way to enforce a positive output constraint. Many of the machine learning packages also allow constraints to be specified now: www.tensorflow.org/api_docs/python/tf/keras/constraints
Amazing video, I am writing my own program to showcase control on a double pendulum and this is a fantastic resource!
😀
Lol, pipe dream
Wonderful content John! I'm glad you posted this.
First of all thanks so much for the videos and the web page explantions. I have seen some applications of LSTM to system identification, could you make a video explain that please
Hi! Thanks for the video. Your content on MPC has been my guidance to understand this kind of control. I was wondering, this is an example for an open-loop MPC, right? Do you have any example for close-loop? I mean, changing the size of the horizon, applying the first step of control on a simulation of the system, and recompute the trajectory for the next step til the final of the simulation. Thanks!
Sure, here is a complete series of tutorials with an Arduino device for real-time MPC. apmonitor.com/do/index.php/Main/AdvancedTemperatureControl Lab F is linear MPC, the easiest to implement.
John’s daughter also broke the American record in the high school 3 mile last fall! He is a great coach!
Sir we are working on a vapor compression cycle related project and want to find the cooling capacity of the system. We can only measure the temperatures and pressure of the refrigerant (by means of sensors and gauges) for the change in enthalpy. The problem is that we can't measure the mass flow rate as the sensors are really expensive and we are out of budget. Is there a way to find the cooling capacity without the mass flow rate or a way to measure the mass flow rate with only presssure temperature and enthalpy??? Please help this is involves our senior year project in mechanical engineering
You could estimate mass flow from the accumulation rate of the coolant. If you can put the condenser on a weight scale, it would give you a weight versus time that would translate into flow. It may not be practical if the condenser accumulator is built into an existing structure.
@apm oh thanks alot sir
is it possible for device like teltonika FMB920 to send data to MQTT bROCKER
The Teltonika FMB920 can transmit data using LTE or via a local gateway using a Raspberry Pi. For LTE, ensure the micro-SIM is active and configure the device with network and MQTT settings to send data directly to an MQTT broker over the internet. Alternatively, use a Raspberry Pi as a local gateway by enabling Bluetooth on both devices for local data transfer, and configure the Raspberry Pi to send this data to an MQTT broker using installed MQTT client software. This setup not only allows flexibility based on connectivity and mobility needs but also the possibility of integrating additional processing capabilities through the Raspberry Pi.
Where is soil.h5? I can only find train and test
It is created when you train the model.
@@apm OK, got it, Thanku
Thank you. Please which software are you using and can this be applied to a pipeline transporting dredged sediments in a port.
The software is Python Gekko. Source code is available at apmonitor.com/me575/index.php/Main/LimestoneSlurry
@@apm thank you 🙏
From where is this exercise? (Felder Book?) Which number of exercise? Thank you
Elementary Principles of Chemical Processes 3rd Edition by Richard M. Felder and Ronald W. Rousseau - unfortunately, I don't remember the problem number.
From which book are the problems
Elementary Principles of Chemical Processes 3rd Edition by Richard M. Felder and Ronald W. Rousseau
8 years later & still awesome!
Nice video! Thanks! May be you can make video about OPC UA TSN? And IEC/IEEE 60802 TSN?
Time-Sensitive Networking (TSN) is important in many applications. I typically use MODBUS when speed is important. It is an older standard, but specializes in high-speed numerical data.
It seems to not work as good when you have a function with a singularity, do you have any idea on how to handle that? y = a * ((sin(bx)/(bx))^2 Edit: It worked rather okay, when I slightly shifted the function and added a restriction a > 10 y = a * ((sin(bx)/(bx+0.000001))^2
Great observation. Setting a bound or rearranging the equation to avoid divide-by-zero is often effective.
Is it possible to use the R squared value as an objective, i.e. minimize R^2-1?
The EV_TYPE=2 option is a squared error objective. See the code at apmonitor.com/do/index.php/Main/EstimatorObjective It is also possible to specify a custom objective instead of using the build-in types using `m.Minimize()` function. Additional examples are shown at apmonitor.com/do/index.php/Main/DynamicEstimation
Good day I hope you will be fine with good health this is my question how can i solve this Quadratic constraints programming example max OF = -3x1^2-10x1+x2^2-3x2........(1) x1+x2^2>=2.5.....................(2) 2x1+x2=1..........................(3) in GEKKO i am waiting for you response thank you
How can we handle the case with two controls say u_1 and u_2, two state space and do we still define the bounds of the control in the same way?
Here is an example with MIMO control. apmonitor.com/do/index.php/Main/TCLabF and a simple example: apmonitor.com/wiki/index.php/Apps/LinearStateSpace (see Gekko example at the end).
@@apm ok. Thanks a lot
thanks for such comprehensive sharing!! I have one question, are there any suggested solutions that allow me to deploy my websocket server to let external devices access it through link like wss:// ?
Yes, no problem on deploying it as a web service. Just open the firewall on port 443 to not block the connection.
Stop looking everyone. You're not going to find a better video on Laplace transforms using Python.
this is EXACTLY what i'm doing as a graduation project ,Great Work
Thank you for the video! I appreciate it!
Thanks for the documentation Sir. Can if3 be used to write a relu activation function in GEKKO?? Also, what is the best way to random initialize weights and biases in case I am building a neural network without using brain function nor any other imbedded function but just from scratch by defining weight and biases as arrays of FV. I have tried to Set FSTATUS and STATUS to 1 and .MEAS = np.random.randn(). But I am not sure if this is applicable in my case??? Please can you Clarify this point??
The easiest way to create a Neural Network model is to use scikit-learn or TensorFlow for fitting and then import the model into Gekko as shown here: gekko.readthedocs.io/en/latest/ml.html Gekko uses max2 functions for ReLU because they are more efficient to solve than the max3 or if3 functions with binary variables. Search for "relu" in the gekko ML.py file for more details: github.com/BYU-PRISM/GEKKO/blob/master/gekko/ML.py on how it translates scikit-learn and tensorflow models to Gekko.
Your method works for initialization. An alternative is to use STATUS=1 and .value=np.random.randn() without needing to use .FSTATUS and .MEAS
@@apm Thank you for your guidance! I In case I want to train my neural network with a constrained loss function, Can, using TensorFlow model for fitting and import it into Gekko, work??? If yes, how then should I use constrained optimization during model training?
@@apm Thank you very much !
@@user-su5eu5ts2z you can add constraints in TensorFlow: www.tensorflow.org/api_docs/python/tf/keras/constraints/Constraint and then import that fit model in Gekko. Gekko is more flexible with different types of constraints, but TensorFlow is built for larger datasets. Once the model is fit, those constraints are no longer required to make inferences.
Code doesn't work for me. I got this error: "The requested operation has no match to return."(BadNoMatch)
The error message "The requested operation has no match to return." (BadNoMatch) from the Python OPC UA package generally indicates that the operation you attempted to perform did not find a valid target or match in the server's address space or data structures.
I want to create an MQTT client to listen to a host machine but I do not know the "topics" hence I am not able to subscribe to them. Is there any way I can find out what are the available topics from the host? Anyone?
In MQTT (Message Queuing Telemetry Transport), topics are used as the routing information for messages, and clients subscribe to these topics to receive messages that interest them. However, MQTT does not have a built-in feature to discover topics because it is designed to be lightweight and simple. Topics are typically determined by the application design or the configuration of the MQTT broker and its clients. If you're working with an MQTT broker and you don't know the topics, here are a few approaches you can take to discover or manage topics: Broker Configuration and Logs: Check Broker Configuration: If you have access to the MQTT broker, you can check its configuration files. Some brokers might list the topics that have been configured or have defaults. Broker Logs: Some MQTT brokers log details about connected clients and their subscriptions. By examining these logs, you might be able to identify active topics. Contact System Administrator or Developer: If you're working in a managed environment, the system administrator or the developer who set up the MQTT broker might have a list of topics or documentation about the topic structure.
Can Spyder IDE be used with these labs?
Yes, no problem on Spyder. Here is a way to display real-time plots: In the Spyder IDE menu bar select Tools, Preferences, IPython Console, Graphics, Backend=Automatic. This will allow real-time plots to display as a new window instead of inline in the IPython console. Here is additional help: apmonitor.com/pdc/index.php/Main/ArduinoSetup
@@apm Thank you so much for providing great content! I appreciate your work!
CAN U SHARE THE MATLAB AND SIMULINK FILES
Sure, the file location is shown at 0:48 in the video