Science topic

Simulink - Science topic

Simulink, developed by MathWorks, is a commercial tool for modeling, simulating and analyzing multidomain dynamic systems. Its primary interface is a graphical block diagramming tool and a customizable set of block libraries. It offers tight integration with the rest of the MATLAB environment and can either drive MATLAB or be scripted from it. Simulink is widely used in control theory and digital signal processing for multidomain simulation and Model-Based Design.
Questions related to Simulink
  • asked a question related to Simulink
Question
1 answer
Hi,
I want to collect data for 120 Hz in simulink real time simulation to have sample time same as the controller. But i am getting error for sapmle time less than 0.01 and even for 0.01 sample time the result i got had 0.02 sec interval in data points.
Thanks
Relevant answer
Answer
In Simulink MATLAB, Hardware-in-the-Loop (HIL) testing can throw errors when the sample time is set to less than 0.01 seconds due to several possible reasons. Here are the key factors that may be causing this issue:
1. Many real-time targets and hardware interfaces (e.g., DAQs, communication buses) have specific limitations on how fast they can handle data exchange. If the sample time is set too low (e.g., less than 0.01 seconds), the hardware might not be able to process the input and output data within that time, leading to buffer overflows or missed deadlines.
2. Check the specifications of the real-time hardware you're using to ensure that it supports the desired sample rate.
3. Real-time systems are designed to meet hard timing requirements. If the model or hardware interface requires more computation than the available processor can handle in the specified sample time, it can cause overruns. To address this, try optimizing the model to reduce computational load, or increase the sample time to accommodate the processing requirements.
4. Simulink models often use a fixed-step solver for real-time simulation. Ensure that the solver settings are properly configured for the hardware's real-time execution.
- For example, ensure you are using a fixed-step discrete solver like `ode1 (Euler)` when simulating in real time, as variable-step solvers are not suitable for HIL testing.
- Set the fixed-step size in the solver settings to match the sample time you are using, and avoid setting a step size that is too small for real-time execution.
5. The real-time kernel or scheduler on your system may have limits on task execution timing. If the requested sample time is too short, it may not be able to schedule the task effectively, causing overruns.
- Review the settings of the real-time kernel (such as Simulink Real-Time or Simulink Desktop Real-Time) and adjust the sample time based on the kernel’s ability to handle high-frequency tasks.
6. Complex models with many states, subsystems, or intensive computations may not run efficiently with very small sample times in real time. Try simplifying the model to ensure real-time execution is achievable with a smaller sample time.
>>> Troubleshooting Tips:
1. Use the Simulink Profiler to understand the computation times and identify any bottlenecks in the model.
2. Start with a larger sample time (e.g., 0.01 seconds) and gradually reduce it to see where the performance issue arises.
3. Break your model into smaller subsystems and test their real-time behavior individually before integrating them.
By reviewing and adjusting these areas, you can help mitigate errors and achieve real-time performance with smaller sample times in your HIL testing.
  • asked a question related to Simulink
Question
3 answers
I have a Simulink model that connected a main utility (AC-grid) with a three-phase load changing from 20kW to 100kW in 5 seconds and I don't know how to build this load in Simulink. Please your help, will be highly appreciated.
Relevant answer
Answer
Simulating a varying three-phase load or load profile in Simulink/MATLAB involves several steps to ensure the load variations are accurately represented over time. Here's a step-by-step guide:
### 1. Setup Simulink Model
1. **Open Simulink**: Start MATLAB and open Simulink by typing `simulink` in the MATLAB command window.
2. **Create a New Model**: Click on `New` -> `Model`.
### 2. Configure the Three-Phase Source
1. **Three-Phase Source Block**: Add a three-phase source block to your model. You can find it under `Simscape > Electrical > Specialized Power Systems > Sources`.
2. **Configure the Source**: Double-click on the three-phase source block to set the parameters such as voltage and frequency.
### 3. Add a Three-Phase Load
1. **Three-Phase Load Block**: Add a three-phase load block. This can be found under `Simscape > Electrical > Specialized Power Systems > Elements`.
2. **Configure the Load**: Double-click on the load block to set the initial load parameters (e.g., initial power, voltage, and power factor).
### 4. Create a Load Profile
1. **Time-Variant Load**: To simulate a varying load, you can use a `Signal Builder` block, `From Workspace` block, or any other source block that can generate a time-variant signal.
2. **Load Profile Data**: Prepare the load profile data in MATLAB. This could be a set of values that change over time, representing the load variations.
### 5. Connect the Load Profile to the Load
1. **Controlled Load Block**: Use a controlled three-phase load block if available. Connect the load profile signal to the control input of the load block.
2. **Subsystems**: If a controlled load block is not available, you can create a subsystem that modifies the load parameters based on the load profile.
### 6. Simulation Settings
1. **Solver Configuration**: Ensure the solver settings are appropriate for your simulation. Use a continuous solver for better accuracy with power systems.
2. **Run the Simulation**: Configure the simulation time and run the simulation to observe how the load varies over time.
### Example Code for Load Profile
```matlab
% Time vector
time = 0:0.01:10; % 0 to 10 seconds with 0.01s interval
% Load profile (example: a sinusoidal variation)
load_profile = 100 * (1 + 0.5 * sin(2 * pi * 0.1 * time)); % 100 W base load with sinusoidal variation
% Create a timeseries object
load_profile_ts = timeseries(load_profile, time);
% In Simulink, use a 'From Workspace' block to import this load profile
```
### Connecting in Simulink
1. **From Workspace Block**: Drag and drop the `From Workspace` block into your model. Configure it to use the `load_profile_ts` timeseries object.
2. **Connect to Load**: Connect the output of the `From Workspace` block to the appropriate input of your controlled load block or subsystem.
### Example Model
Here is an example of how you might organize your Simulink model:
- **Three-Phase Source** connected to a **Bus Selector**.
- **Bus Selector** outputs connected to a **Controlled Three-Phase Load**.
- **From Workspace** block providing the load profile to the **Controlled Three-Phase Load**.
This setup allows you to simulate a dynamic three-phase load profile in your Simulink model. Adjust the parameters and data as needed to match your specific requirements.
  • asked a question related to Simulink
Question
2 answers
Hi, I am looking to link MATLAB to Aspen Adsorption. I know that for Aspen Plus, it is possible to use actxserver(). Does anyone know if the same method can be used for Aspen Adsorption as well?
But i have Aspen Adsorption linking with Excel VBA code is here, if you have any matlab code please share ..
Sub aspenaAdorption()
' Declare variables for the ACM application, document, and simulation
Dim ACMApp As Object
Dim ACMDocument As Object
Dim ACMSimulation As Object
' Create an instance of the ACM application
Set ACMApp = CreateObject("ACM Application")
' Use "ACM Application" for Aspen Custom Modeler
' Use "ADS Application" for Aspen Adsorption
' Make the ACM application visible
ACMApp.Visible = True
' Open the specified simulation document
Set ACMDocument = ACMApp.OpenDocument("C:\Users\user\Desktop\H2_Purification.acmf")
' Set the simulation object to the current simulation in the application
Set ACMSimulation = ACMApp.Simulation
' Set the simulation to run in dynamic mode
ACMSimulation.RunMode = "Dynamic"
' Run the simulation
' Check if the simulation was successful and display a message box
If ACMSimulation.Successful Then
MsgBox "Simulation Complete"
Else
MsgBox "Simulation Failed"
End If
' Quit the ACM application
ACMApp.Quit
End Sub
hashtag #aspenAdsorption #Adsorption #AspentechAspenTechnology #MATLAB Coding #optimization #aspen #chemicalengineering Chemical Engineering
Relevant answer
Answer
(1)将Matlab用“管理员方式运行”的方式打开软件;(这一步非常关键!!!)
(2)创建COM服务器的语句:Aspen=actxserver('Apwn.Document.40.0');
(3)运行该语句后如果在工作区出现”Aspen“,恭喜你通信成功!!
(4)如果运行之后出现了下图的报错,这时你需要将当前的Aspen Plus模型保存后关闭软件。
(5)在Aspen Plus软件保持关闭的情况下,重新运行上述语句。
以上就是在关联Aspen Plus和Matlab过程中的一点小小的经验,希望对大家有所帮助。@
  • asked a question related to Simulink
