APMonitor.com

APMonitor.com

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.

Local RAG LLM with Ollama

Local RAG LLM with Ollama

Generative AI for PSE

Generative AI for PSE

Ethanol Bioreactor

Ethanol Bioreactor

Double Tank Level Control

Double Tank Level Control

Hanging Chain Shape

Hanging Chain Shape

Oil Shale Pyrolysis

Oil Shale Pyrolysis

Drone Flight Optimization

Drone Flight Optimization

Batch Reactor Optimization

Batch Reactor Optimization

MPC Flight Optimization

MPC Flight Optimization

High Index DAE Solution

High Index DAE Solution

Regression with Outlier

Regression with Outlier

Пікірлер

  • @evantale3191
    @evantale319123 сағат бұрын

    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 ! 😄🤝

  • @adamatepsilon9858
    @adamatepsilon98584 күн бұрын

    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.

  • @apm
    @apm4 күн бұрын

    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

  • @hariharan-yi8tf
    @hariharan-yi8tf6 күн бұрын

    I will try and update

  • @hariharan-yi8tf
    @hariharan-yi8tf5 күн бұрын

    It was not worked when tried to import It have not showed any xlsx file only mat files shown

  • @sihya9602
    @sihya96026 күн бұрын

    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 :(

  • @apm
    @apm6 күн бұрын

    This dataset isn't published elsewhere. You can just cite this website: apmonitor.com/pds/index.php/Main/SoilClassification

  • @zemanntill
    @zemanntill6 күн бұрын

    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 :)

  • @apm
    @apm6 күн бұрын

    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

  • @zemanntill
    @zemanntill6 күн бұрын

    ​@@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?

  • @zemanntill
    @zemanntill6 күн бұрын

    ​@@apmAnd is nonlinear optimization fast enough if I have many agents?

  • @apm
    @apm6 күн бұрын

    @@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.

  • @alaaosama7679
    @alaaosama76797 күн бұрын

    I know it’s a stupid question but aren’t websockets requiring internet to work?

  • @apm
    @apm6 күн бұрын

    @@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.

  • 7 күн бұрын

    Well done.

  • @darkside3ng
    @darkside3ng7 күн бұрын

    Amazing!!!

  • @lakshminarayanansamavedham3770
    @lakshminarayanansamavedham37707 күн бұрын

    Thank you!

  • @aaronsarinana1654
    @aaronsarinana16547 күн бұрын

    Great session! Thanks professor!

  • @amel3778
    @amel37787 күн бұрын

    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?

  • @apm
    @apm7 күн бұрын

    You can have 2 inputs to the system with [u,d] and one output [y].

  • @GreenFootprint
    @GreenFootprint12 күн бұрын

    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.

  • @pnachtwey
    @pnachtwey12 күн бұрын

    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.

  • @rodrigoburgos8429
    @rodrigoburgos842916 күн бұрын

    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?

  • @apm
    @apm16 күн бұрын

    Sure, see Exercise 2: apmonitor.com/do/index.php/Main/LSTMNetwork

  • @georgigeorgiev3970
    @georgigeorgiev397017 күн бұрын

    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?

  • @apm
    @apm17 күн бұрын

    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.

  • @ayesha11261
    @ayesha1126126 күн бұрын

    Thanks, this is exactly what I was looking for

  • @MoGoldberger
    @MoGoldberger28 күн бұрын

    Can you share the link to the Linear Programming video you suggest watching before this video? I'm having trouble finding it.

  • @user-wb9zr1fl4c
    @user-wb9zr1fl4c29 күн бұрын

    you can show Ethernet IP protocol ? . Thank

  • @luca058
    @luca058Ай бұрын

    Hi thank you very much for the video. How would I proceed with critically damped systems?

  • @apm
    @apmАй бұрын

    Here is more information on underdamped, critically damped, and overdamped second order systems: apmonitor.com/pdc/index.php/Main/SecondOrderSystems

  • @Hallucinarix
    @HallucinarixАй бұрын

    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)

  • @Hallucinarix
    @HallucinarixАй бұрын

    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)

  • @apm
    @apmАй бұрын

    Great idea - it just adds an additional input parameter to the function, but makes the code more modular and reusable for other applications.

  • @Aryan1367
    @Aryan1367Ай бұрын

    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?

  • @apm
    @apmАй бұрын

    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

  • @michal5642
    @michal5642Ай бұрын

    Amazing video, I am writing my own program to showcase control on a double pendulum and this is a fantastic resource!

  • @user-ex4hg8ec2i
    @user-ex4hg8ec2iАй бұрын

    😀

  • @ultimatums1
    @ultimatums1Ай бұрын

    Lol, pipe dream

  • @eric13hill
    @eric13hillАй бұрын

    Wonderful content John! I'm glad you posted this.

  • @rodrigoburgos8429
    @rodrigoburgos8429Ай бұрын

    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

  • @jomurciap
    @jomurciapАй бұрын

    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!

  • @apm
    @apmАй бұрын

    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.

  • @americanpatriot6574
    @americanpatriot6574Ай бұрын

    John’s daughter also broke the American record in the high school 3 mile last fall! He is a great coach!

  • @komillz
    @komillzАй бұрын

    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

  • @apm
    @apmАй бұрын

    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.

  • @komillz
    @komillzАй бұрын

    @apm oh thanks alot sir

  • @muddymkamba352
    @muddymkamba352Ай бұрын

    is it possible for device like teltonika FMB920 to send data to MQTT bROCKER

  • @apm
    @apmАй бұрын

    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.

  • @sihya9602
    @sihya9602Ай бұрын

    Where is soil.h5? I can only find train and test

  • @apm
    @apmАй бұрын

    It is created when you train the model.

  • @sihya9602
    @sihya9602Ай бұрын

    @@apm OK, got it, Thanku

  • @FonMillaJoel-zm2cn
    @FonMillaJoel-zm2cnАй бұрын

    Thank you. Please which software are you using and can this be applied to a pipeline transporting dredged sediments in a port.

  • @apm
    @apmАй бұрын

    The software is Python Gekko. Source code is available at apmonitor.com/me575/index.php/Main/LimestoneSlurry

  • @FonMillaJoel-zm2cn
    @FonMillaJoel-zm2cnАй бұрын

    @@apm thank you 🙏

  • @salchicasvoladoras
    @salchicasvoladorasАй бұрын

    From where is this exercise? (Felder Book?) Which number of exercise? Thank you

  • @apm
    @apmАй бұрын

    Elementary Principles of Chemical Processes 3rd Edition by Richard M. Felder and Ronald W. Rousseau - unfortunately, I don't remember the problem number.

  • @salchicasvoladoras
    @salchicasvoladorasАй бұрын

    From which book are the problems

  • @apm
    @apmАй бұрын

    Elementary Principles of Chemical Processes 3rd Edition by Richard M. Felder and Ronald W. Rousseau

  • @UFCDeityESP-ty9qp
    @UFCDeityESP-ty9qpАй бұрын

    8 years later & still awesome!

  • @Wtf95
    @Wtf952 ай бұрын

    Nice video! Thanks! May be you can make video about OPC UA TSN? And IEC/IEEE 60802 TSN?

  • @apm
    @apmАй бұрын

    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.

  • @reTache4955
    @reTache49552 ай бұрын

    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

  • @apm
    @apm2 ай бұрын

    Great observation. Setting a bound or rearranging the equation to avoid divide-by-zero is often effective.

  • @8beef4u
    @8beef4u2 ай бұрын

    Is it possible to use the R squared value as an objective, i.e. minimize R^2-1?

  • @apm
    @apm2 ай бұрын

    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

  • @user-ip1gk9dj8y
    @user-ip1gk9dj8y2 ай бұрын

    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

  • @GroupAdmin-zq6cf
    @GroupAdmin-zq6cf2 ай бұрын

    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?

  • @apm
    @apm2 ай бұрын

    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).

  • @GroupAdmin-zq6cf
    @GroupAdmin-zq6cf2 ай бұрын

    @@apm ok. Thanks a lot

  • @chenbruce318
    @chenbruce3182 ай бұрын

    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:// ?

  • @rrc
    @rrc2 ай бұрын

    Yes, no problem on deploying it as a web service. Just open the firewall on port 443 to not block the connection.

  • @vinceroos
    @vinceroos2 ай бұрын

    Stop looking everyone. You're not going to find a better video on Laplace transforms using Python.

  • @abdfa4909
    @abdfa49092 ай бұрын

    this is EXACTLY what i'm doing as a graduation project ,Great Work

  • @baby_efa
    @baby_efa2 ай бұрын

    Thank you for the video! I appreciate it!

  • @user-su5eu5ts2z
    @user-su5eu5ts2z2 ай бұрын

    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??

  • @apm
    @apm2 ай бұрын

    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.

  • @apm
    @apm2 ай бұрын

    Your method works for initialization. An alternative is to use STATUS=1 and .value=np.random.randn() without needing to use .FSTATUS and .MEAS

  • @user-su5eu5ts2z
    @user-su5eu5ts2z2 ай бұрын

    @@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?

  • @user-su5eu5ts2z
    @user-su5eu5ts2z2 ай бұрын

    @@apm Thank you very much !

  • @apm
    @apm2 ай бұрын

    @@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.

  • @yorha2b278
    @yorha2b2782 ай бұрын

    Code doesn't work for me. I got this error: "The requested operation has no match to return."(BadNoMatch)

  • @apm
    @apm2 ай бұрын

    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.

  • @yorha2b278
    @yorha2b2782 ай бұрын

    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?

  • @apm
    @apm2 ай бұрын

    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.

  • @JJGhostHunters
    @JJGhostHunters2 ай бұрын

    Can Spyder IDE be used with these labs?

  • @apm
    @apm2 ай бұрын

    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

  • @JJGhostHunters
    @JJGhostHunters2 ай бұрын

    @@apm Thank you so much for providing great content! I appreciate your work!

  • @aryamallick5426
    @aryamallick54262 ай бұрын

    CAN U SHARE THE MATLAB AND SIMULINK FILES

  • @apm
    @apm2 ай бұрын

    Sure, the file location is shown at 0:48 in the video