Month: June 2024
Not receiving correct FSK modulated signal [N210 USRP]
I have set up two N210 USRPs to transmit/receive simple FSK modulated signals. My code is very similar to the examples in the documentation (https://se.mathworks.com/help/supportpkg/usrpradio/ug/comm.sdrutransmitter-system-object.html and https://se.mathworks.com/help/supportpkg/usrpradio/ug/comm.sdrureceiver-system-object.html) but for the different modulation approach. The two USRPs are connected to two separate computers. One runs a script to repeatedly transmit my signal while the other runs a script to repeatedly scan for a received signal, which it then demodulates and returns to the user. Unfortunately, the received and demodulated signal does not resemble the transmitted signal at all.
I have experimented with different antennas, different gains and different centre frequencies.
What could possibly be causing this?
Transmitter code:
% Message
barkerCode = [1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0]’;
message = ones(20, 1);
frame = [barkerCode; message];
% Modulation
H = comm.FSKModulator(‘ModulationOrder’, 2);
messageIQ = H(frame);
% Transmitter
center_frequency = 434e6;
gain = 30;
radio = comm.SDRuTransmitter(…
‘Platform’, ‘N200/N210/USRP2’, …
‘IPAddress’, ‘192.168.10.2’, …
‘CenterFrequency’, center_frequency, …
‘Gain’, gain);
% Transmit
fprintf(‘Transmitting now…n’)
stop = 1000;
i = 0;
while i < stop
underrun = radio(messageIQ);
if (underrun ~= 0)
fprintf(‘Iteration: %i, underrun: %in’, i, underrun);
end
i = i + 1;
end
fprintf(‘Donen’)
release(radio)
Receiver code:
% Radio
center_frequency = 434e6;
gain = 30;
radio = comm.SDRuReceiver(…
‘Platform’, ‘N200/N210/USRP2’, …
‘IPAddress’, ‘192.168.10.2’, …
‘CenterFrequency’, center_frequency, …
‘Gain’, gain);
% Demodulator
D = comm.FSKDemodulator(‘ModulationOrder’, 2);
% Receive signal
len = 0;
while len == 0
[rcvdSignal, len] = step(radio);
demodSignal = D(rcvdSignal);
end
plot(debudSignal);I have set up two N210 USRPs to transmit/receive simple FSK modulated signals. My code is very similar to the examples in the documentation (https://se.mathworks.com/help/supportpkg/usrpradio/ug/comm.sdrutransmitter-system-object.html and https://se.mathworks.com/help/supportpkg/usrpradio/ug/comm.sdrureceiver-system-object.html) but for the different modulation approach. The two USRPs are connected to two separate computers. One runs a script to repeatedly transmit my signal while the other runs a script to repeatedly scan for a received signal, which it then demodulates and returns to the user. Unfortunately, the received and demodulated signal does not resemble the transmitted signal at all.
I have experimented with different antennas, different gains and different centre frequencies.
What could possibly be causing this?
Transmitter code:
% Message
barkerCode = [1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0]’;
message = ones(20, 1);
frame = [barkerCode; message];
% Modulation
H = comm.FSKModulator(‘ModulationOrder’, 2);
messageIQ = H(frame);
% Transmitter
center_frequency = 434e6;
gain = 30;
radio = comm.SDRuTransmitter(…
‘Platform’, ‘N200/N210/USRP2’, …
‘IPAddress’, ‘192.168.10.2’, …
‘CenterFrequency’, center_frequency, …
‘Gain’, gain);
% Transmit
fprintf(‘Transmitting now…n’)
stop = 1000;
i = 0;
while i < stop
underrun = radio(messageIQ);
if (underrun ~= 0)
fprintf(‘Iteration: %i, underrun: %in’, i, underrun);
end
i = i + 1;
end
fprintf(‘Donen’)
release(radio)
Receiver code:
% Radio
center_frequency = 434e6;
gain = 30;
radio = comm.SDRuReceiver(…
‘Platform’, ‘N200/N210/USRP2’, …
‘IPAddress’, ‘192.168.10.2’, …
‘CenterFrequency’, center_frequency, …
‘Gain’, gain);
% Demodulator
D = comm.FSKDemodulator(‘ModulationOrder’, 2);
% Receive signal
len = 0;
while len == 0
[rcvdSignal, len] = step(radio);
demodSignal = D(rcvdSignal);
end
plot(debudSignal); I have set up two N210 USRPs to transmit/receive simple FSK modulated signals. My code is very similar to the examples in the documentation (https://se.mathworks.com/help/supportpkg/usrpradio/ug/comm.sdrutransmitter-system-object.html and https://se.mathworks.com/help/supportpkg/usrpradio/ug/comm.sdrureceiver-system-object.html) but for the different modulation approach. The two USRPs are connected to two separate computers. One runs a script to repeatedly transmit my signal while the other runs a script to repeatedly scan for a received signal, which it then demodulates and returns to the user. Unfortunately, the received and demodulated signal does not resemble the transmitted signal at all.
I have experimented with different antennas, different gains and different centre frequencies.
What could possibly be causing this?
Transmitter code:
% Message
barkerCode = [1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0]’;
message = ones(20, 1);
frame = [barkerCode; message];
% Modulation
H = comm.FSKModulator(‘ModulationOrder’, 2);
messageIQ = H(frame);
% Transmitter
center_frequency = 434e6;
gain = 30;
radio = comm.SDRuTransmitter(…
‘Platform’, ‘N200/N210/USRP2’, …
‘IPAddress’, ‘192.168.10.2’, …
‘CenterFrequency’, center_frequency, …
‘Gain’, gain);
% Transmit
fprintf(‘Transmitting now…n’)
stop = 1000;
i = 0;
while i < stop
underrun = radio(messageIQ);
if (underrun ~= 0)
fprintf(‘Iteration: %i, underrun: %in’, i, underrun);
end
i = i + 1;
end
fprintf(‘Donen’)
release(radio)
Receiver code:
% Radio
center_frequency = 434e6;
gain = 30;
radio = comm.SDRuReceiver(…
‘Platform’, ‘N200/N210/USRP2’, …
‘IPAddress’, ‘192.168.10.2’, …
‘CenterFrequency’, center_frequency, …
‘Gain’, gain);
% Demodulator
D = comm.FSKDemodulator(‘ModulationOrder’, 2);
% Receive signal
len = 0;
while len == 0
[rcvdSignal, len] = step(radio);
demodSignal = D(rcvdSignal);
end
plot(debudSignal); usrp, communications toolbox support package, n210 MATLAB Answers — New Questions
contour plots on a given geometry – finite element
I have some values of stretch that I need to assign to a given set of elements and then I want to show a contour plot of those values on the geometry that I get by plotting the elements through the nodes. How can I do?I have some values of stretch that I need to assign to a given set of elements and then I want to show a contour plot of those values on the geometry that I get by plotting the elements through the nodes. How can I do? I have some values of stretch that I need to assign to a given set of elements and then I want to show a contour plot of those values on the geometry that I get by plotting the elements through the nodes. How can I do? contour plot, plotting, finite element, stretch MATLAB Answers — New Questions
How to solve a system of nonlinear differential equation that follows some pattern
I have a system of nonlinear differential equation that follows some patter, for example . I could solve for some small . I want to solve it for . Is there any way to do that or we can tonly type manually. Is it possible to use loops in function environment to solve such cases? Thank you!I have a system of nonlinear differential equation that follows some patter, for example . I could solve for some small . I want to solve it for . Is there any way to do that or we can tonly type manually. Is it possible to use loops in function environment to solve such cases? Thank you! I have a system of nonlinear differential equation that follows some patter, for example . I could solve for some small . I want to solve it for . Is there any way to do that or we can tonly type manually. Is it possible to use loops in function environment to solve such cases? Thank you! differential equations MATLAB Answers — New Questions
logic app – convert file functionality in one drive business connector
When I convert pdf or pptx to jpg format using convert file in one drive business connector in a logic app only first slide or the first page is converted in to jpg file.
The functionality should be like converting all the pages or slides in pdf or pptx in array of images and stored in folder named after the filename just like any 3rd party connector.
Could anyone please help me to overcome above issue and generate desired output.
When I convert pdf or pptx to jpg format using convert file in one drive business connector in a logic app only first slide or the first page is converted in to jpg file.
The functionality should be like converting all the pages or slides in pdf or pptx in array of images and stored in folder named after the filename just like any 3rd party connector.
Could anyone please help me to overcome above issue and generate desired output. Read More
How To Solve Unable to Start Intuit Update Service Error after latest update?
I’m encountering the ‘Unable to Start Intuit Update Service’ error. How can I resolve this issue quickly?
I’m encountering the ‘Unable to Start Intuit Update Service’ error. How can I resolve this issue quickly? Read More
File Open In Com Surrogate
I’ve looked into this issue, but couldn’t find a definitive solution. Often, when attempting to delete a file or folder, I encounter the ‘action cannot be completed because the file is open in COM Surrogate’ error message. My go-to solutions have been either shutting down COM Surrogate in Task Manager or simply rebooting the system.
Is there a permanent fix available for this recurring problem?
I’ve looked into this issue, but couldn’t find a definitive solution. Often, when attempting to delete a file or folder, I encounter the ‘action cannot be completed because the file is open in COM Surrogate’ error message. My go-to solutions have been either shutting down COM Surrogate in Task Manager or simply rebooting the system. Is there a permanent fix available for this recurring problem? Read More
Google Drive Not Showing in System Tray?
So, it’s gone! It’s marked as ‘On’ in other system tray icons in taskbar settings – have switched it off, restarted and turned it on again. No joy, it just refuses to show in the taskbar. It was there a couple of days ago and working fine. Ideas anyone?
Windows Build/Version Win 11 Pro 23H2
So, it’s gone! It’s marked as ‘On’ in other system tray icons in taskbar settings – have switched it off, restarted and turned it on again. No joy, it just refuses to show in the taskbar. It was there a couple of days ago and working fine. Ideas anyone? Windows Build/Version Win 11 Pro 23H2 Read More
How to Eradicate Error initializing qbpos application log after new update?
Encountering ‘Error initializing qbpos application log’ while using qbpos. Need assistance fixing this issue ASAP. What steps can I take to troubleshoot and resolve this problem efficiently?
Encountering ‘Error initializing qbpos application log’ while using qbpos. Need assistance fixing this issue ASAP. What steps can I take to troubleshoot and resolve this problem efficiently? Read More
How To Resolve This Company File Needs to be Updated Error after windows update?
I’m getting a ‘This Company File Needs to be Updated’ message when trying to open my file. How can I fix this issue and successfully update my company file?
I’m getting a ‘This Company File Needs to be Updated’ message when trying to open my file. How can I fix this issue and successfully update my company file? Read More
MS Word Keeps crashing on windows 11
Isn’t it funny that MS Word keeps crashing on my Windows 11 Samsung Book 3 Ultra core i9 RTX 4070 while editing my book which is 600 pages while the same document is running normally and smoothly on my Macbook M1 pro 2021 8 core CPU?
Does that mean Apple is optimizing the app Office 365 better than Microsoft itself?
any solutions or ideas?
Isn’t it funny that MS Word keeps crashing on my Windows 11 Samsung Book 3 Ultra core i9 RTX 4070 while editing my book which is 600 pages while the same document is running normally and smoothly on my Macbook M1 pro 2021 8 core CPU? Does that mean Apple is optimizing the app Office 365 better than Microsoft itself?any solutions or ideas? Read More
Stackedplot error when changing position and plotting again
Hello together,
I get an error with stackedplot, when changing position (which works always the first time) and plotting then again, adding new variables. Without the position change, there is no error and I can plot on.
That’s the code I use. Without the "Position" line it works fine all the time. With the position change I get an error (below code).
app.Logs(app.Log).Stack{1} = stackedplot(app.Logs(app.Log).Table, app.Logs(app.Log).ToPlot,’Parent’,app.StackedTab);
for e=1:+1:height(app.Logs(app.Log).Stack{1}.DisplayLabels)
emptyLabels(e,1) = ""; % Create empty string for label
end
if app.Logs(app.Log).Plots > 0
app.Logs(app.Log).Stack{1}.DisplayLabels = emptyLabels; % "Delete labels"
app.Logs(app.Log).Stack{1}.Position = [0.05,0.05,0.90,0.90]; % Get rid of the broad margin
end
Thats the error:
Error using stackedplot (line 100)
Brace indexing is not supported for variables of this type.
Error in LogReader/DataButtonPress (line 141)
app.Logs(app.Log).Stack{1} =
stackedplot(app.Logs(app.Log).Table,
app.Logs(app.Log).ToPlot,’Parent’,app.StackedTab);
Error in LogReader>@(varargin)app.DataButtonPress(varargin{:}) (line 336)
app.Logs(app.Log).Variables{2, i}.ValueChangedFcn =
@app.DataButtonPress; %Callback function
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 429)
Error while evaluating StateButton PrivateValueChangedFcn.
What am I not understanding? ^^
Thanks in advance!
ChristofHello together,
I get an error with stackedplot, when changing position (which works always the first time) and plotting then again, adding new variables. Without the position change, there is no error and I can plot on.
That’s the code I use. Without the "Position" line it works fine all the time. With the position change I get an error (below code).
app.Logs(app.Log).Stack{1} = stackedplot(app.Logs(app.Log).Table, app.Logs(app.Log).ToPlot,’Parent’,app.StackedTab);
for e=1:+1:height(app.Logs(app.Log).Stack{1}.DisplayLabels)
emptyLabels(e,1) = ""; % Create empty string for label
end
if app.Logs(app.Log).Plots > 0
app.Logs(app.Log).Stack{1}.DisplayLabels = emptyLabels; % "Delete labels"
app.Logs(app.Log).Stack{1}.Position = [0.05,0.05,0.90,0.90]; % Get rid of the broad margin
end
Thats the error:
Error using stackedplot (line 100)
Brace indexing is not supported for variables of this type.
Error in LogReader/DataButtonPress (line 141)
app.Logs(app.Log).Stack{1} =
stackedplot(app.Logs(app.Log).Table,
app.Logs(app.Log).ToPlot,’Parent’,app.StackedTab);
Error in LogReader>@(varargin)app.DataButtonPress(varargin{:}) (line 336)
app.Logs(app.Log).Variables{2, i}.ValueChangedFcn =
@app.DataButtonPress; %Callback function
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 429)
Error while evaluating StateButton PrivateValueChangedFcn.
What am I not understanding? ^^
Thanks in advance!
Christof Hello together,
I get an error with stackedplot, when changing position (which works always the first time) and plotting then again, adding new variables. Without the position change, there is no error and I can plot on.
That’s the code I use. Without the "Position" line it works fine all the time. With the position change I get an error (below code).
app.Logs(app.Log).Stack{1} = stackedplot(app.Logs(app.Log).Table, app.Logs(app.Log).ToPlot,’Parent’,app.StackedTab);
for e=1:+1:height(app.Logs(app.Log).Stack{1}.DisplayLabels)
emptyLabels(e,1) = ""; % Create empty string for label
end
if app.Logs(app.Log).Plots > 0
app.Logs(app.Log).Stack{1}.DisplayLabels = emptyLabels; % "Delete labels"
app.Logs(app.Log).Stack{1}.Position = [0.05,0.05,0.90,0.90]; % Get rid of the broad margin
end
Thats the error:
Error using stackedplot (line 100)
Brace indexing is not supported for variables of this type.
Error in LogReader/DataButtonPress (line 141)
app.Logs(app.Log).Stack{1} =
stackedplot(app.Logs(app.Log).Table,
app.Logs(app.Log).ToPlot,’Parent’,app.StackedTab);
Error in LogReader>@(varargin)app.DataButtonPress(varargin{:}) (line 336)
app.Logs(app.Log).Variables{2, i}.ValueChangedFcn =
@app.DataButtonPress; %Callback function
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 429)
Error while evaluating StateButton PrivateValueChangedFcn.
What am I not understanding? ^^
Thanks in advance!
Christof stackedplot position MATLAB Answers — New Questions
Could not find a feasible initial point gamultiobj function
Hi, Hope members are good….I am getting the error "Could not find a feasible initial point.." despite changing lower and upper bounds…… request to help….. attached is the snapshot of obtained error ,,,,, plus matlab script is also in the attachment…… many thanks in advanceHi, Hope members are good….I am getting the error "Could not find a feasible initial point.." despite changing lower and upper bounds…… request to help….. attached is the snapshot of obtained error ,,,,, plus matlab script is also in the attachment…… many thanks in advance Hi, Hope members are good….I am getting the error "Could not find a feasible initial point.." despite changing lower and upper bounds…… request to help….. attached is the snapshot of obtained error ,,,,, plus matlab script is also in the attachment…… many thanks in advance genetic algorithm, constraints, feasible initial point MATLAB Answers — New Questions
Empty pdf if table is saved as pdf
I am trying save the table t1 by uisng the suggested table-to-figure mathod. However, the saved pdf remains empty.
t1=table(ones(5));
fig = uifigure(‘Name’,’Numbers’);
t = uitable(fig,’Data’,t1);
exportapp(fig,’Peak_assigments.pdf’)I am trying save the table t1 by uisng the suggested table-to-figure mathod. However, the saved pdf remains empty.
t1=table(ones(5));
fig = uifigure(‘Name’,’Numbers’);
t = uitable(fig,’Data’,t1);
exportapp(fig,’Peak_assigments.pdf’) I am trying save the table t1 by uisng the suggested table-to-figure mathod. However, the saved pdf remains empty.
t1=table(ones(5));
fig = uifigure(‘Name’,’Numbers’);
t = uitable(fig,’Data’,t1);
exportapp(fig,’Peak_assigments.pdf’) uitable, pdf, saveas, exportapp MATLAB Answers — New Questions
Genetic algorithm with solution of pde toolbox
Hi I’m on project that find optimal parameter about transient heat transfer problem. (find optimal values that minimize temperature fluctuation)
I have problem about exceed maximum array size (about 1800GB) while solving ga problem
I defined a design domain contains multiple values (i.e. length, geometry properties, etc) and FEA using pde toolbox has finished
the last task what i have to do is find optimal values with solution of FEA using ga function and my pseudo code about FEA is here:
function [result, model] = Heattransfer(L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed, time)
thermalmodel = createpde(‘thermal’, ‘transient’);
tlist = 0:1:time*60*60;
% Skip code about geometries, BC, IC
result = solve(thermalmodel, tlist);
model = thermalmodel;
end
L1, t1, t2, t3, length_fin is about geometry parameters that is noninteger values (because it is length)
num_fins, shelltype, shellmat, intermed is also about geometry parameters that is interger values (because it is about number or material type, i implemented that decide material type, geometry type by select number like if shellmat == 1, steel / elseif shellmat == 2, polymer)
and code about ga is as below:
function value = ObjectiveFcn(a, time)
L1 = a(1);
t1 = a(2);
t2 = a(3);
t3 = a(4);
length_fin = a(5);
num_fins = a(6);
shelltype = a(7);
shellmat = a(8);
intermed = a(9);
result = Heattransfer(L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed, time);
T = result.Temperature;
std_dev = std(T, 0, 1);
value = mean(std_dev);
end
function [c, ceq] = Constraints(b)
L1 = b(1);
t1 = b(2);
t2 = b(3);
t3 = b(4);
length_fin = b(5);
c1 = L1 + t1 + t2 + t3 – 0.3; % 0.3 is total length of control volume
c2 = length_fin – t1;
c3 = length_fin – t3;
c = [c1; c2; c3];
ceq = [];
end
% a = [L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed]
lb = [0, 0, 0, 0, 0, 1, 1, 1, 1];
ub = [0.3, 0.01, 0.02, 0.01, 0.01, 374, 2, 3, 2];
intvar = [6, 7, 8, 9];
ObjectivefunWithTime = @(a) Objectivefun(a, time);
ConstraintsFcn = @(b) Constraints(b);
options = optimoptions(‘ga’, ‘Display’, ‘iter’, ‘PopulationSize’, 10,…
‘MaxGenerations’, 20, ‘CrossoverFraction’, 0.8, ‘UseParallel’, true);
[x_opt, fval] = ga(ObjectivefunWithTime, 9, [], [], [], [], lb, ub, ConstraintsFcn, intvar, options);
time is not design variable so I excepted it from objective function
In ub (upper bound), I actually want to set value for t1, t2, t3, length_fin as 0.3 to find optimal value widely (under Constraints) but when i set values like that, it results error for invalid geometry (conflicted in pde toolbox code) so I defined arbiturary values.
What should I do for achieve my goal? (find optimal value)
I’m sorry for messy code
If anyone knows about this, please comment.
Thank youHi I’m on project that find optimal parameter about transient heat transfer problem. (find optimal values that minimize temperature fluctuation)
I have problem about exceed maximum array size (about 1800GB) while solving ga problem
I defined a design domain contains multiple values (i.e. length, geometry properties, etc) and FEA using pde toolbox has finished
the last task what i have to do is find optimal values with solution of FEA using ga function and my pseudo code about FEA is here:
function [result, model] = Heattransfer(L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed, time)
thermalmodel = createpde(‘thermal’, ‘transient’);
tlist = 0:1:time*60*60;
% Skip code about geometries, BC, IC
result = solve(thermalmodel, tlist);
model = thermalmodel;
end
L1, t1, t2, t3, length_fin is about geometry parameters that is noninteger values (because it is length)
num_fins, shelltype, shellmat, intermed is also about geometry parameters that is interger values (because it is about number or material type, i implemented that decide material type, geometry type by select number like if shellmat == 1, steel / elseif shellmat == 2, polymer)
and code about ga is as below:
function value = ObjectiveFcn(a, time)
L1 = a(1);
t1 = a(2);
t2 = a(3);
t3 = a(4);
length_fin = a(5);
num_fins = a(6);
shelltype = a(7);
shellmat = a(8);
intermed = a(9);
result = Heattransfer(L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed, time);
T = result.Temperature;
std_dev = std(T, 0, 1);
value = mean(std_dev);
end
function [c, ceq] = Constraints(b)
L1 = b(1);
t1 = b(2);
t2 = b(3);
t3 = b(4);
length_fin = b(5);
c1 = L1 + t1 + t2 + t3 – 0.3; % 0.3 is total length of control volume
c2 = length_fin – t1;
c3 = length_fin – t3;
c = [c1; c2; c3];
ceq = [];
end
% a = [L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed]
lb = [0, 0, 0, 0, 0, 1, 1, 1, 1];
ub = [0.3, 0.01, 0.02, 0.01, 0.01, 374, 2, 3, 2];
intvar = [6, 7, 8, 9];
ObjectivefunWithTime = @(a) Objectivefun(a, time);
ConstraintsFcn = @(b) Constraints(b);
options = optimoptions(‘ga’, ‘Display’, ‘iter’, ‘PopulationSize’, 10,…
‘MaxGenerations’, 20, ‘CrossoverFraction’, 0.8, ‘UseParallel’, true);
[x_opt, fval] = ga(ObjectivefunWithTime, 9, [], [], [], [], lb, ub, ConstraintsFcn, intvar, options);
time is not design variable so I excepted it from objective function
In ub (upper bound), I actually want to set value for t1, t2, t3, length_fin as 0.3 to find optimal value widely (under Constraints) but when i set values like that, it results error for invalid geometry (conflicted in pde toolbox code) so I defined arbiturary values.
What should I do for achieve my goal? (find optimal value)
I’m sorry for messy code
If anyone knows about this, please comment.
Thank you Hi I’m on project that find optimal parameter about transient heat transfer problem. (find optimal values that minimize temperature fluctuation)
I have problem about exceed maximum array size (about 1800GB) while solving ga problem
I defined a design domain contains multiple values (i.e. length, geometry properties, etc) and FEA using pde toolbox has finished
the last task what i have to do is find optimal values with solution of FEA using ga function and my pseudo code about FEA is here:
function [result, model] = Heattransfer(L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed, time)
thermalmodel = createpde(‘thermal’, ‘transient’);
tlist = 0:1:time*60*60;
% Skip code about geometries, BC, IC
result = solve(thermalmodel, tlist);
model = thermalmodel;
end
L1, t1, t2, t3, length_fin is about geometry parameters that is noninteger values (because it is length)
num_fins, shelltype, shellmat, intermed is also about geometry parameters that is interger values (because it is about number or material type, i implemented that decide material type, geometry type by select number like if shellmat == 1, steel / elseif shellmat == 2, polymer)
and code about ga is as below:
function value = ObjectiveFcn(a, time)
L1 = a(1);
t1 = a(2);
t2 = a(3);
t3 = a(4);
length_fin = a(5);
num_fins = a(6);
shelltype = a(7);
shellmat = a(8);
intermed = a(9);
result = Heattransfer(L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed, time);
T = result.Temperature;
std_dev = std(T, 0, 1);
value = mean(std_dev);
end
function [c, ceq] = Constraints(b)
L1 = b(1);
t1 = b(2);
t2 = b(3);
t3 = b(4);
length_fin = b(5);
c1 = L1 + t1 + t2 + t3 – 0.3; % 0.3 is total length of control volume
c2 = length_fin – t1;
c3 = length_fin – t3;
c = [c1; c2; c3];
ceq = [];
end
% a = [L1, t1, t2, t3, length_fin, num_fins, shelltype, shellmat, intermed]
lb = [0, 0, 0, 0, 0, 1, 1, 1, 1];
ub = [0.3, 0.01, 0.02, 0.01, 0.01, 374, 2, 3, 2];
intvar = [6, 7, 8, 9];
ObjectivefunWithTime = @(a) Objectivefun(a, time);
ConstraintsFcn = @(b) Constraints(b);
options = optimoptions(‘ga’, ‘Display’, ‘iter’, ‘PopulationSize’, 10,…
‘MaxGenerations’, 20, ‘CrossoverFraction’, 0.8, ‘UseParallel’, true);
[x_opt, fval] = ga(ObjectivefunWithTime, 9, [], [], [], [], lb, ub, ConstraintsFcn, intvar, options);
time is not design variable so I excepted it from objective function
In ub (upper bound), I actually want to set value for t1, t2, t3, length_fin as 0.3 to find optimal value widely (under Constraints) but when i set values like that, it results error for invalid geometry (conflicted in pde toolbox code) so I defined arbiturary values.
What should I do for achieve my goal? (find optimal value)
I’m sorry for messy code
If anyone knows about this, please comment.
Thank you genetic algorithm, pde toolbox, transient heat transfer, matlab, partial differential equation toolbox, global optimization toolbox MATLAB Answers — New Questions
How does im2int16 map double(0.5) to int16(0)?
I’ve known about this for a long time, and I’ve ignored it. It’s a curiosity I pick at every time I edit MIMT imcast(), but I’ve never really figured out a good explanation.
IPT im2int16() maps floating point values on the unit interval to values on the interval [-32768 32767]. That seems very simple. The problem is that obvious arithmetic doesn’t give the same result. What’s more curious is that it seems that the only input value that does not map identically is 1/2.
% our input
dx = 3E-5;
x = [0 linspace(0.5-dx,0.5+dx,7) 1].’; % ‘single’ or ‘double’ are the same
% convert it
y1 = im2int16(x); % the curiosity
y2 = int16(double(x)*65535 – 32768); % the obvious
y3 = int16(rescale(x,-32768,32767,’inputmin’,0,’inputmax’,1)); % a third opinion
% compare
[y1 y2 y3]
For what it’s worth, im2double() doesn’t map that 0 back to 1/2. It maps exactly like one would expect.
% map back to float
z1 = im2double(y1(2:8));
z2 = ((double(y2(2:8)) + 32768)/65535 );
% compare error
[z1 z2] – x(2:8)
So I suppose I have three sorts of questions.
How does this happen? I’m assuming this rises naturally from some simple conversion being used, but im2int16() isn’t working in mcode, and I’m not the clever one here.
Do you think this should be expected? Matter of differing conventions? Preference?
Does it really even matter? I’ve been assuming it doesn’t.I’ve known about this for a long time, and I’ve ignored it. It’s a curiosity I pick at every time I edit MIMT imcast(), but I’ve never really figured out a good explanation.
IPT im2int16() maps floating point values on the unit interval to values on the interval [-32768 32767]. That seems very simple. The problem is that obvious arithmetic doesn’t give the same result. What’s more curious is that it seems that the only input value that does not map identically is 1/2.
% our input
dx = 3E-5;
x = [0 linspace(0.5-dx,0.5+dx,7) 1].’; % ‘single’ or ‘double’ are the same
% convert it
y1 = im2int16(x); % the curiosity
y2 = int16(double(x)*65535 – 32768); % the obvious
y3 = int16(rescale(x,-32768,32767,’inputmin’,0,’inputmax’,1)); % a third opinion
% compare
[y1 y2 y3]
For what it’s worth, im2double() doesn’t map that 0 back to 1/2. It maps exactly like one would expect.
% map back to float
z1 = im2double(y1(2:8));
z2 = ((double(y2(2:8)) + 32768)/65535 );
% compare error
[z1 z2] – x(2:8)
So I suppose I have three sorts of questions.
How does this happen? I’m assuming this rises naturally from some simple conversion being used, but im2int16() isn’t working in mcode, and I’m not the clever one here.
Do you think this should be expected? Matter of differing conventions? Preference?
Does it really even matter? I’ve been assuming it doesn’t. I’ve known about this for a long time, and I’ve ignored it. It’s a curiosity I pick at every time I edit MIMT imcast(), but I’ve never really figured out a good explanation.
IPT im2int16() maps floating point values on the unit interval to values on the interval [-32768 32767]. That seems very simple. The problem is that obvious arithmetic doesn’t give the same result. What’s more curious is that it seems that the only input value that does not map identically is 1/2.
% our input
dx = 3E-5;
x = [0 linspace(0.5-dx,0.5+dx,7) 1].’; % ‘single’ or ‘double’ are the same
% convert it
y1 = im2int16(x); % the curiosity
y2 = int16(double(x)*65535 – 32768); % the obvious
y3 = int16(rescale(x,-32768,32767,’inputmin’,0,’inputmax’,1)); % a third opinion
% compare
[y1 y2 y3]
For what it’s worth, im2double() doesn’t map that 0 back to 1/2. It maps exactly like one would expect.
% map back to float
z1 = im2double(y1(2:8));
z2 = ((double(y2(2:8)) + 32768)/65535 );
% compare error
[z1 z2] – x(2:8)
So I suppose I have three sorts of questions.
How does this happen? I’m assuming this rises naturally from some simple conversion being used, but im2int16() isn’t working in mcode, and I’m not the clever one here.
Do you think this should be expected? Matter of differing conventions? Preference?
Does it really even matter? I’ve been assuming it doesn’t. im2int16 MATLAB Answers — New Questions
Questions on SSD problem on Windows 11
I’ve noticed that my SSD seems to be slow or unresponsive at times, with delays when booting up or loading applications. This happens intermittently, and it’s not consistent across all tasks, but it’s been happening frequently enough that it’s become annoying.
I’ve tried to troubleshoot the issue by checking for disk errors, running disk cleanup, and ensuring that my system is up-to-date with the latest Windows patches. I’m not sure what could be causing it. I’m hoping someone might have some insight or suggestions on how to resolve this problem.
I’ve noticed that my SSD seems to be slow or unresponsive at times, with delays when booting up or loading applications. This happens intermittently, and it’s not consistent across all tasks, but it’s been happening frequently enough that it’s become annoying. I’ve tried to troubleshoot the issue by checking for disk errors, running disk cleanup, and ensuring that my system is up-to-date with the latest Windows patches. I’m not sure what could be causing it. I’m hoping someone might have some insight or suggestions on how to resolve this problem. Read More
Forms embedded in SharePoint doesn’t display in custom Teams app
I’m working with a customer that is using a custom Teams app instead of Viva Connections for their intranet in Teams. They embed Microsoft Forms in SharePoint News Posts to collect feedback from their users.
The form is embedded as expected when page is rendered in SharePointThe form is embedded as expected when page is rendered in Viva Connections (Viva Petter in screenshot)The form cannot be embedded (error message says “Microsoft Forms | Can’t access the Forms.“) when page is rendered in the custom Teams app (Contoso in screenshot)
I see errors in the console log and network trace related to getting on-behalf-of tokens
{
“odata.error”: {
“code”: “-1, System.AggregateException”,
“message”: {
“lang”: “en-US”,
“value”: “One or more errors occurred.”
}
}
}
I’ve read similar cases
https://github.com/SharePoint/sp-dev-docs/issues/3923#issuecomment-514726341
https://github.com/SharePoint/sp-dev-docs/issues/4357#issuecomment-515131702
https://github.com/SharePoint/sp-dev-docs/issues/9099#issuecomment-1701406090
I have tried allowing more domains in the teams app manifest and I’ve tried deleting and recreating the client credentials for the SharePoint client extensibility app registration without effect.
The customer doesn’t want to use the standard Viva Connections app because of the mobile app experience.
I’ve managed to recreate the issue in several tenants.
Is there a way to make this work in a custom Teams app and how?
I’m working with a customer that is using a custom Teams app instead of Viva Connections for their intranet in Teams. They embed Microsoft Forms in SharePoint News Posts to collect feedback from their users. The form is embedded as expected when page is rendered in SharePointThe form is embedded as expected when page is rendered in Viva Connections (Viva Petter in screenshot)The form cannot be embedded (error message says “Microsoft Forms | Can’t access the Forms.”) when page is rendered in the custom Teams app (Contoso in screenshot)I see errors in the console log and network trace related to getting on-behalf-of tokens https://skodvinhvammen.sharepoint.com/_api/Microsoft.SharePoint.Internal.ClientSideComponent.Token.AcquireOBOToken?resource=%27https://forms.office.com%27&clientId=%2708e18876-6177-487e-b8b5-cf950c1e598c%27 Acquire OBO Token receives the following parameters: clientId: SharePoint Online Web Client Extensibility / SharePoint Online Client Extensibility Web Application Principal (different names in different tenants)resource: https://forms.office.com This API call returns HTTP 500 with unhelpful details {
“odata.error”: {
“code”: “-1, System.AggregateException”,
“message”: {
“lang”: “en-US”,
“value”: “One or more errors occurred.”
}
}
} I’ve read similar cases https://github.com/SharePoint/sp-dev-docs/issues/3923#issuecomment-514726341https://github.com/SharePoint/sp-dev-docs/issues/4357#issuecomment-515131702 https://github.com/SharePoint/sp-dev-docs/issues/9099#issuecomment-1701406090 I have tried allowing more domains in the teams app manifest and I’ve tried deleting and recreating the client credentials for the SharePoint client extensibility app registration without effect. The customer doesn’t want to use the standard Viva Connections app because of the mobile app experience. I’ve managed to recreate the issue in several tenants. Is there a way to make this work in a custom Teams app and how? Read More
Unable to train Syntex Structured Document model
Hi all,
I am trying to create and train a Syntex model for the first time in my organization. I am going through the Content Center and, while a model is created when I hit the New Model button, when it goes to start the training process, I get the following error:
I have confirmed that there exists an entry for SharePointFormProcessing in a table called Packages in Dataverse. The same thing happens when trying to create a model locally in another site and regardless of whether I’m using a the freeform selection or layout method.
Does anyone have an idea what the problem might be?
Hi all, I am trying to create and train a Syntex model for the first time in my organization. I am going through the Content Center and, while a model is created when I hit the New Model button, when it goes to start the training process, I get the following error:I have confirmed that there exists an entry for SharePointFormProcessing in a table called Packages in Dataverse. The same thing happens when trying to create a model locally in another site and regardless of whether I’m using a the freeform selection or layout method. Does anyone have an idea what the problem might be? Read More
Cannot add co-organizer and presenters in the webinar
I set up a webinar but when I add our teams as co-organizers and presenters, I can not save and updates.
It said that “Unable to save changes. Let’s try again”
I set up a webinar but when I add our teams as co-organizers and presenters, I can not save and updates.It said that “Unable to save changes. Let’s try again” Read More
Desktop app option is missing
Users wants to open documents form the New Teams desktop app with the desktop app (Word, Excel, Powerpoint) by default, but the option is missing. Because of certain requirements we have installed Office 2021 and not Office 365.
If I check the Requirements Office 2021 is supported, but we are a educational institution so we don’t have an E3 or E5 license. All users have an A3 license assigned.
I have executed the powershell script to check for the required license. The output I get is ProPlus2021Volume, so it doesn’t match O365ProPlusRetail. That’s make me wonder if Office 2021 is even supported for this feature.
Users wants to open documents form the New Teams desktop app with the desktop app (Word, Excel, Powerpoint) by default, but the option is missing. Because of certain requirements we have installed Office 2021 and not Office 365. If I check the Requirements Office 2021 is supported, but we are a educational institution so we don’t have an E3 or E5 license. All users have an A3 license assigned.I have executed the powershell script to check for the required license. The output I get is ProPlus2021Volume, so it doesn’t match O365ProPlusRetail. That’s make me wonder if Office 2021 is even supported for this feature. Read More