Question
3 answers
I use LoRa with Matlab/Simulink
Relevant answer
Answer
LoRa operates with a carrier frequency of roughly 900MHz. (It varies depending on which part of the world you are operating.) I see no reason why you could not transmit signals having a bandwidth of 10kHz.
  • asked a question related to Simulink
Question
2 answers
I'm new. I know just little use of matlab.
Help me for do this matlab simulink project.
Relevant answer
Answer
learn simscape in Matlab simulink.
  • asked a question related to Simulink
Question
2 answers
I try to build a three-phase wireless power transmission model and saw this module in an article.
Relevant answer
Answer
Go to MATLAB simulink. Then click on library browser. In the search bar type " transformers"
It will be names as ' three phase transformer 12 terminals'
OR
Double click on the simulink work space and type 'three phase transformer 12 terminals'
Hope that helps.
  • asked a question related to Simulink
Question
14 answers
I am using the Fuzzy Controller in MatLab R2017a. But when I execute the controller, it gives an error:
Error in 'model3_FUZZY/Fuzzy_PID_Controller/FuzzyController': Initialization commands cannot be evaluated.
Caused by:
Struct contents reference from a non-struct array object.
The files are also given. Kindly guide me, How do I proceed, and remove this error.
Relevant answer
Answer
FUZZYZ-ERROR CONTROL METHOD
  • asked a question related to Simulink
Question
1 answer
Adaptive Filters are core of the ANC system. They continuously adjusts its filter coefficients to minimize the error signal, effectively generating the anti-noise signal. Common choices include the Least Mean Squares (LMS) or Normalized LMS (NLMS) algorithms implemented using the respective Simulink blocks. However if the Anti-noise algorithm is analog electronic PCB with feedback mechanism, then does there exists a built in block in Simulink audio tool to design this algorithm?
Relevant answer
Answer
Namaste Dr. Gaur Kumar: It seems Simulink is a simulation software package. I am too old to have used it. Apologize for inability to help. You might have to consider writing some code if a built-in block is not available. Decades ago, I had to do the same thing for IIR/FIR filters.
  • asked a question related to Simulink
Question
1 answer
What is the best approach to design an H infinity controller for a linear model of a wind energy conversion system, with the goal of simulating it in Simulink? Any specific methods or tools recommended for implementation?
Relevant answer
Answer
Designing an H infinity controller for a wind energy conversion system involves several steps:Modeling the System: Develop a linear model of the wind energy conversion system, including the turbine, generator, and control system dynamics.Define Performance Specifications: Determine the performance specifications such as disturbance rejection, robust stability, and tracking requirements.Controller Design: Use H infinity control synthesis techniques to design a controller that optimizes the system's performance while ensuring robust stability and disturbance rejection.Implementation in Simulink: Implement the designed controller in Simulink using appropriate blocks and components.Simulation and Validation: Simulate the closed-loop system in Simulink to validate the controller's performance against the defined specifications and assess its robustness.Tools and methods recommended for implementation:Matlab/Simulink: Matlab/Simulink provides a comprehensive environment for modeling, simulation, and control system design, including tools for H infinity control synthesis.Robust Control Toolbox: Utilize Matlab's Robust Control Toolbox for H infinity controller design and analysis.Control System Toolbox: Use Matlab's Control System Toolbox for designing and analyzing control systems, including linear system modeling and simulation.Sensitivity Analysis Tools: Employ sensitivity analysis tools to assess the robustness of the designed controller against uncertainties and variations in the system parameters.Optimization Algorithms: Utilize optimization algorithms available in Matlab to fine-tune controller parameters and optimize performance.By following these steps and utilizing the recommended tools, you can design and implement an H infinity controller for a wind energy conversion system in Simulink effectively.
  • asked a question related to Simulink
Question
1 answer
Hi,
I am trying to implement the TECS core algorithm to my closed-loop 3DoF model of the aircraft in MatLab/Simulink.
The tuning of the innermost loops was accomplished succesfully, but now I am struggling with tuning the gains of the TECS core algoritm. I know that the dynamics of both the two errors must be the same, so the time constant must be the same. The problem is that I don't know how to impose this constraint via MatLab's standard command as systune or looptune.
Do you have any suggestions on how to do that?
Thank you
Relevant answer
Answer
The following paper has used Matlab/Simulink:
You may try to talk to the authors. More clues can be found at
  • asked a question related to Simulink
Question
3 answers
MATLAB simulink
Relevant answer
Answer
To represent an electric arc in MATLAB and measure its parameters such as voltage, current, and temperature, you can simulate the circuit using MATLAB's Simulink toolbox. First, create a circuit model that includes components like resistors, capacitors, and inductors to represent the electrical properties of the arc. Then, use appropriate sensors to measure voltage and current across the arc, and incorporate a temperature sensor to measure the arc temperature. Finally, use MATLAB functions to analyze the data collected from the sensors and calculate the arc parameters.
  • asked a question related to Simulink
