APMonitor.com
APMonitor.com
  • 955
  • 17 145 456
Optimize Uncertainty with GPR Model and Gekko
Optimization Under Uncertainty: Gaussian Process Regression (GPR) and Gekko Optimization
This video walks through the process of setting up, training, and optimizing a GPR model to handle uncertainty in predictions, ideal for tasks requiring uncertainty-aware decision-making.
Outline:
1. Introduction to Gaussian Process Regression (GPR)
- Understanding GPR as a probabilistic model
- Benefits of GPR in making predictions with well-defined uncertainty
- Detailed mathematical description available in the "Machine Learning for Engineers" course
2. Setting Up the Environment
- Importing essential libraries: NumPy, Matplotlib, Gekko, and Scikit-learn's Gaussian Process Regressor and kernels
- Installation guide for Gekko if not already installed
3. Data Generation and Visualization
- Generating noisy data samples
- Visualizing true functions and measured data points
4. Data Preparation
- Splitting data into training and testing sets using scikit-learn’s `train_test_split`
5. GPR Model Training
- Creating and training a GPR model
- Evaluating model performance using the R-squared metric
6. Model Visualization
- Plotting trained GPR model predictions and confidence intervals against true functions and noisy measurements
7. Optimization with Gekko
- Using Gekko to perform optimization
- Minimizing predicted values and uncertainties using the trained GPR model
8. Uncertainty Optimization
- Minimizing uncertainty with Gekko
9. Multi-Objective Optimization
- Minimizing both expected values and uncertainties as a weighted sum
10. Results Visualization
- Visualizing optimization results
- Highlighting points of optimized predicted values and uncertainties
Check out the detailed mathematical description on the Gaussian Process Regression learning page in the "Machine Learning for Engineers" course for more insights. Code Blocks Available:
- Import Libraries
- Generate Data
- Data Preparation
- GPR Model Training
- Model Visualization
- Optimization with Gekko
- Uncertainty Optimization
- Multi-Objective Optimization
- Results Visualization
Переглядів: 540

Відео

