Category: Matlab
Category Archives: Matlab
Is there a typo in the documentation for n4sid?
The documentation for n4sid contains the following code snippet. I believe the line u(k-1) = -K*y(k-2) + w(k); should read u(k-2) = -K*y(k-2) + w(k);.
N = 1000;
K = 0.5;
rng(‘default’);
w = randn(N,1);
z = zeros(N,1);
u = zeros(N,1);
y = zeros(N,1);
e = randn(N,1);
v = filter([1 0.5],[1 1.5 0.7],e);
for k = 3:N
u(k-1) = -K*y(k-2) + w(k);
u(k-1) = -K*y(k-1) + w(k);
z(k) = 1.5*z(k-1) – 0.7*z(k-2) + u(k-1) + 0.5*u(k-2);
y(k) = z(k) + 0.8*v(k);
end
dat = iddata(y, u, 1);The documentation for n4sid contains the following code snippet. I believe the line u(k-1) = -K*y(k-2) + w(k); should read u(k-2) = -K*y(k-2) + w(k);.
N = 1000;
K = 0.5;
rng(‘default’);
w = randn(N,1);
z = zeros(N,1);
u = zeros(N,1);
y = zeros(N,1);
e = randn(N,1);
v = filter([1 0.5],[1 1.5 0.7],e);
for k = 3:N
u(k-1) = -K*y(k-2) + w(k);
u(k-1) = -K*y(k-1) + w(k);
z(k) = 1.5*z(k-1) – 0.7*z(k-2) + u(k-1) + 0.5*u(k-2);
y(k) = z(k) + 0.8*v(k);
end
dat = iddata(y, u, 1); The documentation for n4sid contains the following code snippet. I believe the line u(k-1) = -K*y(k-2) + w(k); should read u(k-2) = -K*y(k-2) + w(k);.
N = 1000;
K = 0.5;
rng(‘default’);
w = randn(N,1);
z = zeros(N,1);
u = zeros(N,1);
y = zeros(N,1);
e = randn(N,1);
v = filter([1 0.5],[1 1.5 0.7],e);
for k = 3:N
u(k-1) = -K*y(k-2) + w(k);
u(k-1) = -K*y(k-1) + w(k);
z(k) = 1.5*z(k-1) – 0.7*z(k-2) + u(k-1) + 0.5*u(k-2);
y(k) = z(k) + 0.8*v(k);
end
dat = iddata(y, u, 1); documentation MATLAB Answers — New Questions
Using CPLEX with MATLAB newest version
Hello, I am trying to figure out how to use a cplex function and connect it to MATLAB. The code that I have in MATLAB calls a cplexmiqp function.
I am going to use the MIQPS_MATPOWER Mixed Integer Quadratic Program Solver for MATPOWER, from this page https://matpower.org/docs/ref/matpower6.0/miqps_cplex.html.
Now my question is, how would I connect IBM cplex to MATLAB to call such a fucntion. I am using a MAC and MATLAB R2022a. What CPLEX version is compatible?Hello, I am trying to figure out how to use a cplex function and connect it to MATLAB. The code that I have in MATLAB calls a cplexmiqp function.
I am going to use the MIQPS_MATPOWER Mixed Integer Quadratic Program Solver for MATPOWER, from this page https://matpower.org/docs/ref/matpower6.0/miqps_cplex.html.
Now my question is, how would I connect IBM cplex to MATLAB to call such a fucntion. I am using a MAC and MATLAB R2022a. What CPLEX version is compatible? Hello, I am trying to figure out how to use a cplex function and connect it to MATLAB. The code that I have in MATLAB calls a cplexmiqp function.
I am going to use the MIQPS_MATPOWER Mixed Integer Quadratic Program Solver for MATPOWER, from this page https://matpower.org/docs/ref/matpower6.0/miqps_cplex.html.
Now my question is, how would I connect IBM cplex to MATLAB to call such a fucntion. I am using a MAC and MATLAB R2022a. What CPLEX version is compatible? ibm cplex, matlab, optimization MATLAB Answers — New Questions
Why do I see huge voltage spikes at the output of a 3 phase MMC (Modular multi-level converter) in Simscape, when the number of submodules >1, but not with 1 submodule?
Dear Community,
I have a three phase bi-directional power converter modelled by the Simscape block Modular Multilevel Converter (MMC) set for full bridges. This is controlled by a sinusoidal PWM generator and includes a simple LC filter to filter the inverter’s output and help me see a sine wave at the output. The DC Source is a battery with 1000V. The reference setpoint to the PWM generator is a three phase sine wave generator multiplied with a manual gain block (= 0.565) at the moment (this open loop is intentional while I focus on building the plant model at the moment, and will move on to closed loop controller development in next stages).
My model & parameter file is attached.
In the MMC, when the number of submodules = 1 the inverter output and the filtered output waveforms are as expected. (Image below).
However, when I set number of submodules = 2 or above the inverter output (before being filtered) has huge voltage spikes. The filter manages to smoothen these spikes somewhat but I would like to understand why do the spikes show up at Nsm = 2,3, etc and not at Nsm = 1?
A zoomed in view of the phase-to-phase voltage confirms that the inverter is doing it’s job as expected, just with the addition of very high voltage spikes.
Other things I have considered/ tried:
I. Filter Design
For a considerable duration while working with Nsm = 2, I only saw the spikes with the addition of a LC filter. There were no unwanted spikes without the filter (and also no sine wave). This led me to believe that filter tuning might be the source of these voltage spikes. At the moment my filter design is choosing the cutoff frequency at the geometric mean of switching frequency (540 Hz) and output voltage frequency (50 Hz).
fc = sqrt(540*50);
LC = 1/(2*pi*Fc)^2 = 9.4e-07 ~= 1e-06
From this I have selected L = 50e-3 Henry & C = 20e-6 Farads.
This simple filter design works with the Simscape block Converter (3 Phase) but not with the Nsm > 1 for the MMC block I have selected. So I now suspect that filter is not the root cause, especially since I now know that it works with MMC as well but only for Nsm = 1.
II. PWM Generation
I have experimented with different PWM Generation techniques but have obtained similar results from PWM (1) and PWM (2)
Any ideas for the root cause of this behavior would be very helpful for me to move ahead. Thank you.Dear Community,
I have a three phase bi-directional power converter modelled by the Simscape block Modular Multilevel Converter (MMC) set for full bridges. This is controlled by a sinusoidal PWM generator and includes a simple LC filter to filter the inverter’s output and help me see a sine wave at the output. The DC Source is a battery with 1000V. The reference setpoint to the PWM generator is a three phase sine wave generator multiplied with a manual gain block (= 0.565) at the moment (this open loop is intentional while I focus on building the plant model at the moment, and will move on to closed loop controller development in next stages).
My model & parameter file is attached.
In the MMC, when the number of submodules = 1 the inverter output and the filtered output waveforms are as expected. (Image below).
However, when I set number of submodules = 2 or above the inverter output (before being filtered) has huge voltage spikes. The filter manages to smoothen these spikes somewhat but I would like to understand why do the spikes show up at Nsm = 2,3, etc and not at Nsm = 1?
A zoomed in view of the phase-to-phase voltage confirms that the inverter is doing it’s job as expected, just with the addition of very high voltage spikes.
Other things I have considered/ tried:
I. Filter Design
For a considerable duration while working with Nsm = 2, I only saw the spikes with the addition of a LC filter. There were no unwanted spikes without the filter (and also no sine wave). This led me to believe that filter tuning might be the source of these voltage spikes. At the moment my filter design is choosing the cutoff frequency at the geometric mean of switching frequency (540 Hz) and output voltage frequency (50 Hz).
fc = sqrt(540*50);
LC = 1/(2*pi*Fc)^2 = 9.4e-07 ~= 1e-06
From this I have selected L = 50e-3 Henry & C = 20e-6 Farads.
This simple filter design works with the Simscape block Converter (3 Phase) but not with the Nsm > 1 for the MMC block I have selected. So I now suspect that filter is not the root cause, especially since I now know that it works with MMC as well but only for Nsm = 1.
II. PWM Generation
I have experimented with different PWM Generation techniques but have obtained similar results from PWM (1) and PWM (2)
Any ideas for the root cause of this behavior would be very helpful for me to move ahead. Thank you. Dear Community,
I have a three phase bi-directional power converter modelled by the Simscape block Modular Multilevel Converter (MMC) set for full bridges. This is controlled by a sinusoidal PWM generator and includes a simple LC filter to filter the inverter’s output and help me see a sine wave at the output. The DC Source is a battery with 1000V. The reference setpoint to the PWM generator is a three phase sine wave generator multiplied with a manual gain block (= 0.565) at the moment (this open loop is intentional while I focus on building the plant model at the moment, and will move on to closed loop controller development in next stages).
My model & parameter file is attached.
In the MMC, when the number of submodules = 1 the inverter output and the filtered output waveforms are as expected. (Image below).
However, when I set number of submodules = 2 or above the inverter output (before being filtered) has huge voltage spikes. The filter manages to smoothen these spikes somewhat but I would like to understand why do the spikes show up at Nsm = 2,3, etc and not at Nsm = 1?
A zoomed in view of the phase-to-phase voltage confirms that the inverter is doing it’s job as expected, just with the addition of very high voltage spikes.
Other things I have considered/ tried:
I. Filter Design
For a considerable duration while working with Nsm = 2, I only saw the spikes with the addition of a LC filter. There were no unwanted spikes without the filter (and also no sine wave). This led me to believe that filter tuning might be the source of these voltage spikes. At the moment my filter design is choosing the cutoff frequency at the geometric mean of switching frequency (540 Hz) and output voltage frequency (50 Hz).
fc = sqrt(540*50);
LC = 1/(2*pi*Fc)^2 = 9.4e-07 ~= 1e-06
From this I have selected L = 50e-3 Henry & C = 20e-6 Farads.
This simple filter design works with the Simscape block Converter (3 Phase) but not with the Nsm > 1 for the MMC block I have selected. So I now suspect that filter is not the root cause, especially since I now know that it works with MMC as well but only for Nsm = 1.
II. PWM Generation
I have experimented with different PWM Generation techniques but have obtained similar results from PWM (1) and PWM (2)
Any ideas for the root cause of this behavior would be very helpful for me to move ahead. Thank you. three-phase inverter, mmc, pwm generator, spwm, full bridge converter, lc filter, voltage spikes, modular multilevel converter MATLAB Answers — New Questions
how can dameged image and restored image by harmonic function
how can dameged image and restored image by harmonic functionhow can dameged image and restored image by harmonic function how can dameged image and restored image by harmonic function harmonic function MATLAB Answers — New Questions
Problem with using Communications Toolbox to analyse a Receiver Chain
Hi,
I was wondering if anyone who is familiar with the Communication Toolbox may be able to help me in solving a problem with my simulated receiver chain? The code works, but I cannot despite playing with various parameters, get an Error Vector Magnitude (EVM) at my receiver that’s sensible. Ideally, I’m aiming for a EVM of <5% but its showing without equalisation 1700% and 135% with equalisation. The code generates digital modulation using the Communications Toolbox which are put through a transmit raised cosine filter, it then uses a simple channel model, in which I can introduce phase and attenuation, also multipaths. At the receiver I have used again, a receive raised cosine filter, then it undergoes matched filtering, symbol and carrier synchronisation (this is done for SINGLE_CARRIER_RX_CHAIN part of the code, for BPSK, QPSK, 16QAM and 64QAM), OFDM and GSMK is similar but carried out with different functions (but again doesn’t work). All this is done using the Communication Toolbox.
No matter what I try, I can not get The EVM to a sensible level. I have even tried bypassing the channel, so the generated symbols go straight to the receiver (in order to eliminate any phase/attenuation problems) and have set the phase to 2*pi and attenuation to 1 in the code, but the EVM is still just as poor.
I have attached a copy of the code, I have set the phase and attenuation to 2*pi and 1 respectively in the channel model so not to introduce any channel changes. I’m sure it is simply a problem with the Communication Toolbox functions and how I have set them up. Can anyone please shed any light on what I’m doing wrong?
Best regards,
AndyHi,
I was wondering if anyone who is familiar with the Communication Toolbox may be able to help me in solving a problem with my simulated receiver chain? The code works, but I cannot despite playing with various parameters, get an Error Vector Magnitude (EVM) at my receiver that’s sensible. Ideally, I’m aiming for a EVM of <5% but its showing without equalisation 1700% and 135% with equalisation. The code generates digital modulation using the Communications Toolbox which are put through a transmit raised cosine filter, it then uses a simple channel model, in which I can introduce phase and attenuation, also multipaths. At the receiver I have used again, a receive raised cosine filter, then it undergoes matched filtering, symbol and carrier synchronisation (this is done for SINGLE_CARRIER_RX_CHAIN part of the code, for BPSK, QPSK, 16QAM and 64QAM), OFDM and GSMK is similar but carried out with different functions (but again doesn’t work). All this is done using the Communication Toolbox.
No matter what I try, I can not get The EVM to a sensible level. I have even tried bypassing the channel, so the generated symbols go straight to the receiver (in order to eliminate any phase/attenuation problems) and have set the phase to 2*pi and attenuation to 1 in the code, but the EVM is still just as poor.
I have attached a copy of the code, I have set the phase and attenuation to 2*pi and 1 respectively in the channel model so not to introduce any channel changes. I’m sure it is simply a problem with the Communication Toolbox functions and how I have set them up. Can anyone please shed any light on what I’m doing wrong?
Best regards,
Andy Hi,
I was wondering if anyone who is familiar with the Communication Toolbox may be able to help me in solving a problem with my simulated receiver chain? The code works, but I cannot despite playing with various parameters, get an Error Vector Magnitude (EVM) at my receiver that’s sensible. Ideally, I’m aiming for a EVM of <5% but its showing without equalisation 1700% and 135% with equalisation. The code generates digital modulation using the Communications Toolbox which are put through a transmit raised cosine filter, it then uses a simple channel model, in which I can introduce phase and attenuation, also multipaths. At the receiver I have used again, a receive raised cosine filter, then it undergoes matched filtering, symbol and carrier synchronisation (this is done for SINGLE_CARRIER_RX_CHAIN part of the code, for BPSK, QPSK, 16QAM and 64QAM), OFDM and GSMK is similar but carried out with different functions (but again doesn’t work). All this is done using the Communication Toolbox.
No matter what I try, I can not get The EVM to a sensible level. I have even tried bypassing the channel, so the generated symbols go straight to the receiver (in order to eliminate any phase/attenuation problems) and have set the phase to 2*pi and attenuation to 1 in the code, but the EVM is still just as poor.
I have attached a copy of the code, I have set the phase and attenuation to 2*pi and 1 respectively in the channel model so not to introduce any channel changes. I’m sure it is simply a problem with the Communication Toolbox functions and how I have set them up. Can anyone please shed any light on what I’m doing wrong?
Best regards,
Andy problem with communications toolbox MATLAB Answers — New Questions
Weighted regression without priority zone, but with finding the minimum possible value for all the differences
Dear colleagues,
I need to perform a regression. The input data is shown in Figure 1 and is also attached as an MS Excel file.
Figure 1 (Figures are shown in the end of the letter.
The equation is z = a*x^m/(y+c)^n.
The parameters of the fit are shown in Figure 2 and are also attached.
Figure 2
The output data is shown in Figure 3.
Figure 3
The individual differences in percentage are shown in Figure 4.
Figure 4
I know that by using a weighted matrix, it is possible to decrease some differences (priority zones) at the expense of increasing others. However, in this case, my goal is to estimate the minimal possible error (one border value) for all of the values. For example, in the first fit, the maximum difference is 93%. It is easy to decrease it by applying individual weight coefficients, but of course, somewhere, the difference will increase. Therefore, the question is: what method can be used to find the minimal possible difference? If this for example is 18%, it means that everywhere the difference will be smaller, and it is likely that there is no 0 % anymore. Example by hand (not real) is given in Figure 5.
Figure 5
And if we try to decrease the difference at the point with an 18% difference, this will lead to an increase in the difference somewhere above 18%. Also, if in the first fit I have a 0% or 1% difference at a given point, in the second fit, the difference at this point is likely to be close (but smaller) to 18%. And one more thing – if there is a way for doing the whole procedure, is it possible to use curve fitter app or need to use a code?Dear colleagues,
I need to perform a regression. The input data is shown in Figure 1 and is also attached as an MS Excel file.
Figure 1 (Figures are shown in the end of the letter.
The equation is z = a*x^m/(y+c)^n.
The parameters of the fit are shown in Figure 2 and are also attached.
Figure 2
The output data is shown in Figure 3.
Figure 3
The individual differences in percentage are shown in Figure 4.
Figure 4
I know that by using a weighted matrix, it is possible to decrease some differences (priority zones) at the expense of increasing others. However, in this case, my goal is to estimate the minimal possible error (one border value) for all of the values. For example, in the first fit, the maximum difference is 93%. It is easy to decrease it by applying individual weight coefficients, but of course, somewhere, the difference will increase. Therefore, the question is: what method can be used to find the minimal possible difference? If this for example is 18%, it means that everywhere the difference will be smaller, and it is likely that there is no 0 % anymore. Example by hand (not real) is given in Figure 5.
Figure 5
And if we try to decrease the difference at the point with an 18% difference, this will lead to an increase in the difference somewhere above 18%. Also, if in the first fit I have a 0% or 1% difference at a given point, in the second fit, the difference at this point is likely to be close (but smaller) to 18%. And one more thing – if there is a way for doing the whole procedure, is it possible to use curve fitter app or need to use a code? Dear colleagues,
I need to perform a regression. The input data is shown in Figure 1 and is also attached as an MS Excel file.
Figure 1 (Figures are shown in the end of the letter.
The equation is z = a*x^m/(y+c)^n.
The parameters of the fit are shown in Figure 2 and are also attached.
Figure 2
The output data is shown in Figure 3.
Figure 3
The individual differences in percentage are shown in Figure 4.
Figure 4
I know that by using a weighted matrix, it is possible to decrease some differences (priority zones) at the expense of increasing others. However, in this case, my goal is to estimate the minimal possible error (one border value) for all of the values. For example, in the first fit, the maximum difference is 93%. It is easy to decrease it by applying individual weight coefficients, but of course, somewhere, the difference will increase. Therefore, the question is: what method can be used to find the minimal possible difference? If this for example is 18%, it means that everywhere the difference will be smaller, and it is likely that there is no 0 % anymore. Example by hand (not real) is given in Figure 5.
Figure 5
And if we try to decrease the difference at the point with an 18% difference, this will lead to an increase in the difference somewhere above 18%. Also, if in the first fit I have a 0% or 1% difference at a given point, in the second fit, the difference at this point is likely to be close (but smaller) to 18%. And one more thing – if there is a way for doing the whole procedure, is it possible to use curve fitter app or need to use a code? curve fitter toolbox, weighted regression MATLAB Answers — New Questions
Matlab code for voltage regulation
Hi Everyone!
Does anybody have Matlab code for voltage regulation for the distributed generation systems using PSO/GA algorithms? If yo do then please send me on my email id(ayazmehmood88@gmail.com).
Thank youHi Everyone!
Does anybody have Matlab code for voltage regulation for the distributed generation systems using PSO/GA algorithms? If yo do then please send me on my email id(ayazmehmood88@gmail.com).
Thank you Hi Everyone!
Does anybody have Matlab code for voltage regulation for the distributed generation systems using PSO/GA algorithms? If yo do then please send me on my email id(ayazmehmood88@gmail.com).
Thank you power_electronics_control, electric power systems MATLAB Answers — New Questions
Inconsistent Hector SLAM trajectory correction
Greetings. I am having some issues regarding the Hector SLAM algorithm. I am currently trying to compare the trajectory of a tracked robot: i’m using both the data from the encoders and the SLAM algorithm to track the position of the robot. As you can see from the attached image there are quite some differences from the trajectory calculated with the encoder and the trajectory exported from the Hector SLAM. Moreover the encoder one is more consistent with the actual path of the rover than the SLAM one. As you can see the overall shape of the trajectory is the same, but the SLAM one is scaled in an odd way, and somehow rotated with respect to the encoder one. I was wondering if there was a way to make the SLAM trajectory more consistent with reality or if i am missing something in the matlab enviroment. Can someone plese enlight me about this issue? If needed, of course, i will provide further information. Thanks in advance to everyone interested.
% Load topics
topic_sys = select(bag,’Topic’,"/robo/sys");
topic_data_sys = readMessages(topic_sys);
topic_enc = select(bag,’Topic’,"/robo/enc");
topic_data_enc = readMessages(topic_enc);
topic_slam = select(bag,"Topic","/slam_out_pose");
topic_data_slam = readMessages(topic_slam);
topic_scan = select(bag,"Topic","/velodyne_points");
topic_data_scan = readMessages(topic_scan);
%% SLAM Trajectory – Finding
for i =1:length(topic_data_slam)
yTraj(i,1) = topic_data_slam{i,1}.Pose.Position.X ;
xTraj(i,1) = -topic_data_slam{i,1}.Pose.Position.Y ;
end
xTraj = xTraj – xTraj(1,1);
yTraj = yTraj – yTraj(1,1);Greetings. I am having some issues regarding the Hector SLAM algorithm. I am currently trying to compare the trajectory of a tracked robot: i’m using both the data from the encoders and the SLAM algorithm to track the position of the robot. As you can see from the attached image there are quite some differences from the trajectory calculated with the encoder and the trajectory exported from the Hector SLAM. Moreover the encoder one is more consistent with the actual path of the rover than the SLAM one. As you can see the overall shape of the trajectory is the same, but the SLAM one is scaled in an odd way, and somehow rotated with respect to the encoder one. I was wondering if there was a way to make the SLAM trajectory more consistent with reality or if i am missing something in the matlab enviroment. Can someone plese enlight me about this issue? If needed, of course, i will provide further information. Thanks in advance to everyone interested.
% Load topics
topic_sys = select(bag,’Topic’,"/robo/sys");
topic_data_sys = readMessages(topic_sys);
topic_enc = select(bag,’Topic’,"/robo/enc");
topic_data_enc = readMessages(topic_enc);
topic_slam = select(bag,"Topic","/slam_out_pose");
topic_data_slam = readMessages(topic_slam);
topic_scan = select(bag,"Topic","/velodyne_points");
topic_data_scan = readMessages(topic_scan);
%% SLAM Trajectory – Finding
for i =1:length(topic_data_slam)
yTraj(i,1) = topic_data_slam{i,1}.Pose.Position.X ;
xTraj(i,1) = -topic_data_slam{i,1}.Pose.Position.Y ;
end
xTraj = xTraj – xTraj(1,1);
yTraj = yTraj – yTraj(1,1); Greetings. I am having some issues regarding the Hector SLAM algorithm. I am currently trying to compare the trajectory of a tracked robot: i’m using both the data from the encoders and the SLAM algorithm to track the position of the robot. As you can see from the attached image there are quite some differences from the trajectory calculated with the encoder and the trajectory exported from the Hector SLAM. Moreover the encoder one is more consistent with the actual path of the rover than the SLAM one. As you can see the overall shape of the trajectory is the same, but the SLAM one is scaled in an odd way, and somehow rotated with respect to the encoder one. I was wondering if there was a way to make the SLAM trajectory more consistent with reality or if i am missing something in the matlab enviroment. Can someone plese enlight me about this issue? If needed, of course, i will provide further information. Thanks in advance to everyone interested.
% Load topics
topic_sys = select(bag,’Topic’,"/robo/sys");
topic_data_sys = readMessages(topic_sys);
topic_enc = select(bag,’Topic’,"/robo/enc");
topic_data_enc = readMessages(topic_enc);
topic_slam = select(bag,"Topic","/slam_out_pose");
topic_data_slam = readMessages(topic_slam);
topic_scan = select(bag,"Topic","/velodyne_points");
topic_data_scan = readMessages(topic_scan);
%% SLAM Trajectory – Finding
for i =1:length(topic_data_slam)
yTraj(i,1) = topic_data_slam{i,1}.Pose.Position.X ;
xTraj(i,1) = -topic_data_slam{i,1}.Pose.Position.Y ;
end
xTraj = xTraj – xTraj(1,1);
yTraj = yTraj – yTraj(1,1); slam, trajectory reconstruction, hector slam, ros MATLAB Answers — New Questions
How do I display the full code output while running a live script?
I am a running a script that deals with long genome sequences. For debugging purposes, I want to display the full output that is presently too large for the livescript to handle. I am receiving a warning, "Warning: For increased performance, remaining outputs are not shown. Consider reducing the number of outputs.", and the rest of the output is curtailed. May I know, how I should get around this and display the full output?I am a running a script that deals with long genome sequences. For debugging purposes, I want to display the full output that is presently too large for the livescript to handle. I am receiving a warning, "Warning: For increased performance, remaining outputs are not shown. Consider reducing the number of outputs.", and the rest of the output is curtailed. May I know, how I should get around this and display the full output? I am a running a script that deals with long genome sequences. For debugging purposes, I want to display the full output that is presently too large for the livescript to handle. I am receiving a warning, "Warning: For increased performance, remaining outputs are not shown. Consider reducing the number of outputs.", and the rest of the output is curtailed. May I know, how I should get around this and display the full output? live script, mlx, display output, large output MATLAB Answers — New Questions
How to use ePWM7 to ePWM12 of F28379D using Matlab Simulink
Hi there,
My project requires 12 PWM signals. I’ve successfully generated PWM signals from ePWM1 to ePWM6 using Simulink and verified them on an oscilloscope using the external pins (P0-P5 and P6-P11) as per the pinout diagram.
I have two question,
Q1) I am able to configure, build and load remaining ePWM blocks. How can I route the output signals from (ePWM7-ePWM12) to external pins on the device?.(As there are not specified in pinout diagram)
Q2) Is it possible to disable the DAC feature of ePWM 7 & ePWM8?. I need unfilitered 12 PWM singals for my application.Hi there,
My project requires 12 PWM signals. I’ve successfully generated PWM signals from ePWM1 to ePWM6 using Simulink and verified them on an oscilloscope using the external pins (P0-P5 and P6-P11) as per the pinout diagram.
I have two question,
Q1) I am able to configure, build and load remaining ePWM blocks. How can I route the output signals from (ePWM7-ePWM12) to external pins on the device?.(As there are not specified in pinout diagram)
Q2) Is it possible to disable the DAC feature of ePWM 7 & ePWM8?. I need unfilitered 12 PWM singals for my application. Hi there,
My project requires 12 PWM signals. I’ve successfully generated PWM signals from ePWM1 to ePWM6 using Simulink and verified them on an oscilloscope using the external pins (P0-P5 and P6-P11) as per the pinout diagram.
I have two question,
Q1) I am able to configure, build and load remaining ePWM blocks. How can I route the output signals from (ePWM7-ePWM12) to external pins on the device?.(As there are not specified in pinout diagram)
Q2) Is it possible to disable the DAC feature of ePWM 7 & ePWM8?. I need unfilitered 12 PWM singals for my application. embedded coder, delfino, microcontroller MATLAB Answers — New Questions
Organic rankine cycle [ORC] dynamic response simulation
Good day everyone. I would like to ask regarding my project which is Organic Rankine cycle simulation with 3 different working fluid. I would like to know how to do dynamic response simulation on my topic. Thanks in advance :)Good day everyone. I would like to ask regarding my project which is Organic Rankine cycle simulation with 3 different working fluid. I would like to know how to do dynamic response simulation on my topic. Thanks in advance 🙂 Good day everyone. I would like to ask regarding my project which is Organic Rankine cycle simulation with 3 different working fluid. I would like to know how to do dynamic response simulation on my topic. Thanks in advance 🙂 organic rankine cycle, orc MATLAB Answers — New Questions
Illegal use of reserved keyword “end”
I am running this MATLAB code but it is giving me illegal use of keyword end, I checked the whole code and it has all brackets closed also, here is code:
%SEIQR model (equilibrium solution with time delay)
S = 2.376543 ;% Initial number of susceptible people in million
E = 2.557000 ;%Number of exposed people in million
I = 0; % Initial number of infected people
Q = 0 ;% Initial quarantined number
R = 0 ;% Initial number of recovered people
r1 = 2.5 ;% average susceptible contact number
r2 = 0.5 ;% average quarantine contact number
alpha=0.922; % infection rate in exposed people
r=0.303; % rate of infection
d1=0; % average natural death rate
d2=0.001; % average covid induced death rate
beta1=0.80; %infection rate per infected person
beta2=0.0701; % infection rate per quarantined person
gamma1= 0.01;% recovery rate in exposed people
gamma2= 0.01;% recovery rate in infected people
gamma3= 0.05;% recovery rate in quarantined people
M=1;
h = 0.01 ;% differential time interval
T = h:h:500 ;
foridx = 1:length(T)-1;
S(idx+1) = S(idx) + h*(M-alpha*S(idx)*E(idx) – d1*S(idx)) ;
E(idx+1) = E(idx) + h*(-alpha*S(idx)*E(idx) – d1*E(idx) – r*E(idx)) ;
I(idx+1) = I(idx) + h*(r*E(idx) -d2*I(idx)-d1*I(idx)-gamma2*I(idx)-beta2*I(idx)) ;
Q(idx+1) = Q(idx) + h*(beta1*E(idx) + beta2*I(idx)-d1*Q(idx)-d2*Q(idx)-gamma1*Q(idx)) ;
R(idx+1) = R(idx) + h*(gamma1*Q(idx)+gamma2*I(idx)+gamma3*E(idx)-d1*R(idx)) ;
end
clear; clc;
beta = 1.9; % contact rate per day
a1 = 0.3; % quarantine rate in exposed people
a2 = 0.2; % quarantine rate in infected people
r=0.303;
gamma1= 0.02;% recovery rate in exposed people
gamma2= 0.02;% recovery rate in infected people
gamma3= 0.09;% recovery rate in quarantined people
mu= 0.06; % natural death rate
beta1=0.8;
beta2=0.0701;
tau =14; %time delay (incubation period)
M=1;
d1 = 0.04;% death rate in infected people
d2 = 0.02;% death rate in quarantined people
ddeSEIQR = @(t,y,Z) [M-beta*y(1)*y(3)-d1*y(1) ;
(beta*y(1)*y(3))-d1*exp(-mu*tau)*Z(2,1)-r*y(2)-gamma3*y(2)-beta1*y(2) ; %Z(2,1) approximates the delay in exposed population
beta*exp(-mu*tau)*Z(2,1)-d2*y(3)-d1*y(3)-gamma2*y(3)-beta2*y(3) ;
beta1*y(2)+beta2*y(3)-d1*y(4)-d2*y(4)-gamma1*y(4) ;
gamma1*y(4)+gamma2*y(3)+gamma3*y(2)-d1*y(5)] ;
sol = dde23(ddeSEIQR,[14,1], [0.99 0 0.01 0 0] , [0 , 100]) ;%dde23 (@. . . . , tau , history ,tspan ;
figure ;
plot(sol.x,sol.y(1,:), ‘r’, LineWidth=2)
holdon
plot(sol.x,sol.y(2,:),’g’, LineWidth=2)
holdon
plot(sol.x,sol.y(3,:),Linewidth=2)
holdon
plot(sol.x ,sol.y(4,:),Linewidth=2)
holdon
plot(sol.x,sol.y(5,:),Linewidth=2)
holdoff
title(‘SEIQR at equilibrium’);
xlabel (‘time(days)’) ;
ylabel (‘steady state solution’) ;
legend (‘S’,’E’,’I’,’Q’,’R’) ;I am running this MATLAB code but it is giving me illegal use of keyword end, I checked the whole code and it has all brackets closed also, here is code:
%SEIQR model (equilibrium solution with time delay)
S = 2.376543 ;% Initial number of susceptible people in million
E = 2.557000 ;%Number of exposed people in million
I = 0; % Initial number of infected people
Q = 0 ;% Initial quarantined number
R = 0 ;% Initial number of recovered people
r1 = 2.5 ;% average susceptible contact number
r2 = 0.5 ;% average quarantine contact number
alpha=0.922; % infection rate in exposed people
r=0.303; % rate of infection
d1=0; % average natural death rate
d2=0.001; % average covid induced death rate
beta1=0.80; %infection rate per infected person
beta2=0.0701; % infection rate per quarantined person
gamma1= 0.01;% recovery rate in exposed people
gamma2= 0.01;% recovery rate in infected people
gamma3= 0.05;% recovery rate in quarantined people
M=1;
h = 0.01 ;% differential time interval
T = h:h:500 ;
foridx = 1:length(T)-1;
S(idx+1) = S(idx) + h*(M-alpha*S(idx)*E(idx) – d1*S(idx)) ;
E(idx+1) = E(idx) + h*(-alpha*S(idx)*E(idx) – d1*E(idx) – r*E(idx)) ;
I(idx+1) = I(idx) + h*(r*E(idx) -d2*I(idx)-d1*I(idx)-gamma2*I(idx)-beta2*I(idx)) ;
Q(idx+1) = Q(idx) + h*(beta1*E(idx) + beta2*I(idx)-d1*Q(idx)-d2*Q(idx)-gamma1*Q(idx)) ;
R(idx+1) = R(idx) + h*(gamma1*Q(idx)+gamma2*I(idx)+gamma3*E(idx)-d1*R(idx)) ;
end
clear; clc;
beta = 1.9; % contact rate per day
a1 = 0.3; % quarantine rate in exposed people
a2 = 0.2; % quarantine rate in infected people
r=0.303;
gamma1= 0.02;% recovery rate in exposed people
gamma2= 0.02;% recovery rate in infected people
gamma3= 0.09;% recovery rate in quarantined people
mu= 0.06; % natural death rate
beta1=0.8;
beta2=0.0701;
tau =14; %time delay (incubation period)
M=1;
d1 = 0.04;% death rate in infected people
d2 = 0.02;% death rate in quarantined people
ddeSEIQR = @(t,y,Z) [M-beta*y(1)*y(3)-d1*y(1) ;
(beta*y(1)*y(3))-d1*exp(-mu*tau)*Z(2,1)-r*y(2)-gamma3*y(2)-beta1*y(2) ; %Z(2,1) approximates the delay in exposed population
beta*exp(-mu*tau)*Z(2,1)-d2*y(3)-d1*y(3)-gamma2*y(3)-beta2*y(3) ;
beta1*y(2)+beta2*y(3)-d1*y(4)-d2*y(4)-gamma1*y(4) ;
gamma1*y(4)+gamma2*y(3)+gamma3*y(2)-d1*y(5)] ;
sol = dde23(ddeSEIQR,[14,1], [0.99 0 0.01 0 0] , [0 , 100]) ;%dde23 (@. . . . , tau , history ,tspan ;
figure ;
plot(sol.x,sol.y(1,:), ‘r’, LineWidth=2)
holdon
plot(sol.x,sol.y(2,:),’g’, LineWidth=2)
holdon
plot(sol.x,sol.y(3,:),Linewidth=2)
holdon
plot(sol.x ,sol.y(4,:),Linewidth=2)
holdon
plot(sol.x,sol.y(5,:),Linewidth=2)
holdoff
title(‘SEIQR at equilibrium’);
xlabel (‘time(days)’) ;
ylabel (‘steady state solution’) ;
legend (‘S’,’E’,’I’,’Q’,’R’) ; I am running this MATLAB code but it is giving me illegal use of keyword end, I checked the whole code and it has all brackets closed also, here is code:
%SEIQR model (equilibrium solution with time delay)
S = 2.376543 ;% Initial number of susceptible people in million
E = 2.557000 ;%Number of exposed people in million
I = 0; % Initial number of infected people
Q = 0 ;% Initial quarantined number
R = 0 ;% Initial number of recovered people
r1 = 2.5 ;% average susceptible contact number
r2 = 0.5 ;% average quarantine contact number
alpha=0.922; % infection rate in exposed people
r=0.303; % rate of infection
d1=0; % average natural death rate
d2=0.001; % average covid induced death rate
beta1=0.80; %infection rate per infected person
beta2=0.0701; % infection rate per quarantined person
gamma1= 0.01;% recovery rate in exposed people
gamma2= 0.01;% recovery rate in infected people
gamma3= 0.05;% recovery rate in quarantined people
M=1;
h = 0.01 ;% differential time interval
T = h:h:500 ;
foridx = 1:length(T)-1;
S(idx+1) = S(idx) + h*(M-alpha*S(idx)*E(idx) – d1*S(idx)) ;
E(idx+1) = E(idx) + h*(-alpha*S(idx)*E(idx) – d1*E(idx) – r*E(idx)) ;
I(idx+1) = I(idx) + h*(r*E(idx) -d2*I(idx)-d1*I(idx)-gamma2*I(idx)-beta2*I(idx)) ;
Q(idx+1) = Q(idx) + h*(beta1*E(idx) + beta2*I(idx)-d1*Q(idx)-d2*Q(idx)-gamma1*Q(idx)) ;
R(idx+1) = R(idx) + h*(gamma1*Q(idx)+gamma2*I(idx)+gamma3*E(idx)-d1*R(idx)) ;
end
clear; clc;
beta = 1.9; % contact rate per day
a1 = 0.3; % quarantine rate in exposed people
a2 = 0.2; % quarantine rate in infected people
r=0.303;
gamma1= 0.02;% recovery rate in exposed people
gamma2= 0.02;% recovery rate in infected people
gamma3= 0.09;% recovery rate in quarantined people
mu= 0.06; % natural death rate
beta1=0.8;
beta2=0.0701;
tau =14; %time delay (incubation period)
M=1;
d1 = 0.04;% death rate in infected people
d2 = 0.02;% death rate in quarantined people
ddeSEIQR = @(t,y,Z) [M-beta*y(1)*y(3)-d1*y(1) ;
(beta*y(1)*y(3))-d1*exp(-mu*tau)*Z(2,1)-r*y(2)-gamma3*y(2)-beta1*y(2) ; %Z(2,1) approximates the delay in exposed population
beta*exp(-mu*tau)*Z(2,1)-d2*y(3)-d1*y(3)-gamma2*y(3)-beta2*y(3) ;
beta1*y(2)+beta2*y(3)-d1*y(4)-d2*y(4)-gamma1*y(4) ;
gamma1*y(4)+gamma2*y(3)+gamma3*y(2)-d1*y(5)] ;
sol = dde23(ddeSEIQR,[14,1], [0.99 0 0.01 0 0] , [0 , 100]) ;%dde23 (@. . . . , tau , history ,tspan ;
figure ;
plot(sol.x,sol.y(1,:), ‘r’, LineWidth=2)
holdon
plot(sol.x,sol.y(2,:),’g’, LineWidth=2)
holdon
plot(sol.x,sol.y(3,:),Linewidth=2)
holdon
plot(sol.x ,sol.y(4,:),Linewidth=2)
holdon
plot(sol.x,sol.y(5,:),Linewidth=2)
holdoff
title(‘SEIQR at equilibrium’);
xlabel (‘time(days)’) ;
ylabel (‘steady state solution’) ;
legend (‘S’,’E’,’I’,’Q’,’R’) ; end, illegal use MATLAB Answers — New Questions
how to use fmincon to optimize a functio with more than one control vector where the control vectors used in constrains also?
I have three unknown vectors, matrices p, X, L with which I have to optimize a function norm(sp) [s is known] and these vectors are used in constraints also,
I cannot figured it out how to write p X L in one vector as in fmincon only one input vector is allowed.
Thank you so much for your helpI have three unknown vectors, matrices p, X, L with which I have to optimize a function norm(sp) [s is known] and these vectors are used in constraints also,
I cannot figured it out how to write p X L in one vector as in fmincon only one input vector is allowed.
Thank you so much for your help I have three unknown vectors, matrices p, X, L with which I have to optimize a function norm(sp) [s is known] and these vectors are used in constraints also,
I cannot figured it out how to write p X L in one vector as in fmincon only one input vector is allowed.
Thank you so much for your help fmincon, multi vector, optimization MATLAB Answers — New Questions
Could not define a data in matrix form in model workspace ( for simulation)
I had to do multiple interation of simulation and record plot for numerous set of setting
hence it was convenient to define the variables in a matrix form and run simulation but the variable are not being stored in base worspace after restart of system. and in Model workspace it si not possible to use a matrix in data.
kindly guide me in the same.I had to do multiple interation of simulation and record plot for numerous set of setting
hence it was convenient to define the variables in a matrix form and run simulation but the variable are not being stored in base worspace after restart of system. and in Model workspace it si not possible to use a matrix in data.
kindly guide me in the same. I had to do multiple interation of simulation and record plot for numerous set of setting
hence it was convenient to define the variables in a matrix form and run simulation but the variable are not being stored in base worspace after restart of system. and in Model workspace it si not possible to use a matrix in data.
kindly guide me in the same. model worksapce, 2 dimension variable, simulink MATLAB Answers — New Questions
How to create an custom Reinforcement Learning Environment + DQN agent
I want to create custom reinforcement learning environment in vehicular communication network using deep Q network agent.
How can I do this ?I want to create custom reinforcement learning environment in vehicular communication network using deep Q network agent.
How can I do this ? I want to create custom reinforcement learning environment in vehicular communication network using deep Q network agent.
How can I do this ? deep q network, vehicular communication network, deep learning MATLAB Answers — New Questions
Generating a C code DLL for an S-function with continuous states
I’m trying to generate a DLL from an S-function (via Embedded Coder) which has continous states and then call the respective functions via a C# script. I have written a tlc file and the DLL has been succesfully generated.
One of the functions generated is of the following template:
static void rt_ertODEUpdateContinuousStates(RTWSolverInfo *si, RT_MODEL_mav_dynamics0_T *const mav_dynamics0_M, real_T mav_dynamics0_U_forces_and_moments[6], real_T mav_dynamics0_Y_x[12])
However, the data type RTWSolverInfo isn’t defined anywhere. Many other functions have been called inside the function definition as well such as rtsiGetT(), rtsiGetSolverStopTime(), rtsiGetStepSize(), rtsiGetContStates() and rtsiGetSolverData() which have not been defined anywhere.
Even the step function uses a structure variable as a parameter. One of the members of that structure is a variable of data type RTWSolverInfo, which has not been defined anywhere.
Has anybody encountered this issue before? Could you show me how I can define this data type in C# or any way to work around this so I can succesfully use this DLL in C#?I’m trying to generate a DLL from an S-function (via Embedded Coder) which has continous states and then call the respective functions via a C# script. I have written a tlc file and the DLL has been succesfully generated.
One of the functions generated is of the following template:
static void rt_ertODEUpdateContinuousStates(RTWSolverInfo *si, RT_MODEL_mav_dynamics0_T *const mav_dynamics0_M, real_T mav_dynamics0_U_forces_and_moments[6], real_T mav_dynamics0_Y_x[12])
However, the data type RTWSolverInfo isn’t defined anywhere. Many other functions have been called inside the function definition as well such as rtsiGetT(), rtsiGetSolverStopTime(), rtsiGetStepSize(), rtsiGetContStates() and rtsiGetSolverData() which have not been defined anywhere.
Even the step function uses a structure variable as a parameter. One of the members of that structure is a variable of data type RTWSolverInfo, which has not been defined anywhere.
Has anybody encountered this issue before? Could you show me how I can define this data type in C# or any way to work around this so I can succesfully use this DLL in C#? I’m trying to generate a DLL from an S-function (via Embedded Coder) which has continous states and then call the respective functions via a C# script. I have written a tlc file and the DLL has been succesfully generated.
One of the functions generated is of the following template:
static void rt_ertODEUpdateContinuousStates(RTWSolverInfo *si, RT_MODEL_mav_dynamics0_T *const mav_dynamics0_M, real_T mav_dynamics0_U_forces_and_moments[6], real_T mav_dynamics0_Y_x[12])
However, the data type RTWSolverInfo isn’t defined anywhere. Many other functions have been called inside the function definition as well such as rtsiGetT(), rtsiGetSolverStopTime(), rtsiGetStepSize(), rtsiGetContStates() and rtsiGetSolverData() which have not been defined anywhere.
Even the step function uses a structure variable as a parameter. One of the members of that structure is a variable of data type RTWSolverInfo, which has not been defined anywhere.
Has anybody encountered this issue before? Could you show me how I can define this data type in C# or any way to work around this so I can succesfully use this DLL in C#? s-function, dll, rtwsolverinfo, c#, embedded coder MATLAB Answers — New Questions
Using tapped delays in the process of training an artificial neural network for the purpose of dynamic system modeling.
Hello,I’m trying to use an artificial neural network for creating a model for the system :
from what I have got so far first I should get the response of the system to an arbitrary input and use that data for training my network. after discretisation this second order diffrence equation () would describe the dynamic behaviour of system.
Now what is the method to implement this delays in my neural network? should I just give these delayed outputs and inputs of the plant as a input to my neural network or is there an easier way to achive this?Hello,I’m trying to use an artificial neural network for creating a model for the system :
from what I have got so far first I should get the response of the system to an arbitrary input and use that data for training my network. after discretisation this second order diffrence equation () would describe the dynamic behaviour of system.
Now what is the method to implement this delays in my neural network? should I just give these delayed outputs and inputs of the plant as a input to my neural network or is there an easier way to achive this? Hello,I’m trying to use an artificial neural network for creating a model for the system :
from what I have got so far first I should get the response of the system to an arbitrary input and use that data for training my network. after discretisation this second order diffrence equation () would describe the dynamic behaviour of system.
Now what is the method to implement this delays in my neural network? should I just give these delayed outputs and inputs of the plant as a input to my neural network or is there an easier way to achive this? artificial neural network, tapped delay, system identification with ann MATLAB Answers — New Questions
Closed loop control of an LSTM model plant using MPC causing an algebraic loop error
Hi there,
I am trying to use a trained RNN LSTM model as a plant of a dynamic system and want to control one of the outputs (MPW) using MPC. I have 4 inputs (including 1 manipulated and 3 measured). When I set everything in Simulink, it generates an error as below:
Here is the plant subsystem for your review:
And the main system:
It is generating an algebraic loop error since fullstate RNN prediction block is using states (At least I think the reason is that). Does this mean that I cannot use full state prediction to generate the LSTM predictions in a closed-loop control? If so, how can I let the model know the temporal dependency and dynamics of the process?
Best regards,
MostafaHi there,
I am trying to use a trained RNN LSTM model as a plant of a dynamic system and want to control one of the outputs (MPW) using MPC. I have 4 inputs (including 1 manipulated and 3 measured). When I set everything in Simulink, it generates an error as below:
Here is the plant subsystem for your review:
And the main system:
It is generating an algebraic loop error since fullstate RNN prediction block is using states (At least I think the reason is that). Does this mean that I cannot use full state prediction to generate the LSTM predictions in a closed-loop control? If so, how can I let the model know the temporal dependency and dynamics of the process?
Best regards,
Mostafa Hi there,
I am trying to use a trained RNN LSTM model as a plant of a dynamic system and want to control one of the outputs (MPW) using MPC. I have 4 inputs (including 1 manipulated and 3 measured). When I set everything in Simulink, it generates an error as below:
Here is the plant subsystem for your review:
And the main system:
It is generating an algebraic loop error since fullstate RNN prediction block is using states (At least I think the reason is that). Does this mean that I cannot use full state prediction to generate the LSTM predictions in a closed-loop control? If so, how can I let the model know the temporal dependency and dynamics of the process?
Best regards,
Mostafa mpc, algebraic loop, lstm model MATLAB Answers — New Questions
Modelling the sublimation of dry ice
I am trying to simulate the sublimation of dry ice in Simscape. In my setup, I start with 1000 mL (0.001 m³) of water and 100 g of dry ice. During sublimation, the dry ice mass decreases while the CO₂ gas mass increases at the same rate. To simulate this, I created a custom MATLAB signal to input the required mass flow over 1 second. I set the signal value to double the desired mass flow because the area under the mass flow rate vs. time graph in the Data Inspector should yield the actual injected mass M=0.5⋅time⋅(2 × desired mass)). I applied the same method for CO₂ gas and H20.
For heat transfer, I approximated the dry ice pellet as a single sphere to calculate the convective heat transfer coefficient, acknowledging this introduces a limitation as the actual heat transfer area would be larger. I determined the heat transfer coefficient using Rayleigh and Nusselt numbers and used it to estimate the heat flow rate.
The issue I am encountering is that the water temperature in the simulation is not decreasing to the same value observed during testing, and the simulated water volume in the tank is slightly more than 1000 mL. I would appreciate any advice on how to refine my simulation to better match experimental results.I am trying to simulate the sublimation of dry ice in Simscape. In my setup, I start with 1000 mL (0.001 m³) of water and 100 g of dry ice. During sublimation, the dry ice mass decreases while the CO₂ gas mass increases at the same rate. To simulate this, I created a custom MATLAB signal to input the required mass flow over 1 second. I set the signal value to double the desired mass flow because the area under the mass flow rate vs. time graph in the Data Inspector should yield the actual injected mass M=0.5⋅time⋅(2 × desired mass)). I applied the same method for CO₂ gas and H20.
For heat transfer, I approximated the dry ice pellet as a single sphere to calculate the convective heat transfer coefficient, acknowledging this introduces a limitation as the actual heat transfer area would be larger. I determined the heat transfer coefficient using Rayleigh and Nusselt numbers and used it to estimate the heat flow rate.
The issue I am encountering is that the water temperature in the simulation is not decreasing to the same value observed during testing, and the simulated water volume in the tank is slightly more than 1000 mL. I would appreciate any advice on how to refine my simulation to better match experimental results. I am trying to simulate the sublimation of dry ice in Simscape. In my setup, I start with 1000 mL (0.001 m³) of water and 100 g of dry ice. During sublimation, the dry ice mass decreases while the CO₂ gas mass increases at the same rate. To simulate this, I created a custom MATLAB signal to input the required mass flow over 1 second. I set the signal value to double the desired mass flow because the area under the mass flow rate vs. time graph in the Data Inspector should yield the actual injected mass M=0.5⋅time⋅(2 × desired mass)). I applied the same method for CO₂ gas and H20.
For heat transfer, I approximated the dry ice pellet as a single sphere to calculate the convective heat transfer coefficient, acknowledging this introduces a limitation as the actual heat transfer area would be larger. I determined the heat transfer coefficient using Rayleigh and Nusselt numbers and used it to estimate the heat flow rate.
The issue I am encountering is that the water temperature in the simulation is not decreasing to the same value observed during testing, and the simulated water volume in the tank is slightly more than 1000 mL. I would appreciate any advice on how to refine my simulation to better match experimental results. simscape, heat transfer, fluid dynamics, dry ice, thermodynamics MATLAB Answers — New Questions