Question
2 answers
Hello
In Simulink MATLAB, we have a three-phase microgrid that we want to improve its power quality with the help of a three-phase inverter and adding a proportional-resonance controller to the system. But we don't know how to implement the proportional-resonance controller in the Z domain (discrete time); We have tried many ways and failed; Please advise what are the ways to design the proportional-resonance controller in the discrete time domain?
Thanks
Relevant answer
Answer
Dear Homayoun,
You can use Tustin’s method for time discretization. (To convert the Laplace form to the z form). Then you could use this hint that (z^-1)*x(n) is equal to x(n-1). I have written the method to implement discrete form of PR controller on the Simulink for you in the attached PDF. Please recheck it. Moreover, the link (https://imperix.com/doc/implementation/proportional-resonant-controller) is also helpful.
Best Regards
  • asked a question related to Simulink
Question
2 answers
Currently, I have a global variable array and I can also plot it in the calibration window but I want to plot each data sample by a delay of 2.5 mili Seconds which means after one data sample next should be plotted after 2.5 mili Seconds.
and is it possible to do so in CANape Only without external software such as MATLAB-Simulink or Python etc...
Relevant answer
Answer
Follow these steps:
```python
import clr
from System import TimeSpan
# Load the CANape COM library
clr.AddReference('CANape7')
# Import CANape types
from CANape import CANape
def plot_signal_with_delay(signal_name):
# Create a CANape object
app = CANape()
try:
# Connect to CANape instance
app.Connect()
# Open the calibration window
# Create the measurement object for the specified signal
measurement = app.Measurement.CreateMeasurement(signal_name)
# Set the measurement mode to continuous
measurement.Mode = 1 # Continuous mode
# Set the measurement delay to 2.5 milliseconds
measurement.Delay = TimeSpan.FromMilliseconds(2.5)
# Start the measurement
measurement.Start()
# Wait for user interaction (e.g., press Ctrl+C) to stop the measurement
input("Press Enter to stop the measurement...")
# Stop the measurement
measurement.Stop()
finally:
# Disconnect from CANape instance
app.Disconnect()
# Example usage
signal_name = "MySignal"
plot_signal_with_delay(signal_name)
```
You should have CANape COM library (`CANape7.dll`) installed and available in the Python environment. You may need to adjust the DLL path in the `clr.AddReference()` line if it's located in a different directory.
Replace `"MySignal"` with the name of the signal you want to plot. The code opens the calibration window, creates a measurement object for the specified signal, sets the measurement mode to continuous, and sets the delay between each data sample to 2.5 milliseconds. The measurement is then started, and it will continue until you stop it by pressing Enter.
Hope it helps
  • asked a question related to Simulink
Question
5 answers
Can anyone suggest me or send me the MATLAB/SIMULINK file of optimization techniques based MPPT algorithm for solar photovoltaic systems??
Relevant answer
Answer
  • asked a question related to Simulink
Question
3 answers
I want to do Open loop analysis of BLDC motor. While doing so, when I want to connect BLDC motor block with 3-phase inverter in Simulink, it don't let me to connect it. This is the desired circuit which I want to connect it with.
Relevant answer
Answer
Muhammad Ahsan Ayub I tried using it but it doesn't solve the problem. Mohammed Bashar Sedeeq can you elaborate it?
  • asked a question related to Simulink
Question
1 answer
You can send me the file at kwadwoagyare0812@gmail.com , thank you
Relevant answer
Answer
Simulating a distance relay using MATLAB Simulink involves creating a model of a power system, implementing distance relay logic, and testing its performance under fault scenarios. Here's a summarized step-by-step guide:
  1. Model Power System: Construct a Simulink model representing the power system components.
  2. Fault Injection: Introduce faults at specific locations.
  3. Distance Relay Logic: Implement logic to calculate impedance or distance to faults based on relay settings and signals.
  4. Protection Logic: Design protection logic to trigger relay tripping.
  5. Simulation Parameters: Set time step, duration, and relay settings.
  6. Signal Sources: Generate current and voltage signals for relay inputs.
  7. Visualization: Use Simulink tools to visualize relay behavior.
  8. Testing: Run simulations, analyze relay responses, adjust settings as needed.
  9. Validation: Compare simulation results with real-world expectations.
  10. Documentation: Document model, logic, parameters, and assumptions.
Ensure familiarity with power systems, protection schemes, and Simulink for successful distance relay simulation.
  • asked a question related to Simulink
Question
1 answer
it was available in previous version under (S-Function-Simcoupler) simcoupler provides interface between PSIM and Matlab/Simulink for co-simulation.
Relevant answer
Answer
gooooz!
  • asked a question related to Simulink
Question
1 answer
I've made a simple simulation on Simulink consisting on a PV panel, dc-dc converter, resistive load and a function block acting as a MPPT running the code for grey wolf algortihm
When I increase the solar radiance, the current from the panel (2nd graph) starts fluctuating. When i decrease the the solar radiance, the voltage from the panel (4th graph) starts to fluctuate. Further more, if the change the value of the load resistor to 100 ohms from 10 ohms, both the current and voltage goes crazy.
I have no idea what is causing this and was hoping someone could point out my mistake. I have attached the pictures below along with the simulink file. I am willing to provide more information if needed.
Relevant answer
Answer
You need to optimize your duty cycle parameters appropriately. You can refer to this paper:
  • asked a question related to Simulink
Question
1 answer
How do I extract transient stability post-fault response data from IEEE 16 Bus power system Simulink model for classification
Relevant answer
Answer
  1. bernard.schaffler01@gmail.com. I am not associated with Queensland University of Technology. They expelled me without notice when the professor retired. I am looking for a willing university to accept me.
  • asked a question related to Simulink
Question
2 answers
I'm running a real-time model with Simulink/dSPACE DS1104. I have to make it first in MATLAB Simulink, compile it to C and download it on PCI( dSPACE 1104).
1- My sample time is 1.6e-5 s and I want to feed an RNN block with 2000 data (32 ms) via Buffer block. But I get an overrun error. I'm wondering what's the maximum available data that the RNN block can receive in this situation and how I can increase it.
2- My alternative solution is to make the problem simpler. Where a Buffer block with 64 data is enough. here the RNN block sample time is (T_r = 64*1.6e-5). but again I'm getting overrun error and I guess T_r is not enough for RNN block operation. If it's the reason how I can give the RNN block more time and skip some data? For example, receive receives data [1:64], calculate them in 9*T_r, skip [65:640] and again receive [641:704]?
Relevant answer
Answer
The overrun error usually occurs when your real-time model cannot execute a particular task or function within the specified sample time. The issue might be that the computations required by your Recurrent Neural Network (RNN) block exceed the processing time that is available per sample.
Here are a few suggestions to overcome the overrun issue:
  1. Simplify the Model: As you have already considered, simplifying the model can help reduce the computational burden and prevent overrun errors. Reducing the amount of data fed to the RNN block is one way to do this.
  2. Increase Sample Time: Another approach is to increase the sample time, giving more time for each operation to complete. However, increasing the sample time might decrease the accuracy of your simulation or even make your control system infeasible, depending on the dynamics of your system.
  3. Parallel Computing: If possible, try to use parallel computing. This can significantly reduce the time it takes to process your data. However, remember that not all algorithms and operations can be easily parallelized.
  4. Optimize Code Generation: It might be helpful to optimize the automatically generated code for complex systems. Some parts of your model might be translated into inefficient code, slowing the execution. There are various techniques to optimize the generated C code, for example, using Embedded Coder from MathWorks.
  5. Hardware Upgrade: If nothing else helps, you might need to consider upgrading your hardware. More powerful CPUs or GPUs can perform computations faster, reducing the likelihood of overrun errors.
Concerning the second part of your question, giving a block "more time" in a real-time system is generally impossible. In a real-time system, all operations are supposed to be completed within the specified time frame (the sample time). Therefore, if your RNN block needs more time than is available, you might have to consider one of the abovementioned options.
If your goal is to process a certain set of data and then skip a number of subsequent data, one way to implement this would be to use a counter inside your model that increments at each sample. You can then use a Switch block to decide whether to process or skip the current data based on the counter's value. Please note that this is not a common real-time control system strategy and might not apply in your situation. It also would not resolve the issue if your RNN block cannot process the data within the available sample time.
  • asked a question related to Simulink
Question
3 answers
I am trying to simulate BTMS based on immersion cooling system by using the software Matlab Simulink but until now I did not get the correct process neither the good results.
What do you think please ? For this type of system , it is oky to use 1D simulation ?
Moreover , if you have any sources that can help me on my simulation ,I will be so gratiful .
Thank you,
Sara
Relevant answer
Answer
Simulating a BTMS (Battery Thermal Management System) based on immersion cooling using Matlab Simulink is a feasible approach. However, achieving accurate results depends on various factors, including the model's complexity, input parameters, and system dynamics. It's essential to ensure that your model accurately represents the physical behavior of the immersion cooling system.
Regarding the use of 1D simulation for this type of system, it can be a suitable approach depending on the level of detail and accuracy required. 1D simulation simplifies the system by considering average values and assumes uniform behavior along the cooling channels. If the immersion cooling system exhibits significant variations in temperature and fluid flow, a more detailed 2D or 3D simulation might be necessary. It ultimately depends on the specific characteristics of your system and the level of accuracy you aim to achieve.
To improve your simulation, consider the following steps:
1. Review your model: Double-check the equations, boundary conditions, and parameters used in your Simulink model. Ensure that they accurately represent the physical behavior of the immersion cooling system.
2. Validate and calibrate your model: Compare your simulation results with experimental data or established models for similar systems. This validation process will help you identify any discrepancies and fine-tune your model accordingly.
3. Refine the parameters: Pay attention to the thermal properties of the immersed components, cooling fluid, and their interactions. Accurate characterization of these parameters is crucial for obtaining realistic results.
4. Consider transient effects: Depending on your application, it may be necessary to account for transient effects, such as startup and shutdown periods or changes in cooling fluid properties over time. Incorporating these dynamics into your simulation can provide a more accurate representation of the system's behavior.
As for additional sources to assist you in your simulation, consider the following:
- Research papers: Look for academic papers or publications that discuss BTMS and immersion cooling systems. These sources often provide valuable insights into the modeling and simulation approaches used by other researchers.
- Technical articles and textbooks: Check for technical articles and textbooks on battery thermal management or immersion cooling systems. They can provide theoretical background, simulation methodologies, and practical guidance.
- Online forums and communities: Participate in forums or online communities related to thermal management, battery systems, or Matlab Simulink. Engaging with experts and fellow researchers can provide valuable advice, tips, and resources.
Remember to properly cite and credit any sources you use in your research. Good luck with your simulation, and I hope you achieve accurate and meaningful results for your BTMS based on immersion cooling system.
  • asked a question related to Simulink
Question
2 answers
Hello. I am trying to implement space vector pwm control for permanent magnet motor. In my work the permanent magnet motor is represented by two 3d look up table based flux maps. I have generated necessary switching signals for the universal bridge block which works as an inverter. My plan is to measure the three phase voltages with three phase V-I measurement block and then use park transformation to convert the abc voltage to d-q voltage values which after some mathematical operation will be inputs to the look up tables. However, I am facing two issues.
(1) I can not connect the output of the three phase VI measurement to a multiplexer through which I can connect the three phase voltages to the abc to dq0 block (as highlighted in the attached image). Is there any converter block required so that they can be connected?
(2) I need to measure the phase voltages (phase to ground). However, in my model there is ground connection. Will I be able to measure the phase voltage?
Relevant answer
Answer
Better, you can directly give it to abc from Vabc without demux.
  • asked a question related to Simulink
Question
2 answers
Hi everyone,
I want to use the Casadi optimization package for my NLMPC controller in Matlab/Simulink.
I read the examples of https://web.casadi.org/ site, but I can't modify them for my problem.
I want to use Casadi for the tacking problem, so I will have a time-varying cost function and I have time-varying constraints as well.
All the examples which I saw aren't included the time-varying cost function or time-varying constraints.
I would be grateful if anyone can help me.
Regards,
Hossein.
Relevant answer
Answer
Thank you so much for your kind response, Dear Mostak.
After some deeper searches, I could find a good example in the Casadi blog which has implemented the Casadi for optimal control of the Vanderpol system. You can catch it up from the following link:
I could modify it for my problem (Nonlinear Model predictive control of a Wheeled Mobile Robot), but the tracking performance is not good as expected from an MPC controller. The tracking performance is sensitive to the cost function weighting factors and based I my knowledge the MPC weighting factors tunning is straightforward and should not be a challenging task.
Maybe I make mistakes in modifying the Simulink source file, but I checked the Simulink file over and over.
Moreover, I tried to convert the simulation file of the following code to the Simulink file and call the Casadi using the s-function, I did it but the simulation results is wrong.
Any positive experience in converting these examples to the Simulink file could help me.
Regards,
Hossein.
  • asked a question related to Simulink
Question
5 answers
I am trying to simulate the PV module model with varying irradiation (after considering the beam, diffuse and reflected). I have modeled the the PV module using the mathematical equations in Simulink and managed to get the P-V & I-V curves for constant values. But I get error when I input a signal. If anyone know how do this to kindly assist.
  • asked a question related to Simulink
Question
1 answer
I'm trying to understand how the Belbic system works but i'm having some problems. The plant can track my deisred rerence but i can not see any learning dynamic
Relevant answer
Answer
ciao Francesco,
I'm not an expert on this topic, but I read something about it.
To observe the learning dynamics of the Belbic system in MATLAB/Simulink, you can use various techniques to analyze and visualize the behavior of the system over time.
Plotting relevant variables or signals can provide insights into the learning dynamics. For example, you can plot the error signal (the difference between the desired reference and the output of the plant) over time to observe how it evolves during the learning process. You can also plot the parameters of the Belbic controller over time to see if they converge or adapt.
Define performance metrics that quantify the system's performance and learning progress. For instance, you can calculate the mean squared error (MSE) between the desired reference and the plant output and monitor how it changes over time. By tracking the performance metric, you can assess the learning dynamics and observe improvements or convergence.
If the system's behavior can be visually represented, you can create an animation in MATLAB/Simulink to visualize the learning dynamics. For example, if you are controlling a robotic arm, you can animate the arm's movements as it tracks the desired reference. This can help you observe any learning or adaptation in real-time.
MATLAB/Simulink offers various diagnostic tools for system analysis and visualization. These tools include spectrum analyzers, time scopes, and signal analyzers, which can provide insights into the system's behavior and learning dynamics. Explore the available diagnostic tools and select the ones that are most relevant to your specific application.
The specific approach to visualize the learning dynamics depends on the nature of your system and the variables involved. You can choose one or a combination of the above techniques based on your requirements and the information you want to extract from the Belbic system.
  • asked a question related to Simulink
Question
4 answers
Hello i hope Ur doin great.
i would like to share with my problem which blocked me 2 weeks. and i need a help. my project was to implement the LQR control of a bidirectional dc-dc converter for EV charging, i have done the averaged mathematical model of my converter and the design of the observer and the LQR control (correctors), when i went to the simulation in MATLAB/SIMULINK I Found that the mathematical model converge to the references but the physical model does not converge i tried everything but i did not succeed, i have based on the file below ?
i really need Ur help.
Relevant answer
Answer
DO IT ON ORCADE OR PSIM IT WILL WORK
  • asked a question related to Simulink
Question
1 answer
I share with you the simulink model of the sliding mode control technique applied to a DFIG-based wind power system
Relevant answer
Answer
Thank you for sharing this simulation
  • asked a question related to Simulink
Question
4 answers
Thank
Relevant answer
Answer
Yes, you can use a Triggered Subsystem in MATLAB Simulink to implement a low-pass filter on a PWM signal. The Triggered Subsystem allows you to execute a block of Simulink model when a specific condition is met, which in this case would be the PWM signal exceeding a certain frequency threshold.
A high-level overview of how you can design this technique in MATLAB Simulink is:
1 - Generate the PWM signal: Start by generating the PWM signal that you want to filter. You can use appropriate blocks or functions in Simulink to generate the PWM waveform based on your requirements.
2 - Measure the frequency: Use a frequency measurement block or algorithm to measure the frequency of the PWM signal. This could be achieved using techniques such as zero-crossing detection or FFT analysis.
3 - Compare with the threshold: Compare the measured frequency with the desired frequency threshold (20 kHz in your case). You can use a Comparison block or an if-else condition to make this comparison.
4 - Triggered Subsystem: Inside the Triggered Subsystem block, design the low-pass filter. You can use standard Simulink blocks, such as a Discrete-Time Integrator and a Discrete-Time Transfer Function block, to implement a simple low-pass filter. Adjust the filter parameters based on your desired cutoff frequency.
5 - Connect the subsystem: Connect the output of the Triggered Subsystem to the appropriate output in your Simulink model, so that the filtered PWM signal can be utilized for further processing or analysis.
6 - Configure the Trigger: Set up the trigger condition for the Triggered Subsystem. In this case, the trigger condition would be the comparison result from step 3.
7 - Simulate and analyze: Simulate the Simulink model and observe the filtered PWM output. Verify that the frequencies above 20 kHz are effectively attenuated while the frequencies below 20 kHz are passed through.
It's important to note that the specific details of your implementation may vary depending on your PWM signal source, sampling rate, desired filter characteristics, and any other additional requirements. Experimentation and fine-tuning may be necessary to achieve the desired filtering behavior.
By utilizing the Triggered Subsystem and appropriate filter blocks, you can implement a low-pass filter on a PWM signal in MATLAB Simulink, removing high frequencies above the specified threshold while allowing frequencies below it to pass through.
  • asked a question related to Simulink
Question
1 answer
I want to make weak grid in Simulink using PV-Battery Systems and then to apply fuzzy control logic system to stabilize the voltages and frequency of weak grid efficiently.
Suggest me any efficient model and technique to get some results.
Relevant answer
Answer
There are several models and techniques that can be used to create a weak grid in Simulink and apply fuzzy control logic system to stabilize the voltages and frequency of the grid.
One approach is to use a model-based approach, such as the one proposed by S. R. Chellali et al. in their paper "Fuzzy Logic Based Control of PV-Battery Systems for Weak Grid Stabilization". In this paper, they propose a model-based approach that uses a fuzzy logic controller to stabilize the voltage and frequency of the weak grid. The model consists of two main components: a PV-battery system, and a fuzzy logic controller. The PV-battery system is responsible for generating the power and storing it in the battery for later use. The fuzzy logic controller is responsible for controlling the power generated by the PV-battery system and stabilizing the voltage and frequency of the weak grid.
Another approach is to use a data-driven approach, such as the one proposed by M. J. Hossain et al. in their paper "Data-Driven Fuzzy Logic Control of PV-Battery Systems for Weak Grid Stabilization". In this paper, they propose a data-driven approach that uses a fuzzy logic controller to stabilize the voltage and frequency of the weak grid. The model consists of two main components: a PV-battery system, and a fuzzy logic controller. The PV-battery system is responsible for generating the power and storing it in the battery for later use. The fuzzy logic controller is responsible for controlling the power generated by the PV-battery system and stabilizing the voltage and frequency of the weak grid.
Finally, you could also use a hybrid approach, such as the one proposed by A. S. Elhassan et al. in their paper "Hybrid Fuzzy Logic Control of PV-Battery Systems for Weak Grid Stabilization". In this paper, they propose a hybrid approach that combines both model-based and data-driven approaches to stabilize the voltage and frequency of the weak grid. The model consists of two main components: a PV-battery system, and a fuzzy logic controller. The PV-battery system is responsible for generating the power and storing it in the battery for later use. The fuzzy logic controller is responsible for controlling the power generated by the PV-battery system and stabilizing the voltage and frequency of the weak grid. Whichever approach you choose, all of them can be implemented in Simulink to create a weak grid and apply fuzzy control logic system to stabilize the voltages and frequency of the grid efficiently.
  • asked a question related to Simulink
Question
1 answer
hi
looking for an article about EVs simulation in Matlab's Simulink
Relevant answer
Answer
I can provide a great option for EVs. In present system of EVs, mostly batteries are use and started using fuel cells on board for generation of electricity from H2 fuel. Trains use track and supply line above it and many more old options like TRAM, ETBs. A new technology of electrification of road network using Solar + H2 green energy facilitate EVs to have electric motor on board as per capacity and single arm pantograph as current collector from pair of overhead supply line for heavy vehicles and recharging points as per locations requirement along road for light EVs. Use of Solar energy in daytime and production of green Hydrogen as storage of energy to back in night using fuel cells as per site requirement with low capacity current carrying wires resulting no fossil fuel I.e. zero emissions to save Climate Change and remove energy crisis in world. It is going to facilitate green H2 fuel for refilling at stations like gasoline station.
Round the clock electicity or fuel is available for all sectors at very low cost.
  • asked a question related to Simulink
Question
1 answer
Hi I have question how can I model and simulate circuit breaker in Matlab/Simulink mentioned in subject with specific trip curve …
Thanks for advices …
Relevant answer
Answer
Dear Fa Saf
To model and simulate an aircraft 28VDC circuit breaker in Matlab/Simulink with a specific trip curve, you can follow these steps:
  1. Define the circuit topology and parameters of the system: This includes the circuit breaker rating, the load current, and the trip curve specifications.
  2. Create a Simulink model of the circuit: This can be done by using Simulink blocks to represent the components of the circuit, such as resistors, capacitors, and the circuit breaker.
  3. Implement the trip curve: To implement the trip curve, you can use a MATLAB Function block or a Simulink S-Function block to define the mathematical function that describes the trip curve. This function should take the circuit current as an input and output a Boolean signal that represents whether the circuit breaker should trip or not.
  4. Simulate the circuit: You can use Simulink to simulate the circuit and observe the circuit breaker's behavior under different load conditions. By varying the load current and observing the output of the trip curve function, you can verify that the circuit breaker trips when the load current exceeds the trip curve threshold.
  5. Analyze the simulation results: You can use Simulink's built-in analysis tools to analyze the simulation results, such as the voltage and current waveforms, and verify that they are consistent with the expected behavior of the circuit.
Overall, modeling and simulating an aircraft 28VDC circuit breaker with a specific trip curve in Matlab/Simulink involves defining the circuit topology and parameters, creating a Simulink model, implementing the trip curve function, simulating the circuit, and analyzing the simulation results.
  • asked a question related to Simulink
Question
1 answer
Hi all,
In matlab, we are able to find many features in the control system design applications but it always requires specifying the system inputs and outputs to be able to generate its A, B, C, D matrices. However, for an autonomous microgrid, the system has no inputs and outputs which means we only have the A matrix only. How to get the A matrix ? and how could we avoid specifying those inputs/outputs while linearizing the model ?
Relevant answer
Answer
For an autonomous microgrid, the system does not have any external input or output variables as it is a self-contained system that operates independently. To obtain the state-space model for the microgrid, you need to determine the A matrix, which describes the behavior of the system in the absence of any input or output.
One approach to obtain the A matrix is to use the mathematical model of the microgrid that includes all the system components and their interactions. This mathematical model may be obtained through first-principles modeling or system identification techniques. Once the mathematical model is obtained, the A matrix can be extracted by neglecting the input and output variables.
Another approach is to use the small-signal model of the microgrid, which is a linear approximation of the system around its operating point. In this approach, you have to assume that the system is operating at a steady-state and small perturbations around this operating point can be modeled as linear. The A matrix can then be obtained by linearizing the system equations around the steady-state operating point.
To linearize the system, you can use the linearization function in MATLAB, which allows us to linearize the system without specifying the input and output variables. The function takes the system equations and the operating point as inputs and returns the A matrix.
In summary, to obtain the A matrix for an autonomous microgrid, you can either use the mathematical model or the small-signal linearized model. You can use the linearization function in MATLAB to linearize the system without specifying the input and output variables.
  • asked a question related to Simulink
Question
1 answer
I trying to design IEEE 9 bus model in MATLAB Simulink. However, after inserting values of all parameters according to the IEEE standard, the load flow analysis is not working. It shows an error with propagation speed. Can anyone help me to solve it?
Relevant answer
Answer
Time for propagation= Distance / speed(referred as speed of light)
Error is due to the speed greater than 300000 km/s causing the propagation time smaller than the sample time. Also, check the value for positive and negative sequence inductance, try with values greater than 1.
Also, take help from these links:
  • asked a question related to Simulink
Question
3 answers
Example of model predictive control based on MATLAB/Simulink. In operation, 'quadprog' function is not supported by external generated code. How to solve this problem? Or how to replace the function to achieve MPC program generalization, easy to understand students?
The object and its state space equation are known. It is expected to realize a method of MPC generalization that is easy for students to understand, and to realize hardware-in-the-loop experiment in Simulink environment.
Relevant answer
Dear, Excuse me. My expertise is health education and promotion.
Please ask this question statistics specialist or epidemiologist.
Best regards
  • asked a question related to Simulink
Question
4 answers
My research is based on: OPTIMIZATION APPLICATION ON SMART GRID FOR OPERATIONAL
PLANNING AND MINIMIZATION OF POWER LOSSES ON BOTH TRANSMISSION
AND DISTRIBUTION NETWORKS USING MATLAB/SIMULINK
How can some assist me from the basic concept of MATLAB? Simulink to get started with this work?
Relevant answer
Answer
It is hard to master all the Simulink/Matlab commands or inbuilt libraries.
Step 1 : Go through Matlab and Simulink Onramp.(will take 2 to 4 hrs)
Step 2: Watch tutorials on Coursera :" MATLAB Programming for Engineers and Scientists Specialization", or any similar video series available on youtube (take at max two days)
Step 3: Directly jump to your own specific problems, and whenever you find difficulties, just put your queries on google, Google Baba! will help you definitely.
#. MATLAB has rich community support.
Do not try to mug up all things from the tutorial, you only need to know what are the basic approaches in Matlab. HOW TO PLAY(store, recall, edit) WITH MATRIX?
If you have a good command of Matrix algebra, it is very easy to learn matlab.
BEST OF LUCK!
  • asked a question related to Simulink
Question
3 answers
I got five angles from the genetic algorithm to eliminate certain harmonics. Now how should I use these angles in Simulink for generating switching pulses? Do you have any resources including SHE PWM simulation details or any demo file?
Relevant answer
Answer
Selective Harmonic Elimination Pulse Width Modulation (SHE PWM) is a technique used in multilevel inverters to eliminate specific harmonics by manipulating the inverter's output waveform.
Here are the steps to implement a simulation of the SHE PWM technique for a single phase multilevel inverter in MATLAB SIMULINK:
Create a new SIMULINK model and add the necessary blocks for the multilevel inverter circuit.
Create a block for the reference waveform, which will be used to generate the PWM signals. The reference waveform should be a sine wave with a frequency equal to the fundamental frequency of the inverter output.
Create a block for the PWM generator, which will produce the switching signals for the inverter.
Implement an optimization algorithm to determine the optimal switching angles for each level of the inverter, based on the desired harmonic elimination.
Use the optimization algorithm to compute the optimal switching angles and store them in a lookup table.
Add a block for the lookup table, which will be used to retrieve the optimal switching angles for each cycle of the reference waveform.
Use the PWM generator block to generate the switching signals for the inverter, based on the reference waveform and the optimal switching angles from the lookup table.
Simulate the system and analyze the output waveform to verify that the desired harmonics have been eliminated.
  • asked a question related to Simulink
Question
3 answers
Dear Colleagues,
I want to ask about the reasons for obtaining always positive magnitude in dB and phase always greater than -180 in Bode plots when checking the stability by linear analysis tool in Simulink and what this indicates about the system stability?
I am grateful in advance.
Relevant answer
Answer
At first, we should keep in mind that - when discussing stability in the Bode diagram - we speak about the LOOP GAIN of a system with feedback.
When - at a certain frequency - the phase of the loop gain reaches -360 deg (identical to 0 deg) and the gain is still above 0 dB, the stability criterion is violated and the closed sysytem will be unstable.
Note that the above mentioned 360deg criterion assumes that the phase inversion at the summing node is included in the total phase shift (as is the case for real measurements/simulations).
However, when the minus sign at the summing node is not included (may be the case for some calculations) the "critical" phase is at -180deg.
  • asked a question related to Simulink
Question
4 answers
How to calculate and design LCL filter for harmonic reduction in matlab simulink?
Relevant answer
Initially, we need to design the circuit components and draw the circuit. You may use any software like proteus for this purpose. Then, open the simulink in matlab and select the components as it is in your circuit design. The specifications also need to be given for each component. Finally, run the design to get output.
  • asked a question related to Simulink
Question
6 answers
Hello, I have used multiple PID/PI/PD controllers in my model. The controllers are really difficult to tune or autotune individually. I would appreciate it if you could help me find a better way to tune in MATLAB/Simulink instead of using the auto tuning option.
Relevant answer
Answer
I agree with @ Khayreddine Saudi. The simplest thing to do in this case is to develop a PSO algorithm in MATLAB and then use it to determine the optimal values of the Controllers' Gains.
  • asked a question related to Simulink
Question
1 answer
Hello, I need a model to simulate the electrolysis process using solar panels. Can you help me?
Thank you
Relevant answer
Answer
ssc_electrolyzer - use this command in MATLAB. it will open the model in SIMULINK.
  • asked a question related to Simulink
Question
4 answers
I am currently working on my undergraduate thesis which involves the "Non-Linear Neural Control of a Quadratic Tank Process with Delays using Internal Model Control". I have obtained the mathematical models for the plant under minimum phase and non-minimum phase operating conditions. The transfer function of the plant is a 2x2 transfer function matrix.
However, as a beginner, I am quite confused about the next step to take towards representing the built models in MATLAB & SIMULINK, obtaining data from the built models in MATLAB&SIMULINK, the algorithms to use to train the neural networks for modeling the plant, and the controller in the IMC structure, and how to validate the performance of the neural network algorithms generally.
I will appreciate any help or pointers to help me resolve my dilemma, Thank you!
Relevant answer
Answer
Similoluwa Okunowo Decoupling is a control approach for breaking down the dynamics of a multi-input, multi-output (MIMO) system into smaller single-input, single-output (SISO) subsystems. This can make it easier to develop a controller for the system and increase overall system performance.
Decoupling can be achieved by the use of a technology known as "decoupling control." This entails utilizing a controller to cancel out the connection between the system's various inputs and outputs.
Internal Model Control (IMC) is a standard way for constructing a decoupling controller. The IMC technique creates a controller by using a mathematical model of the plant to cancel out the connection between distinct inputs and outputs.
To begin incorporating IMC in your system, you must first identify a mathematical model of the plant. System identification techniques, such as frequency response or system identification software, can be used to accomplish this. Once you've created a plant model, you can use it to create a controller that can cancel out the coupling between multiple inputs and outputs.
The particular procedures for designing the IMC controller may vary depending on the dynamics of the plant and the required controller performance, but in general, they will include:
1. Discover the plant transfer function.
2. Find the best transfer function.
3. Discover the controller transfer function.
4. To produce the closed-loop transfer function, combine the plant and controller transfer functions.
5. To get the required performance, fine-tune the controller settings.
It is crucial to note that decoupling control is not always the optimal answer for all systems, and the trade-offs between decoupling and other control techniques such as robustness, noise tolerance, and control performance must be considered.
  • asked a question related to Simulink
Question
6 answers
Hello everyone,
I am currently working on energy management in micro grids using agents. I have already implemented my testbed under matlab/simulink, and now I am working with jade.
I need please your suggestions concerning the connection between simulink and jade. I had a look at Macsimjx tool, however it requires Jade version 3.6.1, can anyone provide me with a link to download this version? or any other suggestion to help me with the connection?
Thank you very much
Relevant answer
Answer
I got this package from one of my friends in 2021, so I uploaded it so everyone could use it. https://github.com/kalhansb/jade-3.6.1
  • asked a question related to Simulink
Question
1 answer
What all inputs and outputs have to be fed into the input and output of this block?
I have an input sine signal, an output from quantizer and an output from zero order hold in a sigma delta ADC.
Relevant answer
An ADC testbench in Simulink is a simulation environment that allows you to test and validate the performance of an Analog-to-Digital Converter (ADC) using simulated input signals. A typical ADC testbench in Simulink includes the following components:
  1. ADC block: This is the main component of the testbench, and it represents the ADC that you want to test. The ADC block typically converts an analog input signal to a digital output signal.
  2. Input signal generator: This block generates the input signal that will be applied to the ADC. The input signal generator can be configured to generate various signals such as sine wave, square wave, etc.
  3. Error detector: This block compares the digital output signal of the ADC with the expected output signal and calculates the error between the two signals.
  4. Scope: This block is used to display the input signal, the output signal, and the error signal. The scope can be configured to display the signals in different formats, such as time domain, frequency domain, etc.
  5. Measurement blocks: These blocks are used to measure various performance parameters of the ADC, such as resolution, dynamic range, signal-to-noise ratio, etc.
  6. Model Configuration Parameters: In this block, you can configure the ADC parameters, such as the sampling rate, quantization level, etc.
The basic idea of the ADC testbench is to apply a known input signal to the ADC and compare the output signal with the expected output signal. The difference between the two signals is called the error signal. By analyzing the error signal, you can evaluate the performance of the ADC and identify any issues or deficiencies.
The testbench can be run in several ways, either by providing a continuous signal and measuring the output or by providing different test cases to the ADC and analyzing the output for each test case.
Remember that the Simulink version you are using might not have the ADC block pre-installed, so you might need to add it to the library or use a third-party library for the ADC block.
  • asked a question related to Simulink
Question
1 answer
i will train neural network off line with dataset ,the performance is very good, but when i use the neural network block in model Simulink don't give better results, the type of solver and the does affect in the results ? note that the model Simulink works in discrete time
Relevant answer
Answer
Hi Rehouma Ridha
you leave a series of items open, which will make it hard to impossible to give you a detailed answer (type of problem, type of neural network, size of training data, size of validation data, etc. ... )
All together what you describe seems to be the classical situation, where the network (or any other machine learning system) has adapted to the training data, thus generating a low error during training, but performs bad on other data, having a bad generalization.
A possible cause might be, that the network is doing "overfitting", or "learning by heart".
A second possible cause, is that your training data is not representative for the application (the one you use in Simulink).
Here are some questions that might lead you to a solution:
Have you tried to use a smaller neural network? less hidden neurons, thus less weights, thus fewer parameters to learn by heart?
Have you divided your data into an explicit training-data-set and an explicit validation-data-set?
What happens to the performance of the network on the validation-data-set during training?
Have you thought about cross-validation?
I hope some of these thoughts will help you.
Feel free to ask more detailed questions, and/or get in direct contact.
Regards
Nils Goerke
  • asked a question related to Simulink
Question
2 answers
I am working on the analytic signal concept for observing the frequency variation in the faulted phase current waveform in MATLAB/Simulink model. In MATLAB/Simulink model, I have used analytic signal block and hilbert's transform method to calculate the real and imaginary components of the faulted phase current. After that I have used the data of real and imaginary components of the faulted phase current to calculate the magnitude, phase, and instantaneous frequency. When I plotted the curve between the instantaneous frequency variation vs time for the faulted phase current, I observed that the frequency variation is negative in the curve of instantaneous frequency vs time for the faulted phase current. Why it is so ?
Relevant answer
Answer
Siddharth Kamila The analytic signal is a complex-valued signal created by using the Hilbert transform on a real-valued signal. The analytic signal is defined as x a(t) = x(t) + jx h(t), where x(t) is the original real-valued signal and x h(t) is x h(t) (t). x r(t) = (x(t) + x h(t))/2 and x i(t) = (x(t) - x h(t))/2j are the real and imaginary components of the analytic signal, respectively. The magnitude of the analytic signal is given by |x a(t)| = sqrt[x r(t)2 + x i(t)2], the phase is supplied by phi(t) = atan(x i(t)/x r(t)), and the instantaneous frequency is given by f(t) = (1/2pi) * d(phi(t))/dt.
In general, the analytic signal has the same frequency as the original real-valued signal. If the original real-valued signal has a non-zero mean value, the frequency of the analytic signal may deviate somewhat from that of the original real-valued signal. Furthermore, if the original real-valued signal contains a non-zero DC component, the frequency of the analytic signal may deviate somewhat from that of the original real-valued signal.
If the curve of the faulty phase current's instantaneous frequency vs time is negative, it might be owing to the presence of a non-zero DC component or a non-zero mean value in the original real-valued signal. It is also conceivable that the negative frequency change is caused by anything else in the signal, such as noise or interference.
I hope this was helpful. Please let me know if you have any more inquiries.
  • asked a question related to Simulink
Question
1 answer
I am working on the analytic signal concept for observing the frequency variation in the faulted phase current waveform in MATLAB/Simulink model. In MATLAB/Simulink model, I have used analytic signal block and hilbert's transform method to calculate the real and imaginary components of the faulted phase current. After that I have used the data for real and imaginary components of the faulted phase current to calculate the magnitude, phase, and instantaneous frequency. When I plotted the curve between the instantaneous frequency variation vs time for the faulted phase current, I observed that there are high frequency spikes in the curve. What can be the reason and what is this phenomena called ?
Relevant answer
Answer
Siddharth Kamila The high-frequency spikes in the graph of instantaneous frequency versus time might be caused by noise or interference in the faulty phase current signal. This can happen if the signal is being monitored in a noisy environment or if it is being interfered with by other signals.
Applying a low pass filter to the signal before applying the analytic signal block and Hilbert transform is one technique to limit the influence of noise on the instantaneous frequency computation. This can assist in smoothing out high-frequency spikes and reducing their influence on the computed instantaneous frequency.
This is commonly known as "noise contamination" or "interference." It might be difficult to remove all noise and interference from a signal, but there are several strategies that can be employed to reduce their influence on the measurement.
  • asked a question related to Simulink
Question
8 answers
Hi All,
I'm working on a Matlab-Simulink project related to PV arrays. The Simulink model contains more than 50 modules connected in series, due to which the simulation process takes a lot of time to complete.
Any suggestion to increase speed?
Any help is highly appreciated.
Relevant answer
Answer
You may increase the sample time (Ts) if you are using Discrete state. This may affect the simulation precision (Tradeoff).
Also, try to build the model in one Matlab version. Opening the model that built in one or more different matlab versions may slow down the Matlab execution speed.
  • asked a question related to Simulink
Question
7 answers
I have simulated a DC-DC converter with a switching frequency of 10 kHz. I need to obtain the averaged values of the measured signals like capacitor voltage and inductor current by filtering the switching measurements. I've tried using the Simulink "Mean" block with a frequency of 10kHz, but as can be seen in the following picture, it does not result in the averaged signal, which should be a straight dc signal(the red curve) as the converter is in steady state. Can you provide a reference that introduces a systematic way to obtain the average value of a switching waveform?
Relevant answer
Answer
You can use a real pole with the following transfer function:
H(s)=1/( 1 + s/w0) )
where w0=2*pi*f0, and make f0 = ( 5~10)*10 kHz
If the "Mean" is a real pole (low pass filter), set the frequency to 50 ~ 100 kHz.
Good luck!
  • asked a question related to Simulink