Net-Zero Circular Economy with Systems Design
Переглядів 27028 днів тому
Webinar in our Process Systems Engineering series, sponsored by the Computing and Systems Technology (CAST) division of AIChE. This webinar features a presentation on "Systems Design to Enable a Net-Zero Circular Economy" by Vyom Thakker. apmonitor.com/wiki/index.php/Main/ApplicationWebinars - Topic: Systems Design to Enable a Net-Zero Circular Economy - Date: Tuesday, June 4 - Presenter: Vyom ...
Sustainability: Future of Process Systems Engineering
Переглядів 423Місяць тому
Bhavik Bakshi holds the Wrigley Professorship at Arizona State University with appointments in the School for Engineering of Matter, Transport and Energy, School of Sustainability and School of Complex Adaptive Systems. He is also the Richard M. Morrow professor emeritus in the Department of Chemical and Biomolecular Engineering at The Ohio State University. His research is developing systemati...
GPU Large-Scale Nonlinear Programming
Переглядів 9222 місяці тому
📢 Large-Scale Nonlinear Programming on GPUs: State-of-the-Art and Future Prospects 🎓 Presenter: Sungho Shin, ANL / MIT 📆 Date/Time: Thurs, Apr 11 🌐 Where: Online - Interactive chat and video conference Congratulations to Sungho Shin as the winner of the AIChE CAST Division W. David Smith Jr. Graduate Publication Award. AIChE Computing & Systems Technology Division webinar. Bio Sungho Shin is an...
Benchmark LLMs with Ollama Python Library
Переглядів 7062 місяці тому
The ollama and transformers libraries are two packages that integrate Large Language Models (LLMs) with Python to provide chatbot and text generation capabilities. This tutorial covers the installation and basic usage of the ollama library. The first step is to install the ollama server. After the server is running, install the ollama python package with pip: pip install ollama With the ollama ...
Local RAG LLM with Ollama
Переглядів 1,5 тис.2 місяці тому
Applications of Retrieval-Augmented Generation (RAG) and Large Language Models (LLMs) give context-aware solutions for complex Natural Language Processing (NLP) tasks. Natural language processing (NLP) is a machine learning technology that gives computers the ability to interpret, manipulate, and interact with human language. Combining RAG and LLMs enables personalized, multilingual, and contex...
RAG Similarity Search with ChromaDB
Переглядів 6293 місяці тому
ChromaDB is a local database tool for creating and managing vector stores, essential for tasks like similarity search in large language model processing. This tutorial covers how to set up a vector store using training data from the Gekko Optimization Suite and explores the application in Retrieval-Augmented Generation (RAG) for Large-Language Models (LLMs). The first step is to install necessa...
Virtual Teaching Environment
Переглядів 2533 місяці тому
Contents Under Pressure: A Virtual Teaching Environment. David Himmelblau Award for Innovations in Computer-Based Chemical Engineering Education recognizes an individual or group making new and novel contributions to computer aids for chemical engineering education. Matthew E. Cooper is an Alumni Distinguished Undergraduate Professor in the Department of Chemical and Biomolecular Engineering at...
Machine Learning for Engineers in MATLAB
Переглядів 1,8 тис.4 місяці тому
We explore the innovative integration of machine learning in chemical engineering education. The focus is on the "Machine Learning for Engineers" course, which has been translated from Python into MATLAB. This initiative addresses the growing interest in machine learning within the chemical engineering sector to equip students with relevant skills in this rapidly evolving domain. The webinar co...
Exergy Analysis for Energy Systems
Переглядів 8434 місяці тому
Professor Thomas Adams II (NTNU) shares insights on Exergy Analysis for Energy Systems to evaluate technologies such as Direct Air Capture of CO2. Additional webinars are available at apmonitor.com/wiki/index.php/Main/ApplicationWebinars Bio Dr. Thomas A. Adams II, P.Eng, a Professor in the Department of Energy and Process Engineering at NTNU, specializes in sustainable chemical and energy proc...
Process Control with Portable Labs
Переглядів 5435 місяців тому
IFAC TC9.4 & IEEE CSS Control Education Webinar on Data-Driven Engineering and Process Control Education with Portable Labs. This presentation highlights open-source labs that are community developed to reinforce concepts from Process Dynamics and Control, Data Engineering, and Machine Learning. This is a second recording of the webinar with improved audio and video quality. The live session is...
Generative AI for PSE
Переглядів 6 тис.8 місяців тому
Generative AI for Process Systems Engineering: Potential Applications and Pitfalls This presentation is an introduction on Generative AI on the field of Process Systems Engineering (PSE). At its core, PSE revolves around the mathematical modeling, optimization, and simulation of chemical and physical processes. With Generative AI, particularly advancements like Large Language Models (LLMs), off...
Data-Driven Education FOPAM 2023
Переглядів 89010 місяців тому
Session: Past and Future of Process/Product Analytics & Machine Learning, including Education and Workforce Development Author: John Hedengren, Brigham Young University Title: Data-Driven Engineering Education with Hands-On Learning Data engineering with acquisition, transport, curation, and storage of data has emerged as a key role in Industry 4.0. Aspiring data scientists have many online rep...
Fiber Optic Data-Driven TLP Tendon Loads
Переглядів 382Рік тому
Hedengren, J.D., Brower, D.V., Kidder, K., Hillman, Z., Data-Driven TLP Tendon Loads from Internal Hull Fiber-Optic Sensors, ASME 42nd International Conference on Ocean, Offshore and Arctic Engineering, OMAE2023/103309, Melbourne, Australia, June 2023. Preprint: apm.byu.edu/prism/uploads/Members/Hedengren_OMAE23.pdf Presented at OMAE 2023 A new and innovative monitoring system is based on fiber...
Unlock Athletic Potential with Machine Learning
Переглядів 1,1 тис.Рік тому
2023 Utah Valley Marathon Symposium talk on Unlocking Athletic Performance with Machine Learning. Thanks to McGyver Clark as AlphaPeak co-founder and Iain Hunter, Scott McKeel, Isaac Hedengren, Marshall Dahneke, and Luke VanKeersbilck as collaborators.
Ethanol Bioreactor
Переглядів 2,2 тис.Рік тому
Ethanol Bioreactor
Double Tank Level Control
Переглядів 2 тис.Рік тому
Double Tank Level Control
Hanging Chain Shape
Переглядів 732Рік тому
Hanging Chain Shape
Oil Shale Pyrolysis
Переглядів 1 тис.Рік тому
Oil Shale Pyrolysis
Drone Flight Optimization
Переглядів 1,8 тис.Рік тому
Drone Flight Optimization
Batch Reactor Optimization
Переглядів 1,7 тис.Рік тому
Batch Reactor Optimization
MPC Flight Optimization
Переглядів 1,5 тис.Рік тому
MPC Flight Optimization
Furnace Control with Mixed Integer MPC
Переглядів 1,4 тис.Рік тому
Furnace Control with Mixed Integer MPC
Lotka Volterra Optimal Control
Переглядів 1,6 тис.Рік тому
Lotka Volterra Optimal Control
High Index DAE Solution
Переглядів 899Рік тому
High Index DAE Solution
Regression with Outlier
Переглядів 894Рік тому
Regression with Outlier
Minimize Fuel with ODE Optimization
Переглядів 1,9 тис.Рік тому
Minimize Fuel with ODE Optimization
Solve ODEs and Minimize Objective
Переглядів 982Рік тому
Solve ODEs and Minimize Objective
Data-Driven Engineering Tutorials
Переглядів 1,4 тис.Рік тому
Data-Driven Engineering Tutorials
Hybrid Machine Learning with Seeq SysID
Переглядів 994Рік тому
Hybrid Machine Learning with Seeq SysID