Question
5 answers
How can I make a connection between FPGA and Simulink?
I want to use FPGA-In-the-Loop (FIL) and my purpose is performing altera board DE1-soc and Simulink.
Unfortunately I haven't found a way to do that yet if it's even possible.
Please leave any suggestions.
Best regards
Relevant answer
Answer
It is so easy, i have work in it before. Just follow the steps that written in Matlab documents.
  • asked a question related to Simulink
Question
4 answers
I am trying to model SMA in Simulink (MATLAB). can anyone here help me to model SMA?
Relevant answer
Answer
I need a reference paper to model a SMA wire in SIMULINK.
  • asked a question related to Simulink
Question
3 answers
A mathematically modeled one. Thanks.
  • asked a question related to Simulink
Question
2 answers
I have created simple QPSK model in Simulink using the different blocks of, QPSK mod and demod, AWGN channel and raised cosine tx and rx filter. Firstly I used the random integer in simulink it works perfectly. But, now I am calling the signal from workspace using the signal from workspace block and I am receiving the 50 % bit error rate. It as giving an error inconsistent sample time does this impact they BER level or not. If anyone face this kind of issue in Simulink, and resolved it please help me.
Thanks
Relevant answer
Answer
Hello.
The URL will give you more information
  • asked a question related to Simulink
Question
2 answers
I was wondering if anyone has experince in tranining a neural network in simulink. I tried a couple of methods, they work in offline, however do not work well with the simulink. Any advice is much appreciated. Thank you
Relevant answer
Answer
It is recommended to check the quality of data
  • asked a question related to Simulink
Question
6 answers
I am trying to simulate a Perturb and Observe and Incremental Conductance MPPT algorithm in Simulink for an PV array.
However I am maxing up the PWM duty cycle to maximum possible value of duty cycle (i.e. 85%). If I manually set the duty cycle using pulse generator I get maximum power between 30% to 35% but in my simulation it does directly to 85%.
The same algorithm is working properly on physical hardware but not on Simulink.
Relevant answer
Answer
Hi,
The duty cycle value of PWM depends on the load condition optimization with a suitable design of the PV panels size to acquire the maximum power.
  • asked a question related to Simulink
Question
1 answer
The following two blocks cannot be connected in series:
Block 1: 'A_stator: Asynchronous Machine pu Units'
Block 2: 'phase_A: Three-Phase Series RLC Load'
The first block, modeled as a current source, cannot be connected in series with the inductive element of the second block.
Add a high-value resistance in parallel with one of the two block.
Relevant answer
Answer
Add a very high resistor (say 1e12 ohm) in parallel with load.
  • asked a question related to Simulink