КОМЕНТАРІ

  • @rodrigoburgos8429
    @rodrigoburgos8429 День тому

    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
      @apm День тому

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

  • @georgigeorgiev3970
    @georgigeorgiev3970 3 дні тому

    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
      @apm 2 дні тому

      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
    @ayesha11261 11 днів тому

    Thanks, this is exactly what I was looking for

  • @MoGoldberger
    @MoGoldberger 13 днів тому

    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-wb9zr1fl4c 14 днів тому

    you can show Ethernet IP protocol ? . Thank

  • @luca058
    @luca058 20 днів тому

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

    • @apm
      @apm 19 днів тому

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

  • @Hallucinarix
    @Hallucinarix 22 дні тому

    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 22 дні тому

    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 22 дні тому

      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 22 дні тому

    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 22 дні тому

      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 22 дні тому

    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 25 днів тому

    😀

  • @ultimatums1
    @ultimatums1 28 днів тому

    Lol, pipe dream

  • @eric13hill
    @eric13hill 28 днів тому

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

  • @rodrigoburgos8429
    @rodrigoburgos8429 29 днів тому

    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
    @Wtf95 Місяць тому

    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
    @reTache4955 Місяць тому

    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
      @apm Місяць тому

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

  • @8beef4u
    @8beef4u Місяць тому

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

    • @apm
      @apm Місяць тому

      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-ip1gk9dj8y Місяць тому

    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-zq6cf Місяць тому

    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
      @apm Місяць тому

      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-zq6cf Місяць тому

      @@apm ok. Thanks a lot

  • @chenbruce318
    @chenbruce318 Місяць тому

    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
      @rrc Місяць тому

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

  • @vinceroos
    @vinceroos 2 місяці тому

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

  • @abdfa4909
    @abdfa4909 2 місяці тому

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

  • @baby_efa
    @baby_efa 2 місяці тому

    Thank you for the video! I appreciate it!

  • @user-su5eu5ts2z
    @user-su5eu5ts2z 2 місяці тому

    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
      @apm 2 місяці тому

      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
      @apm 2 місяці тому

      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-su5eu5ts2z 2 місяці тому

      @@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-su5eu5ts2z 2 місяці тому

      @@apm Thank you very much !

    • @apm
      @apm 2 місяці тому

      @@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
    @yorha2b278 2 місяці тому

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

    • @apm
      @apm 2 місяці тому

      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
    @yorha2b278 2 місяці тому

    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
      @apm 2 місяці тому

      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
    @JJGhostHunters 2 місяці тому

    Can Spyder IDE be used with these labs?

    • @apm
      @apm 2 місяці тому

      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
      @JJGhostHunters 2 місяці тому

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

  • @aryamallick5426
    @aryamallick5426 2 місяці тому

    CAN U SHARE THE MATLAB AND SIMULINK FILES

    • @apm
      @apm 2 місяці тому

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

  • @mohamedkeddache4202
    @mohamedkeddache4202 2 місяці тому

    how can i do to stream the response like chatGPT ?

    • @apm
      @apm 2 місяці тому

      Set `stream=True`. Here is example code: github.com/ollama/ollama-python

  • @BFGalbraith74
    @BFGalbraith74 2 місяці тому

    Great video, great software, thanks!

  • @senolkurt7864
    @senolkurt7864 2 місяці тому

    Thanks for the great tutorial. Since in real life we have only the data, how can we find the best non-linear equation that fits to our data?

    • @apm
      @apm 2 місяці тому

      If you don't know the non-linear equation, try using regression with Machine Learning: apmonitor.com/pds/index.php/Main/RegressionOverview The lazypredict package in Python helps evaluate the regression on multiple models. Otherwise, try different functional forms that you design.

  • @darshmishra6475
    @darshmishra6475 2 місяці тому

    How do we handle cases where we have a subscription based getting data and suppose there is a connection drop. So we still go with latest value assuming it has remained constant and not updated ?

    • @apm
      @apm 2 місяці тому

      When working with OPC servers, identifying and managing stale or outdated data values is important in industrial applications where data integrity is vital for operation safety and efficiency. Here are strategies to detect stale values with OPC UA: 1. Timestamp Checking Each value read from an OPC UA server includes a timestamp that can be used to detect when data becomes stale if the timestamp remains unchanged over an extended period. 2. Subscription and Monitored Items Instead of polling data (repeatedly reading values), OPC UA supports subscriptions where the server notifies the client of changes. You can specify a publishing interval and a "deadband" to filter out unnecessary updates. Monitored items can be set to notify only on significant changes or after a certain time of inactivity. 3. Setting Data Quality Flags OPC UA servers can be configured to include data quality flags with each value. These flags can indicate issues such as communication errors, sensor malfunctions, or configuration errors. By checking these flags, you can determine if the data should be considered reliable. 4. Implement Heartbeat Signals For critical variables that must be updated regularly, implementing a "heartbeat" signal can be effective. This is a write operation performed by the data source at a regular interval to a specific variable, indicating that the source is still operational. The absence of recent updates to this heartbeat variable can signal an issue with the data source. 5. Analyzing Historical Data Patterns In some cases, analyzing the historical patterns of data updates can help identify anomalies in data freshness. If certain variables typically update at regular intervals, deviations from this pattern can be flagged for further investigation.

  • @Anonimka338
    @Anonimka338 2 місяці тому

    Hello, sorry for asking Lagrange multipliers here but I wanna clear my doubts . Can I just solve mutlivariable Optimizations using this ? 1. Solve problem standard way(like in equation constraints) so assuming both are active. 2. Solve problem with one Constrait being inactive using thay constant so it will be zero. Another constrait is active 3. Again but now vica versa of 2. 4. Both constraits are inactive. And then which will be min and max will be my answer. Is that right ? Also whaf if I have just one constrait inequality. Looks like it will be only two steps 1. Solve like in equation constrait so its active 2. Solve like its nonactive so zero. BUT if I get some values of x and y it MUST satisfy the inequality of constrait in both cases as Constrait was annulated because of That Constant by which its multiplied but its still our limitations. Please tell me if I am right, because I solved many Optimization problems using this method and it worked everytime .

    • @apm
      @apm 2 місяці тому

      These tutorials may help: apmonitor.com/me575/index.php/Main/KuhnTucker

  • @Anonimka338
    @Anonimka338 2 місяці тому

    Can I just solve using this ? 1. Solve problem standard way(like in equation constraints) so assuming both are active. 2. Solve problem with one Constrait being inactive using thay constant so it will be zero. Another constrait is active 3. Again but now vica versa of 2. 4. Both constraits are inactive. And then which will be min and max will be my answer. Is that right ? Also whaf if I have just one constrait inequality. Looks like it will be only two steps 1. Solve like in equation constrait so its active 2. Solve like its nonactive so zero. BUT if I get some values of x and y it MUST satisfy the inequality of constrait in both cases as Constrait was annulated because of That Constant by which its multiplied but its still our limitations. Please tell me if I am right, because I solved many Optimization problems using this method and it worked everytime .

    • @apm
      @apm 2 місяці тому

      Here is a series of tutorials that may help: apmonitor.com/me575/index.php/Main/KuhnTucker

    • @Anonimka338
      @Anonimka338 2 місяці тому

      @@apm Thanks for reply. However. Isn't what I wrote correct ?

    • @apm
      @apm 2 місяці тому

      @@Anonimka338 that works for systems with 2 constraints. For problems with hundreds or thousands of constraints, such as solved with Gekko (gekko.readthedocs.io/en/latest/), interior point or active set methods are two popular methods to solve constrained optimization problems. Here is additional information on using barrier methods with Interior Point Methods: apmonitor.com/me575/index.php/Main/InteriorPointMethod Active set methods use Lagrange multiplier information and heuristics to determine when to add or remove constraints from the active set (or constraining) set.

    • @Anonimka338
      @Anonimka338 2 місяці тому

      @@apm Thank you very much )

  • @alfonsor.6722
    @alfonsor.6722 2 місяці тому

    Hi, very interesting video. Can you share the code used (github, notebook, etc.)? Thanks.!

    • @apm
      @apm 2 місяці тому

      Sure, it is all available here with a Jupyter Notebook and a link to open the Notebook on Google Colab: apmonitor.com/dde/index.php/Main/RAGLargeLanguageModel

  • @user-zx8wp5bo7r
    @user-zx8wp5bo7r 2 місяці тому

    I would like to know more about your project, if you could send me your email address to contact you privately please

  • @VanKrumm
    @VanKrumm 3 місяці тому

    error:externally-managed-environment

  • @nicdeen7482
    @nicdeen7482 3 місяці тому

    this was very helpful, ty so much!

  • @romix8340
    @romix8340 3 місяці тому

    Thanks a lot, it helped me on how to cut in parts odeint and showed me that we can put more arguments in the function for odeint !! Very useful ❤

  • @Anorch-oy9jk
    @Anorch-oy9jk 3 місяці тому

    if my server also has to handle api calls, how can I combine that? I know how to asnyc it, but my issue is the server IP. Locally I use fast api and a ws endpoint. But once deployed with https protocol, the ws endpoint no longer works

    • @apm
      @apm 2 місяці тому

      You need to switch to wss instead of ws for https protocol.

    • @Anorch-oy9jk
      @Anorch-oy9jk Місяць тому

      @@apm managed to do it! The clients needed to do a handshake cause the server was secured hosted as https and so the ws endpoint also switched to secured wss.

  • @alexisdasiukevich5417
    @alexisdasiukevich5417 3 місяці тому

    Where does the "x >= 0" come from at 2:45?

    • @apm
      @apm 2 місяці тому

      That's part of the general form for Interior Point solvers. You can translate any general optimization problem into that form with slack variables and rearrangement.