Question
2 answers
I am trying to use hydrogen produced from the Alkaline electrolyzer in production of Green Ammonia. I have researched online and found most of the ammonia synthesis are done in Aspen plus or HYSYS or dwsim or similar like that.
I am trying to make Ammonia synthesis model in MATLAB but I am having problem in here. Originally I am not the chemical engineering student, so I don't know much of dynamic mass and energy balance. Is there a good resource which I can use for modelling Ammonia synthesis in MATLAB?
Alkaline electrolyzer model is made on MATLAB simulink, so I am trying to make Ammonia synthesis model on MATLAB too.
Please help me in here if you know something.
Relevant answer
Answer
I'm also not from the chemical engineering. However, I know some fundamental principles (i.e., Conservation of Mass, Darcy's law, Fick's laws, Fourier's law) related to the chemical processes because I searched and read a lot. There is no shortcut unless you have a personalized one-on-one teacher. Start by extracting the knowledge from this article:
You are advised to derive the mathematical model first before implementing it in MATLAB/Simulink.
  • asked a question related to Simulink
Question
2 answers
In MATLAB, I'm attempting to transform my model from continuous state space to discrete state space. The error occurred is "Matrix is Singular to working precision." Please, someone assist me.
A =[0 1.0000 0 0;
51.6923 0 0 0.0221;
0 0 0 1.0000;
-51.6923 0 0 -0.5361]
B =[0;
-0.3412;
0;
8.2597]
Q=[1 0 0 0;
0 1 0 0;
0 0 1 0;
0 0 0 1]
C=[1 0 0 0;
0 0 1 0]
D=[0;0]
R=1;
K=lqr(A,B, Q, R)
q1_int=0.01;
q1_dot_int=0;
q2_int=0;
q2_dot_int=0.01;
%converting our continuous state space model to discrete-time
fs=20;
T=1/fs;
Ad=expm(A*T)
Bd=(Ad-eye(4))/A*B
Relevant answer
Answer
Hi,
First, you can use pseudo inverse instead your singular matrix inverse.
Second, if the matrix is real symmetric, one might approach such cases by orthogonal diagonalization.
Also, take a look at the links.
Best regards
  • asked a question related to Simulink
Question
4 answers
I would like to perform a tolerance analysis of a CLLC topology using matlab simulink. But the main constraint is the simulation speed. It takes almost 20mins to perform one simulation . The switching frequency of the model is 200KHz. The simulation step size is 1e-8. I am currently using the circuit simulation model. i would like to perform some 2000 simulations using monte carlo approach. This can cost me more time. Is there any better solution available?
Relevant answer
Answer
The easiest tolerance analysis, of which I've used, is Micro-Cap, a SPICE program. Micro-Cap can perform worst case by varying every component to the max and min levels. https://www.spectrum-soft.com/download/download.shtm
  • asked a question related to Simulink
Question
2 answers
Simulink toolbox
Relevant answer
Answer
Thank you Siamak,
Is it same as neural network predictive controller, I want to control vector of two variables but it won't accept it.
  • asked a question related to Simulink
Question
2 answers
Can gams works online with matlab simulink so that optimization is done in gams and send online to simulink model ??
Relevant answer
Answer
Theoretically, it can, but you have to start with very simple one to know more about limitations.
  • asked a question related to Simulink
Question
4 answers
  1. hello every one i Need help for modeling Electric véhicule with Matlab and Simulink using PMSM motor and dc/ac Converter
Relevant answer
Answer
Preferably, create an account for Simulink, and then you can search for an examples
  • asked a question related to Simulink
Question
1 answer
I want to have a normal distribution of PV or Slack bus voltages in order to calculate the mean and the variance... The results of the simulation always give a constant value for the slack and PV bus as the voltage have to be known and predefined.
Relevant answer
Answer
No, best way is to use POWER WORLD SIMULATOR. This software is very easy. You can calculate all the variables of PV BUS and slack bus.
  • asked a question related to Simulink
Question
1 answer
Dear respected
I would like to implement Automatic Switch between two PV panel Depending on output voltage (Exactly I mean depending on the shading ) to change connection form series to parallel or from parallel to series .... I implement it hardware by using two relay but in Simulink I can not do it
so how I can implement below image as MATLAB Simulink ?
kindly any one can help ?
Relevant answer
Answer
And very is "below image"?
  • asked a question related to Simulink
Question
1 answer
hello,
I'm trying to plot dissipated power of suspension damper Vs frequency plot from 2-dof Quarter car model in MATLAB Simulink. I'm attaching the image of plot can any one help me to get this type of plot from 2-dof Quarter car model in MATLAB Simulink. It will be be very helpful to procced my work further and i will be extremely thankful to help me.
I'm also attaching 2-dof Quarter car model in MATLAB Simulink and the article which I'm following to plot (Follow equation (30) and figure 5(A) of the article attached ). Please find the attachments and hope positive response.
Kindly help me.
Anybody Please help me. if anyone having any explanation or solution regarding above mentioned my problem kindly contact me on my mail id 20pmee08@iiitdmj.ac.in.
Relevant answer
Answer
Hello,
Anyone please help me solve above mention problem.
Thanks and regards
  • asked a question related to Simulink
Question
4 answers
I m designing a PV plant that is able to supply an off grid community with power. This error occurs when I try to simulate the model. It occurs in a MEAN block in a charge controller that I made, the controller in directly connected to the P & O algorithm.
Relevant answer
Answer
Greetings,
- you may try to reduce the time step you are using,
- Use a discrete solver.
Regards.
  • asked a question related to Simulink
Question
2 answers
Reject percentage is the percent of reject flowrate allowed to leave RO or UF membranes,
Reject % = reject flowrate/ feed flowrate x 100% = (feed flowrate - permeate flowrate)/feed flowrate x 100%
By controlling the reject valve, the pressure difference can be controlled to prevent damage to RO/UF membranes.
Relevant answer
Answer
If the Reject % of RO is a function of the state variables and the process system is controllable, then yes, the Reject % can be regulated.
  • asked a question related to Simulink
Question
3 answers
Dear All,
How can I make Matlab/Simulink exclude inter-harmonics when calculating THD value??, because its FFT tool in powergui block includes inter-harmonics in calculations.
Relevant answer
Answer
Ibrahim Htita The formula r = thd(x, fs, n) defines the sample rate, fs, and number of harmonics (including the fundamental) to be used in the THD computation. The formula r = thd(pxx, f,'psd') defines the input pxx as a one-sided power spectral density (PSD) estimate. f is a frequency vector matching to the PSD estimations in pxx.