Tag Archives: matlab
How to give range of cells different variable names?
Hello!
I am collecting data from a range of cells from an .xlsx file using the readmatrix function as so:
Datafiles(j).data = readmatrix(Data,’Sheet’,’Report’,’Range’,’M18:N18′,’FileType’,’spreadsheet’);
Then I populate that data into a new excel file like so:
CurrentData = {Datafiles.data}’;
TABLE_Pass = table(CurrentData);
TABLE = vertcat(TABLE_Pass);
Now, my problem is, it spits out the data in 2 columns labeled "CurrentData_1" "CurrentData_2" and I want to specify the name of the second column.
When I create a second variable name, it gives me 4 columns with the information doubled.
Any tips on how to give the data 2 separate variable names?Hello!
I am collecting data from a range of cells from an .xlsx file using the readmatrix function as so:
Datafiles(j).data = readmatrix(Data,’Sheet’,’Report’,’Range’,’M18:N18′,’FileType’,’spreadsheet’);
Then I populate that data into a new excel file like so:
CurrentData = {Datafiles.data}’;
TABLE_Pass = table(CurrentData);
TABLE = vertcat(TABLE_Pass);
Now, my problem is, it spits out the data in 2 columns labeled "CurrentData_1" "CurrentData_2" and I want to specify the name of the second column.
When I create a second variable name, it gives me 4 columns with the information doubled.
Any tips on how to give the data 2 separate variable names? Hello!
I am collecting data from a range of cells from an .xlsx file using the readmatrix function as so:
Datafiles(j).data = readmatrix(Data,’Sheet’,’Report’,’Range’,’M18:N18′,’FileType’,’spreadsheet’);
Then I populate that data into a new excel file like so:
CurrentData = {Datafiles.data}’;
TABLE_Pass = table(CurrentData);
TABLE = vertcat(TABLE_Pass);
Now, my problem is, it spits out the data in 2 columns labeled "CurrentData_1" "CurrentData_2" and I want to specify the name of the second column.
When I create a second variable name, it gives me 4 columns with the information doubled.
Any tips on how to give the data 2 separate variable names? importing excel data MATLAB Answers — New Questions
colorbar graph exceeding matrix values
So I’m plotting a 4D matrix, called Ft, that ranges from 0-1, but when I graph it and add a colorbar, it’s showing 0-2 for physical states 4-15, and (-1)-1for physical state 1-3
physical states 1-3 are 0 for every timestep in the matrix Ft, so that first graph makes sense. Why does the colorbar range change for the other graphs?
Here’s the code for the graphs. Let me know if more code is needed to create the actual Ft matrix. [[ my entire code would be needed in order to create this matrix ]]
%the setup of Ft is Ft(state,est of patch1,est of patch2,timestep)
B = permute(Ft,[2 3 1 4]);
for state= 1:15
figure(state)
sgtitle([‘physical state = ‘ num2str(state)])
time = 1;
subplot(4,5,time)
imagesc(B(:,:,state,time))
title([‘timestep : ‘ num2str(time)])
xlabel(‘est. of patch 2 quality’);
ylabel(‘est. of patch 1 quality’);
set(gca,’ydir’,’normal’)
for time = 2:19
subplot(4,5,time)
imagesc(B(:,:,state,time))
title(num2str(time))
set(gca,’ydir’,’normal’)
for time = 20
subplot(4,5,time)
imagesc(B(:,:,state,time))
title(num2str(time))
set(gca,’ydir’,’normal’)
colormap hot
colorbar
hold on
end
end
endSo I’m plotting a 4D matrix, called Ft, that ranges from 0-1, but when I graph it and add a colorbar, it’s showing 0-2 for physical states 4-15, and (-1)-1for physical state 1-3
physical states 1-3 are 0 for every timestep in the matrix Ft, so that first graph makes sense. Why does the colorbar range change for the other graphs?
Here’s the code for the graphs. Let me know if more code is needed to create the actual Ft matrix. [[ my entire code would be needed in order to create this matrix ]]
%the setup of Ft is Ft(state,est of patch1,est of patch2,timestep)
B = permute(Ft,[2 3 1 4]);
for state= 1:15
figure(state)
sgtitle([‘physical state = ‘ num2str(state)])
time = 1;
subplot(4,5,time)
imagesc(B(:,:,state,time))
title([‘timestep : ‘ num2str(time)])
xlabel(‘est. of patch 2 quality’);
ylabel(‘est. of patch 1 quality’);
set(gca,’ydir’,’normal’)
for time = 2:19
subplot(4,5,time)
imagesc(B(:,:,state,time))
title(num2str(time))
set(gca,’ydir’,’normal’)
for time = 20
subplot(4,5,time)
imagesc(B(:,:,state,time))
title(num2str(time))
set(gca,’ydir’,’normal’)
colormap hot
colorbar
hold on
end
end
end So I’m plotting a 4D matrix, called Ft, that ranges from 0-1, but when I graph it and add a colorbar, it’s showing 0-2 for physical states 4-15, and (-1)-1for physical state 1-3
physical states 1-3 are 0 for every timestep in the matrix Ft, so that first graph makes sense. Why does the colorbar range change for the other graphs?
Here’s the code for the graphs. Let me know if more code is needed to create the actual Ft matrix. [[ my entire code would be needed in order to create this matrix ]]
%the setup of Ft is Ft(state,est of patch1,est of patch2,timestep)
B = permute(Ft,[2 3 1 4]);
for state= 1:15
figure(state)
sgtitle([‘physical state = ‘ num2str(state)])
time = 1;
subplot(4,5,time)
imagesc(B(:,:,state,time))
title([‘timestep : ‘ num2str(time)])
xlabel(‘est. of patch 2 quality’);
ylabel(‘est. of patch 1 quality’);
set(gca,’ydir’,’normal’)
for time = 2:19
subplot(4,5,time)
imagesc(B(:,:,state,time))
title(num2str(time))
set(gca,’ydir’,’normal’)
for time = 20
subplot(4,5,time)
imagesc(B(:,:,state,time))
title(num2str(time))
set(gca,’ydir’,’normal’)
colormap hot
colorbar
hold on
end
end
end graph, colorbar MATLAB Answers — New Questions
code of load flow equation four buses
clc
clear all
cg =[0.86 0 0 0.6];
Pg = [0 0 0 318];
Pd = [50 170 200 80];
Qd = [30.9 105.35 123.94 49.58];
Y = [9.934-1i*44.925, -3.815+1i*19.078, -5.169+1i*25.847, 0
-3.815+1i*19.078, 8.984 – 1i*44.925, 0, -5.169+1i*25.847
-5.169+1i*25.847, 0, 8.192 – 1i*40.965, -3.023 + 1i*15.118
0, -5.169+1i*25.847, -3.023 + 1i*15.118, 8.192 – 1i*40.965];
Pg=sdpvar(1,4);
Qg = sdpvar(1,4);
objective= sum(cg.*Qg)
Qgmin=[-100 0 0 -100];
Qgmax =[100 0 0 100];
Pgmin =[0 0 0 0];
Pgmax =[318 0 0 318];
vang = sdpvar(1,4);
vmag = sdpvar(1,4);
vmin =0.9;
vmax =1.1
Constraints = [];
[Costraints,Pg(1,1)-Pd(1,1)==vmag(1,1)*[vmag(1,1)*Ymag(1,1)*cos(Yang(1,1))+…
vmag(1,2)*Ymag(2,1)*cos(Yang(2,1) + vang(1,1) – vang(1,2))+…
vmag(1,3)*Ymag(3,1)*cos(Yang(3,1) + vang(1,1) – vang(1,3))+…
vmag(1,4)*Ymag(4,1)*cos(Yang(4,1) + vang(1,1) – vang(4))];
[Costraints,Qg(1,1)-Qd(1,1)==(-vmag)(1,1)*[vmag(1,1)*Ymag(1,1)*sin(Yang(1,1))+…
vmag(1,2)*Ymag(2,1)*sin(Yang(2,1) + vang(1,1) – vang(1,2))+…
vmag(1,3)*Ymag(3,1)*sin(Yang(3,1) + vang(1,1) – vang(1,3))+…
vmag(1,4)*Ymag(4,1)*sin(Yang(4,1) + vang(1,1) – vang(4))];
% Constraints = [Constraints,sum(Pg)==sum(Pd)];
% Constraints=[Constraints,Pg(i)-Pd(i)=P(i)]
% Constraints=[Constraints,Qg(i)-Qd(i)=Q(i)]
Constraints = [Constraints,0<=Pg<=318];
Constraints = [Constraints,-100<=Qg<=100];
Constraints = [Constraints, vmin <= vmag];
Constraints = [Constraints, vmag <= vmax];
options = sdpsettings(‘solver’,’gurobi’);
sol = optimize(Constraints,objective,options);
value(objective)
reactive_power=value(Qg)
active_power=value(Pg)
voltage_mag=value(vmag)
voltage_ang=value(vang)clc
clear all
cg =[0.86 0 0 0.6];
Pg = [0 0 0 318];
Pd = [50 170 200 80];
Qd = [30.9 105.35 123.94 49.58];
Y = [9.934-1i*44.925, -3.815+1i*19.078, -5.169+1i*25.847, 0
-3.815+1i*19.078, 8.984 – 1i*44.925, 0, -5.169+1i*25.847
-5.169+1i*25.847, 0, 8.192 – 1i*40.965, -3.023 + 1i*15.118
0, -5.169+1i*25.847, -3.023 + 1i*15.118, 8.192 – 1i*40.965];
Pg=sdpvar(1,4);
Qg = sdpvar(1,4);
objective= sum(cg.*Qg)
Qgmin=[-100 0 0 -100];
Qgmax =[100 0 0 100];
Pgmin =[0 0 0 0];
Pgmax =[318 0 0 318];
vang = sdpvar(1,4);
vmag = sdpvar(1,4);
vmin =0.9;
vmax =1.1
Constraints = [];
[Costraints,Pg(1,1)-Pd(1,1)==vmag(1,1)*[vmag(1,1)*Ymag(1,1)*cos(Yang(1,1))+…
vmag(1,2)*Ymag(2,1)*cos(Yang(2,1) + vang(1,1) – vang(1,2))+…
vmag(1,3)*Ymag(3,1)*cos(Yang(3,1) + vang(1,1) – vang(1,3))+…
vmag(1,4)*Ymag(4,1)*cos(Yang(4,1) + vang(1,1) – vang(4))];
[Costraints,Qg(1,1)-Qd(1,1)==(-vmag)(1,1)*[vmag(1,1)*Ymag(1,1)*sin(Yang(1,1))+…
vmag(1,2)*Ymag(2,1)*sin(Yang(2,1) + vang(1,1) – vang(1,2))+…
vmag(1,3)*Ymag(3,1)*sin(Yang(3,1) + vang(1,1) – vang(1,3))+…
vmag(1,4)*Ymag(4,1)*sin(Yang(4,1) + vang(1,1) – vang(4))];
% Constraints = [Constraints,sum(Pg)==sum(Pd)];
% Constraints=[Constraints,Pg(i)-Pd(i)=P(i)]
% Constraints=[Constraints,Qg(i)-Qd(i)=Q(i)]
Constraints = [Constraints,0<=Pg<=318];
Constraints = [Constraints,-100<=Qg<=100];
Constraints = [Constraints, vmin <= vmag];
Constraints = [Constraints, vmag <= vmax];
options = sdpsettings(‘solver’,’gurobi’);
sol = optimize(Constraints,objective,options);
value(objective)
reactive_power=value(Qg)
active_power=value(Pg)
voltage_mag=value(vmag)
voltage_ang=value(vang) clc
clear all
cg =[0.86 0 0 0.6];
Pg = [0 0 0 318];
Pd = [50 170 200 80];
Qd = [30.9 105.35 123.94 49.58];
Y = [9.934-1i*44.925, -3.815+1i*19.078, -5.169+1i*25.847, 0
-3.815+1i*19.078, 8.984 – 1i*44.925, 0, -5.169+1i*25.847
-5.169+1i*25.847, 0, 8.192 – 1i*40.965, -3.023 + 1i*15.118
0, -5.169+1i*25.847, -3.023 + 1i*15.118, 8.192 – 1i*40.965];
Pg=sdpvar(1,4);
Qg = sdpvar(1,4);
objective= sum(cg.*Qg)
Qgmin=[-100 0 0 -100];
Qgmax =[100 0 0 100];
Pgmin =[0 0 0 0];
Pgmax =[318 0 0 318];
vang = sdpvar(1,4);
vmag = sdpvar(1,4);
vmin =0.9;
vmax =1.1
Constraints = [];
[Costraints,Pg(1,1)-Pd(1,1)==vmag(1,1)*[vmag(1,1)*Ymag(1,1)*cos(Yang(1,1))+…
vmag(1,2)*Ymag(2,1)*cos(Yang(2,1) + vang(1,1) – vang(1,2))+…
vmag(1,3)*Ymag(3,1)*cos(Yang(3,1) + vang(1,1) – vang(1,3))+…
vmag(1,4)*Ymag(4,1)*cos(Yang(4,1) + vang(1,1) – vang(4))];
[Costraints,Qg(1,1)-Qd(1,1)==(-vmag)(1,1)*[vmag(1,1)*Ymag(1,1)*sin(Yang(1,1))+…
vmag(1,2)*Ymag(2,1)*sin(Yang(2,1) + vang(1,1) – vang(1,2))+…
vmag(1,3)*Ymag(3,1)*sin(Yang(3,1) + vang(1,1) – vang(1,3))+…
vmag(1,4)*Ymag(4,1)*sin(Yang(4,1) + vang(1,1) – vang(4))];
% Constraints = [Constraints,sum(Pg)==sum(Pd)];
% Constraints=[Constraints,Pg(i)-Pd(i)=P(i)]
% Constraints=[Constraints,Qg(i)-Qd(i)=Q(i)]
Constraints = [Constraints,0<=Pg<=318];
Constraints = [Constraints,-100<=Qg<=100];
Constraints = [Constraints, vmin <= vmag];
Constraints = [Constraints, vmag <= vmax];
options = sdpsettings(‘solver’,’gurobi’);
sol = optimize(Constraints,objective,options);
value(objective)
reactive_power=value(Qg)
active_power=value(Pg)
voltage_mag=value(vmag)
voltage_ang=value(vang) optimization cost of reactive power MATLAB Answers — New Questions
With Simulink Embedded Coder is it possible to change base workspace variables?
Hi all,
We are developing a standalone application for an inverter using MATLAB/Simulink R2022b with Embedded Coder and TIs package for C2000 development. Our target is TIs Launchpad XL based on the F28379D CPU. My goal is to write a Simulink model that can modify onboard flash during runtime, so when power is lost certain calibration values are maintained.
My model currently implements a Simulink reference example: https://nl.mathworks.com/matlabcentral/fileexchange/92788-simulink-reference-application-examples-for-ti-c2000?s_tid=FX_rc1_behav
This works well, but has a major downside: it is only possible to modify the variables in the matlab workspace and then press Ctrl+d to update them on the target machine while connected in external mode over a serial connection. For our devices in the field, we want to get rid of the mandatory external mode and achieve the same over CAN bus.
I have already tried a bunch of things, but none of them yield the desired behavior:
set_param(): will not work as the calibration values are stored in the MATLAB base workspace. I am not changing blocks.
assignin(): gives the following error: The function <function_name> is not supported for code generation. Declaring the function as extrinsic via coder.extrinsic does not solve the problem.
Parameter Writer block: In R2022b this can only modify variables in the model workspace, so I moved the flash related parameters accordingly. However, somehow the parameter writer block just won’t find them. My guess is that it is because the parameters are defined in the base workspace as a specific storage class based on the tic2000demospkg.Parameter. In the Code Mappings interface they therefore show up as ‘External Parameter Objects’ instead of ‘Model Parameters.’ Based on this article: https://blogs.mathworks.com/simulink/2023/09/27/signals-vs-parameters-in-simulink-and-the-parameter-writer-block/
MATLAB function block: I was hoping the parameters I defined in the base workspace could be called in a global context. Calling the matlab routine from Simulink showed me this is unfortunately not the case. Implicitly the variable was defined in local context and base variable remained unchanged. Inspecting gave clarity on this.
For a fact I know that the variables that I want to tune are defined with the mp_ prefix because I configured the identifier for the custom storage class. However, I don’t understand on how I want to change these.
Is it at all possible to modify variables? Can someone give me a heads up on how?
Thanks a lot in advance!
Kind regards,
RemiHi all,
We are developing a standalone application for an inverter using MATLAB/Simulink R2022b with Embedded Coder and TIs package for C2000 development. Our target is TIs Launchpad XL based on the F28379D CPU. My goal is to write a Simulink model that can modify onboard flash during runtime, so when power is lost certain calibration values are maintained.
My model currently implements a Simulink reference example: https://nl.mathworks.com/matlabcentral/fileexchange/92788-simulink-reference-application-examples-for-ti-c2000?s_tid=FX_rc1_behav
This works well, but has a major downside: it is only possible to modify the variables in the matlab workspace and then press Ctrl+d to update them on the target machine while connected in external mode over a serial connection. For our devices in the field, we want to get rid of the mandatory external mode and achieve the same over CAN bus.
I have already tried a bunch of things, but none of them yield the desired behavior:
set_param(): will not work as the calibration values are stored in the MATLAB base workspace. I am not changing blocks.
assignin(): gives the following error: The function <function_name> is not supported for code generation. Declaring the function as extrinsic via coder.extrinsic does not solve the problem.
Parameter Writer block: In R2022b this can only modify variables in the model workspace, so I moved the flash related parameters accordingly. However, somehow the parameter writer block just won’t find them. My guess is that it is because the parameters are defined in the base workspace as a specific storage class based on the tic2000demospkg.Parameter. In the Code Mappings interface they therefore show up as ‘External Parameter Objects’ instead of ‘Model Parameters.’ Based on this article: https://blogs.mathworks.com/simulink/2023/09/27/signals-vs-parameters-in-simulink-and-the-parameter-writer-block/
MATLAB function block: I was hoping the parameters I defined in the base workspace could be called in a global context. Calling the matlab routine from Simulink showed me this is unfortunately not the case. Implicitly the variable was defined in local context and base variable remained unchanged. Inspecting gave clarity on this.
For a fact I know that the variables that I want to tune are defined with the mp_ prefix because I configured the identifier for the custom storage class. However, I don’t understand on how I want to change these.
Is it at all possible to modify variables? Can someone give me a heads up on how?
Thanks a lot in advance!
Kind regards,
Remi Hi all,
We are developing a standalone application for an inverter using MATLAB/Simulink R2022b with Embedded Coder and TIs package for C2000 development. Our target is TIs Launchpad XL based on the F28379D CPU. My goal is to write a Simulink model that can modify onboard flash during runtime, so when power is lost certain calibration values are maintained.
My model currently implements a Simulink reference example: https://nl.mathworks.com/matlabcentral/fileexchange/92788-simulink-reference-application-examples-for-ti-c2000?s_tid=FX_rc1_behav
This works well, but has a major downside: it is only possible to modify the variables in the matlab workspace and then press Ctrl+d to update them on the target machine while connected in external mode over a serial connection. For our devices in the field, we want to get rid of the mandatory external mode and achieve the same over CAN bus.
I have already tried a bunch of things, but none of them yield the desired behavior:
set_param(): will not work as the calibration values are stored in the MATLAB base workspace. I am not changing blocks.
assignin(): gives the following error: The function <function_name> is not supported for code generation. Declaring the function as extrinsic via coder.extrinsic does not solve the problem.
Parameter Writer block: In R2022b this can only modify variables in the model workspace, so I moved the flash related parameters accordingly. However, somehow the parameter writer block just won’t find them. My guess is that it is because the parameters are defined in the base workspace as a specific storage class based on the tic2000demospkg.Parameter. In the Code Mappings interface they therefore show up as ‘External Parameter Objects’ instead of ‘Model Parameters.’ Based on this article: https://blogs.mathworks.com/simulink/2023/09/27/signals-vs-parameters-in-simulink-and-the-parameter-writer-block/
MATLAB function block: I was hoping the parameters I defined in the base workspace could be called in a global context. Calling the matlab routine from Simulink showed me this is unfortunately not the case. Implicitly the variable was defined in local context and base variable remained unchanged. Inspecting gave clarity on this.
For a fact I know that the variables that I want to tune are defined with the mp_ prefix because I configured the identifier for the custom storage class. However, I don’t understand on how I want to change these.
Is it at all possible to modify variables? Can someone give me a heads up on how?
Thanks a lot in advance!
Kind regards,
Remi ti, embedded coder, simulink, variables, code generation, matlab code MATLAB Answers — New Questions
How to keep the order in plotting scatter plot with categorical variables
Hi,
I am using scatter (b,a) where a is categorical variable and b is double. The plot shows a different order than in my list in a. How do I keep the same order in the plot?Hi,
I am using scatter (b,a) where a is categorical variable and b is double. The plot shows a different order than in my list in a. How do I keep the same order in the plot? Hi,
I am using scatter (b,a) where a is categorical variable and b is double. The plot shows a different order than in my list in a. How do I keep the same order in the plot? scatter, plot, categorical MATLAB Answers — New Questions
Why do I get the error “Unable to resolve the name com.mathworks.toolbox.distcomp.ui.widget.SupportedDataTypes.STRING” when running configCluster?
Why do I get the error "Unable to resolve the name com.mathworks.toolbox.distcomp.ui.widget.SupportedDataTypes.STRING" when running configCluster?Why do I get the error "Unable to resolve the name com.mathworks.toolbox.distcomp.ui.widget.SupportedDataTypes.STRING" when running configCluster? Why do I get the error "Unable to resolve the name com.mathworks.toolbox.distcomp.ui.widget.SupportedDataTypes.STRING" when running configCluster? MATLAB Answers — New Questions
Using the trigonometric Fourier series to develop MATLAB code to confirm correctness
fs = 2/5 + sum(2/(n*pi)*sin(2*pi/5*n)*cos(2*pi/5*n*t))
x(t) = sum(rect((t-5*n)/2))
I really don’t know how to plot two function. Please help me.fs = 2/5 + sum(2/(n*pi)*sin(2*pi/5*n)*cos(2*pi/5*n*t))
x(t) = sum(rect((t-5*n)/2))
I really don’t know how to plot two function. Please help me. fs = 2/5 + sum(2/(n*pi)*sin(2*pi/5*n)*cos(2*pi/5*n*t))
x(t) = sum(rect((t-5*n)/2))
I really don’t know how to plot two function. Please help me. trigonometric fourier series MATLAB Answers — New Questions
Has anyone found a way to enable/disable tabs in App Designer?
I am building a fairly simple GUI in I have tried implementations using findjobj, such as:
jtabgroup=findjobj(tabgrp);
jtabgroup.setEnabledAt(1,0);
but I am unsure if the app class can be read the same way (I’m very new to Java implementations). Any help would be much appreciated!I am building a fairly simple GUI in I have tried implementations using findjobj, such as:
jtabgroup=findjobj(tabgrp);
jtabgroup.setEnabledAt(1,0);
but I am unsure if the app class can be read the same way (I’m very new to Java implementations). Any help would be much appreciated! I am building a fairly simple GUI in I have tried implementations using findjobj, such as:
jtabgroup=findjobj(tabgrp);
jtabgroup.setEnabledAt(1,0);
but I am unsure if the app class can be read the same way (I’m very new to Java implementations). Any help would be much appreciated! gui, app designer MATLAB Answers — New Questions
Why do my laptop and work computer produce different results when adding a small term to a matrix?
In the following code, when I add the term eye(8)*(0.0001) to the matrix F, my laptop and my work computer return different values for the variable Uk. Could anyone please help me understand what is happening?
I am using MATLAB R2024a on both computers.
clear; clc;
% constants
a = 1;
x1 = 1;
x2 = 0;
x4 = 0;
lambda = 1;
sigma3 = diag([1 1 1 1 -1 -1 -1 -1]);
kx = -2.0944;
ky = -3.6276;
F = [ – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, – lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 – 4.082e-17i) – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 + 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 + 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 – 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 – 2.721e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 – 1.347i), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), 0, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 – 8.164e-17i) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 – 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 – 5.443e-17i)), – lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 – 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.6667 + 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.25i – a*ky*0.433i)*(0.8889 + 1.11e-16i)), – lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.3333 + 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 – 1.155i) – 1.0*x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 + 5.551e-17i))
– lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 + 4.082e-17i) – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 – 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 – 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 – 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 – 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 + 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 + 2.721e-17i)), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 – 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 – 8.164e-17i) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 – 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 – 5.443e-17i)), 0, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.6667 – 1.027e-33i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*1.54i – 1.0*x4*lambda^3*(0.4444*exp(- a*kx*0.25i – a*ky*0.433i) + 0.4444*exp(a*kx*0.25i + a*ky*0.433i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 – 1.027e-33i) – 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i – a*ky*0.433i))
lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 – 0.1925i), – lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 – 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.6667 + 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.25i – a*ky*0.433i)*(0.8889 + 1.11e-16i)), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.6667 – 1.027e-33i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(1.257 + 1.54i), 0, 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 – 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 – 1.388e-17i))
lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 – 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 – 1.347i), lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 + 0.1925i), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, – lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.3333 + 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 – 1.155i) – 1.0*x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 + 5.551e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 – 1.027e-33i) – 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i – a*ky*0.433i)), 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 – 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 – 1.388e-17i)), 0
0, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 + 8.164e-17i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 + 5.443e-17i)), – lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 + 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.6667 – 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 – 1.11e-16i) + exp(a*kx*0.25i – a*ky*0.433i)*(0.8889 – 1.11e-16i)), – lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.3333 – 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 + 1.155i) – 1.0*x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i)*(0.8889 – 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 – 5.551e-17i)), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, – lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 + 4.082e-17i) – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 – 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 – 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 – 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 – 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 + 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 + 2.721e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 – 0.1925i)
lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 + 8.164e-17i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 + 5.443e-17i)), 0, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.6667 + 1.027e-33i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(1.257 – 1.54i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 + 1.027e-33i) – 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i – a*ky*0.433i)), – lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 – 4.082e-17i) – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 + 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 + 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 – 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 – 2.721e-17i)), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 – 1.347i)
– lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 + 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.6667 – 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 – 1.11e-16i) + exp(a*kx*0.25i – a*ky*0.433i)*(0.8889 – 1.11e-16i)), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.6667 + 1.027e-33i) + x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*1.54i – 1.0*x4*lambda^3*(0.4444*exp(- a*kx*0.25i – a*ky*0.433i) + 0.4444*exp(a*kx*0.25i + a*ky*0.433i)), 0, 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 + 1.388e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 – 1.347i), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 – 0.1925i), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 + 0.1925i)
– lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.3333 – 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 + 1.155i) – 1.0*x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i)*(0.8889 – 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 – 5.551e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 + 1.027e-33i) – 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i – a*ky*0.433i)), 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 + 1.388e-17i)), 0, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 – 0.1925i), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda
];
FF = F; % this gives same "Uk" on both computers
FF = F + eye(8)*(0.0001); % this gives different "Uk" on both computers
K = chol(FF,"upper");
Q = K*sigma3*(K’); % Q is same on both computers
[RV,D,~] = eig(Q);
[D,I] = sort(diag(real(D)),’descend’);
RV = RV(:, I);
Uk = RV;
Lk = diag(D);
% more specifically i get these results with "FF = F + eye(8)*(0.0001)":
Uk_on_laptop = [-0.5581 – 0.2520i -0.4914 – 0.1718i -0.1074 – 0.3017i 0.2309 – 0.2705i 0.0962 – 0.0850i -0.1447 – 0.2249i 0.1924 – 0.0017i -0.0000 + 0.0000i
0.4717 + 0.2130i -0.5796 – 0.1237i 0.1084 – 0.2927i -0.2900 + 0.2300i -0.2030 + 0.1332i -0.0739 – 0.1924i 0.2089 – 0.0371i 0.0000 + 0.0000i
-0.0445 – 0.4460i -0.0758 – 0.2465i -0.4168 + 0.3376i -0.5328 + 0.0341i -0.2467 – 0.0430i -0.1713 + 0.1603i 0.0220 + 0.2039i 0.0000 – 0.0000i
0.3210 – 0.2306i -0.2904 + 0.1641i 0.3409 + 0.4428i 0.0806 – 0.4949i 0.0400 – 0.2456i 0.1073 + 0.1394i 0.2399 – 0.1355i 0.0000 – 0.0000i
0.0000 – 0.0000i 0.1304 – 0.0722i -0.2064 + 0.0175i 0.0769 – 0.0629i -0.2355 + 0.1429i 0.2359 – 0.0767i 0.2660 – 0.3031i -0.3953 + 0.6846i
-0.0000 + 0.0000i 0.2267 – 0.0899i -0.2537 + 0.0585i -0.1151 + 0.1335i 0.1507 – 0.1648i 0.2370 – 0.2627i 0.4938 – 0.4630i 0.2283 – 0.3953i
-0.0000 – 0.0000i -0.0689 – 0.1710i 0.0363 – 0.2315i 0.0199 + 0.2998i 0.0948 – 0.6211i -0.0523 + 0.5134i -0.0370 – 0.2328i 0.1614 + 0.2795i
-0.0000 + 0.0000i 0.2904 + 0.0000i 0.1855 + 0.0000i 0.2623 + 0.0000i -0.5286 + 0.0000i -0.5890 + 0.0000i 0.3516 + 0.0000i 0.2500 + 0.0000i];
Uk_on_work = [-0.5581 – 0.2520i -0.4914 – 0.1718i -0.1074 – 0.3017i 0.2309 – 0.2705i -0.0962 + 0.0850i -0.1447 – 0.2249i -0.1924 + 0.0017i -0.0000 + 0.0000i
0.4717 + 0.2130i -0.5796 – 0.1237i 0.1084 – 0.2927i -0.2900 + 0.2300i 0.2030 – 0.1332i -0.0739 – 0.1924i -0.2089 + 0.0371i 0.0000 + 0.0000i
-0.0445 – 0.4460i -0.0758 – 0.2465i -0.4168 + 0.3376i -0.5328 + 0.0341i 0.2467 + 0.0430i -0.1713 + 0.1603i -0.0220 – 0.2039i 0.0000 – 0.0000i
0.3210 – 0.2306i -0.2904 + 0.1641i 0.3409 + 0.4428i 0.0806 – 0.4949i -0.0400 + 0.2456i 0.1073 + 0.1394i -0.2399 + 0.1355i 0.0000 – 0.0000i
0.0000 – 0.0000i 0.1304 – 0.0722i -0.2064 + 0.0175i 0.0769 – 0.0629i 0.2355 – 0.1429i 0.2359 – 0.0767i -0.2660 + 0.3031i -0.3953 + 0.6846i
-0.0000 + 0.0000i 0.2267 – 0.0899i -0.2537 + 0.0585i -0.1151 + 0.1335i -0.1507 + 0.1648i 0.2370 – 0.2627i -0.4938 + 0.4630i 0.2283 – 0.3953i
-0.0000 – 0.0000i -0.0689 – 0.1710i 0.0363 – 0.2315i 0.0199 + 0.2998i -0.0948 + 0.6211i -0.0523 + 0.5134i 0.0370 + 0.2328i 0.1614 + 0.2795i
-0.0000 + 0.0000i 0.2904 + 0.0000i 0.1855 + 0.0000i 0.2623 + 0.0000i 0.5286 + 0.0000i -0.5890 + 0.0000i -0.3516 + 0.0000i 0.2500 + 0.0000i];In the following code, when I add the term eye(8)*(0.0001) to the matrix F, my laptop and my work computer return different values for the variable Uk. Could anyone please help me understand what is happening?
I am using MATLAB R2024a on both computers.
clear; clc;
% constants
a = 1;
x1 = 1;
x2 = 0;
x4 = 0;
lambda = 1;
sigma3 = diag([1 1 1 1 -1 -1 -1 -1]);
kx = -2.0944;
ky = -3.6276;
F = [ – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, – lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 – 4.082e-17i) – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 + 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 + 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 – 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 – 2.721e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 – 1.347i), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), 0, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 – 8.164e-17i) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 – 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 – 5.443e-17i)), – lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 – 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.6667 + 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.25i – a*ky*0.433i)*(0.8889 + 1.11e-16i)), – lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.3333 + 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 – 1.155i) – 1.0*x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 + 5.551e-17i))
– lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 + 4.082e-17i) – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 – 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 – 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 – 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 – 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 + 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 + 2.721e-17i)), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 – 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 – 8.164e-17i) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 – 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 – 5.443e-17i)), 0, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.6667 – 1.027e-33i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*1.54i – 1.0*x4*lambda^3*(0.4444*exp(- a*kx*0.25i – a*ky*0.433i) + 0.4444*exp(a*kx*0.25i + a*ky*0.433i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 – 1.027e-33i) – 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i – a*ky*0.433i))
lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 – 0.1925i), – lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 – 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.6667 + 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.25i – a*ky*0.433i)*(0.8889 + 1.11e-16i)), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.6667 – 1.027e-33i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(1.257 + 1.54i), 0, 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 – 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 – 1.388e-17i))
lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 – 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 – 1.347i), lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 + 0.1925i), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, – lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.3333 + 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 – 1.155i) – 1.0*x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 + 5.551e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 – 1.027e-33i) – 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i – a*ky*0.433i)), 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 – 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 – 1.388e-17i)), 0
0, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 + 8.164e-17i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 + 5.443e-17i)), – lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 + 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.6667 – 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 – 1.11e-16i) + exp(a*kx*0.25i – a*ky*0.433i)*(0.8889 – 1.11e-16i)), – lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.3333 – 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 + 1.155i) – 1.0*x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i)*(0.8889 – 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 – 5.551e-17i)), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, – lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 + 4.082e-17i) – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 – 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 – 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 – 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 – 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 + 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 + 2.721e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 – 0.1925i)
lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 + 8.164e-17i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 + 5.443e-17i)), 0, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.6667 + 1.027e-33i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(1.257 – 1.54i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 + 1.027e-33i) – 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i – a*ky*0.433i)), – lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 – 4.082e-17i) – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 + 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 + 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 – 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 – 2.721e-17i)), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 – 1.347i)
– lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 + 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.6667 – 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 – 1.11e-16i) + exp(a*kx*0.25i – a*ky*0.433i)*(0.8889 – 1.11e-16i)), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.6667 + 1.027e-33i) + x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*1.54i – 1.0*x4*lambda^3*(0.4444*exp(- a*kx*0.25i – a*ky*0.433i) + 0.4444*exp(a*kx*0.25i + a*ky*0.433i)), 0, 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 + 1.388e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 – 1.347i), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 – 0.1925i), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 + 0.1925i)
– lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.3333 – 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 + 1.155i) – 1.0*x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i)*(0.8889 – 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 – 5.551e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 + 1.027e-33i) – 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i – a*ky*0.433i)), 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 + 1.388e-17i)), 0, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 – 0.1925i), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda
];
FF = F; % this gives same "Uk" on both computers
FF = F + eye(8)*(0.0001); % this gives different "Uk" on both computers
K = chol(FF,"upper");
Q = K*sigma3*(K’); % Q is same on both computers
[RV,D,~] = eig(Q);
[D,I] = sort(diag(real(D)),’descend’);
RV = RV(:, I);
Uk = RV;
Lk = diag(D);
% more specifically i get these results with "FF = F + eye(8)*(0.0001)":
Uk_on_laptop = [-0.5581 – 0.2520i -0.4914 – 0.1718i -0.1074 – 0.3017i 0.2309 – 0.2705i 0.0962 – 0.0850i -0.1447 – 0.2249i 0.1924 – 0.0017i -0.0000 + 0.0000i
0.4717 + 0.2130i -0.5796 – 0.1237i 0.1084 – 0.2927i -0.2900 + 0.2300i -0.2030 + 0.1332i -0.0739 – 0.1924i 0.2089 – 0.0371i 0.0000 + 0.0000i
-0.0445 – 0.4460i -0.0758 – 0.2465i -0.4168 + 0.3376i -0.5328 + 0.0341i -0.2467 – 0.0430i -0.1713 + 0.1603i 0.0220 + 0.2039i 0.0000 – 0.0000i
0.3210 – 0.2306i -0.2904 + 0.1641i 0.3409 + 0.4428i 0.0806 – 0.4949i 0.0400 – 0.2456i 0.1073 + 0.1394i 0.2399 – 0.1355i 0.0000 – 0.0000i
0.0000 – 0.0000i 0.1304 – 0.0722i -0.2064 + 0.0175i 0.0769 – 0.0629i -0.2355 + 0.1429i 0.2359 – 0.0767i 0.2660 – 0.3031i -0.3953 + 0.6846i
-0.0000 + 0.0000i 0.2267 – 0.0899i -0.2537 + 0.0585i -0.1151 + 0.1335i 0.1507 – 0.1648i 0.2370 – 0.2627i 0.4938 – 0.4630i 0.2283 – 0.3953i
-0.0000 – 0.0000i -0.0689 – 0.1710i 0.0363 – 0.2315i 0.0199 + 0.2998i 0.0948 – 0.6211i -0.0523 + 0.5134i -0.0370 – 0.2328i 0.1614 + 0.2795i
-0.0000 + 0.0000i 0.2904 + 0.0000i 0.1855 + 0.0000i 0.2623 + 0.0000i -0.5286 + 0.0000i -0.5890 + 0.0000i 0.3516 + 0.0000i 0.2500 + 0.0000i];
Uk_on_work = [-0.5581 – 0.2520i -0.4914 – 0.1718i -0.1074 – 0.3017i 0.2309 – 0.2705i -0.0962 + 0.0850i -0.1447 – 0.2249i -0.1924 + 0.0017i -0.0000 + 0.0000i
0.4717 + 0.2130i -0.5796 – 0.1237i 0.1084 – 0.2927i -0.2900 + 0.2300i 0.2030 – 0.1332i -0.0739 – 0.1924i -0.2089 + 0.0371i 0.0000 + 0.0000i
-0.0445 – 0.4460i -0.0758 – 0.2465i -0.4168 + 0.3376i -0.5328 + 0.0341i 0.2467 + 0.0430i -0.1713 + 0.1603i -0.0220 – 0.2039i 0.0000 – 0.0000i
0.3210 – 0.2306i -0.2904 + 0.1641i 0.3409 + 0.4428i 0.0806 – 0.4949i -0.0400 + 0.2456i 0.1073 + 0.1394i -0.2399 + 0.1355i 0.0000 – 0.0000i
0.0000 – 0.0000i 0.1304 – 0.0722i -0.2064 + 0.0175i 0.0769 – 0.0629i 0.2355 – 0.1429i 0.2359 – 0.0767i -0.2660 + 0.3031i -0.3953 + 0.6846i
-0.0000 + 0.0000i 0.2267 – 0.0899i -0.2537 + 0.0585i -0.1151 + 0.1335i -0.1507 + 0.1648i 0.2370 – 0.2627i -0.4938 + 0.4630i 0.2283 – 0.3953i
-0.0000 – 0.0000i -0.0689 – 0.1710i 0.0363 – 0.2315i 0.0199 + 0.2998i -0.0948 + 0.6211i -0.0523 + 0.5134i 0.0370 + 0.2328i 0.1614 + 0.2795i
-0.0000 + 0.0000i 0.2904 + 0.0000i 0.1855 + 0.0000i 0.2623 + 0.0000i 0.5286 + 0.0000i -0.5890 + 0.0000i -0.3516 + 0.0000i 0.2500 + 0.0000i]; In the following code, when I add the term eye(8)*(0.0001) to the matrix F, my laptop and my work computer return different values for the variable Uk. Could anyone please help me understand what is happening?
I am using MATLAB R2024a on both computers.
clear; clc;
% constants
a = 1;
x1 = 1;
x2 = 0;
x4 = 0;
lambda = 1;
sigma3 = diag([1 1 1 1 -1 -1 -1 -1]);
kx = -2.0944;
ky = -3.6276;
F = [ – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, – lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 – 4.082e-17i) – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 + 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 + 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 – 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 – 2.721e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 – 1.347i), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), 0, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 – 8.164e-17i) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 – 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 – 5.443e-17i)), – lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 – 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.6667 + 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.25i – a*ky*0.433i)*(0.8889 + 1.11e-16i)), – lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.3333 + 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 – 1.155i) – 1.0*x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 + 5.551e-17i))
– lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 + 4.082e-17i) – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 – 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 – 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 – 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 – 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 + 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 + 2.721e-17i)), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 – 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 – 8.164e-17i) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 – 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 – 5.443e-17i)), 0, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.6667 – 1.027e-33i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*1.54i – 1.0*x4*lambda^3*(0.4444*exp(- a*kx*0.25i – a*ky*0.433i) + 0.4444*exp(a*kx*0.25i + a*ky*0.433i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 – 1.027e-33i) – 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i – a*ky*0.433i))
lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 – 0.1925i), – lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 – 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.6667 + 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.25i – a*ky*0.433i)*(0.8889 + 1.11e-16i)), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.6667 – 1.027e-33i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(1.257 + 1.54i), 0, 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 – 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 – 1.388e-17i))
lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 – 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 – 1.347i), lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 + 0.1925i), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, – lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.3333 + 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 – 1.155i) – 1.0*x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 + 5.551e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 – 1.027e-33i) – 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i – a*ky*0.433i)), 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) + x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 – 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 – 1.388e-17i)), 0
0, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 + 8.164e-17i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 + 5.443e-17i)), – lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 + 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.6667 – 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 – 1.11e-16i) + exp(a*kx*0.25i – a*ky*0.433i)*(0.8889 – 1.11e-16i)), – lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.3333 – 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 + 1.155i) – 1.0*x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i)*(0.8889 – 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 – 5.551e-17i)), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, – lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 + 4.082e-17i) – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 – 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 – 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 – 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 – 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 + 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 + 2.721e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 – 0.1925i)
lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.6667 + 8.164e-17i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 5.443e-17i) + exp(a*kx*0.5i)*(0.4444 + 5.443e-17i)), 0, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.6667 + 1.027e-33i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(1.257 – 1.54i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 + 1.027e-33i) – 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i – a*ky*0.433i)), – lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.3333 – 4.082e-17i) – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 5.551e-17i) + exp(a*kx*0.5i)*(0.8889 + 5.551e-17i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.8889 + 1.11e-16i) + exp(a*kx*0.5i)*(0.8889 + 1.11e-16i)) + x4*lambda^3*(exp(-a*kx*0.5i)*(0.2222 – 2.721e-17i) + exp(a*kx*0.5i)*(0.2222 – 2.721e-17i)), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 – 1.347i)
– lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.3333 + 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.6667 – 0.3849i) + x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i)*(0.8889 – 1.11e-16i) + exp(a*kx*0.25i – a*ky*0.433i)*(0.8889 – 1.11e-16i)), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.6667 + 1.027e-33i) + x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*1.54i – 1.0*x4*lambda^3*(0.4444*exp(- a*kx*0.25i – a*ky*0.433i) + 0.4444*exp(a*kx*0.25i + a*ky*0.433i)), 0, 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 + 1.388e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 – 1.347i), lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 – 0.1925i), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda, lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 + 0.1925i)
– lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.3333 – 0.5774i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.2222 + 1.155i) – 1.0*x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i)*(0.8889 – 5.551e-17i) + exp(a*kx*0.25i + a*ky*0.433i)*(0.8889 – 5.551e-17i)), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.6667 + 1.027e-33i) – 0.8889*x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x4*lambda^3*(0.4444*exp(- a*kx*0.25i + a*ky*0.433i) + 0.4444*exp(a*kx*0.25i – a*ky*0.433i)), 0.6667*lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*1.54i – 1.0*x4*lambda^3*(exp(-a*kx*0.5i)*(0.4444 + 1.388e-17i) + exp(a*kx*0.5i)*(0.4444 + 1.388e-17i)), 0, lambda*(x1*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i)) + x2*(exp(- a*kx*0.75i + a*ky*0.433i) + exp(a*kx*0.75i – a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i – a*ky*0.433i) + exp(a*kx*0.25i + a*ky*0.433i))*(0.1111 + 0.1925i), lambda*(x1*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i)) + x2*(exp(- a*kx*0.75i – a*ky*0.433i) + exp(a*kx*0.75i + a*ky*0.433i)))*(0.1667 + 0.2887i) – x4*lambda^3*(exp(- a*kx*0.25i + a*ky*0.433i) + exp(a*kx*0.25i – a*ky*0.433i))*(0.7778 + 1.347i), lambda*(x2*(exp(-a*ky*0.866i) + exp(a*ky*0.866i)) + x1*(exp(-a*kx*0.5i) + exp(a*kx*0.5i)))*(0.1667 – 0.2887i) – x4*lambda^3*(exp(-a*kx*0.5i) + exp(a*kx*0.5i))*(0.1111 – 0.1925i), – 0.4444*x4*lambda^3 + (2.0*x1 + 2.0*x2)*lambda
];
FF = F; % this gives same "Uk" on both computers
FF = F + eye(8)*(0.0001); % this gives different "Uk" on both computers
K = chol(FF,"upper");
Q = K*sigma3*(K’); % Q is same on both computers
[RV,D,~] = eig(Q);
[D,I] = sort(diag(real(D)),’descend’);
RV = RV(:, I);
Uk = RV;
Lk = diag(D);
% more specifically i get these results with "FF = F + eye(8)*(0.0001)":
Uk_on_laptop = [-0.5581 – 0.2520i -0.4914 – 0.1718i -0.1074 – 0.3017i 0.2309 – 0.2705i 0.0962 – 0.0850i -0.1447 – 0.2249i 0.1924 – 0.0017i -0.0000 + 0.0000i
0.4717 + 0.2130i -0.5796 – 0.1237i 0.1084 – 0.2927i -0.2900 + 0.2300i -0.2030 + 0.1332i -0.0739 – 0.1924i 0.2089 – 0.0371i 0.0000 + 0.0000i
-0.0445 – 0.4460i -0.0758 – 0.2465i -0.4168 + 0.3376i -0.5328 + 0.0341i -0.2467 – 0.0430i -0.1713 + 0.1603i 0.0220 + 0.2039i 0.0000 – 0.0000i
0.3210 – 0.2306i -0.2904 + 0.1641i 0.3409 + 0.4428i 0.0806 – 0.4949i 0.0400 – 0.2456i 0.1073 + 0.1394i 0.2399 – 0.1355i 0.0000 – 0.0000i
0.0000 – 0.0000i 0.1304 – 0.0722i -0.2064 + 0.0175i 0.0769 – 0.0629i -0.2355 + 0.1429i 0.2359 – 0.0767i 0.2660 – 0.3031i -0.3953 + 0.6846i
-0.0000 + 0.0000i 0.2267 – 0.0899i -0.2537 + 0.0585i -0.1151 + 0.1335i 0.1507 – 0.1648i 0.2370 – 0.2627i 0.4938 – 0.4630i 0.2283 – 0.3953i
-0.0000 – 0.0000i -0.0689 – 0.1710i 0.0363 – 0.2315i 0.0199 + 0.2998i 0.0948 – 0.6211i -0.0523 + 0.5134i -0.0370 – 0.2328i 0.1614 + 0.2795i
-0.0000 + 0.0000i 0.2904 + 0.0000i 0.1855 + 0.0000i 0.2623 + 0.0000i -0.5286 + 0.0000i -0.5890 + 0.0000i 0.3516 + 0.0000i 0.2500 + 0.0000i];
Uk_on_work = [-0.5581 – 0.2520i -0.4914 – 0.1718i -0.1074 – 0.3017i 0.2309 – 0.2705i -0.0962 + 0.0850i -0.1447 – 0.2249i -0.1924 + 0.0017i -0.0000 + 0.0000i
0.4717 + 0.2130i -0.5796 – 0.1237i 0.1084 – 0.2927i -0.2900 + 0.2300i 0.2030 – 0.1332i -0.0739 – 0.1924i -0.2089 + 0.0371i 0.0000 + 0.0000i
-0.0445 – 0.4460i -0.0758 – 0.2465i -0.4168 + 0.3376i -0.5328 + 0.0341i 0.2467 + 0.0430i -0.1713 + 0.1603i -0.0220 – 0.2039i 0.0000 – 0.0000i
0.3210 – 0.2306i -0.2904 + 0.1641i 0.3409 + 0.4428i 0.0806 – 0.4949i -0.0400 + 0.2456i 0.1073 + 0.1394i -0.2399 + 0.1355i 0.0000 – 0.0000i
0.0000 – 0.0000i 0.1304 – 0.0722i -0.2064 + 0.0175i 0.0769 – 0.0629i 0.2355 – 0.1429i 0.2359 – 0.0767i -0.2660 + 0.3031i -0.3953 + 0.6846i
-0.0000 + 0.0000i 0.2267 – 0.0899i -0.2537 + 0.0585i -0.1151 + 0.1335i -0.1507 + 0.1648i 0.2370 – 0.2627i -0.4938 + 0.4630i 0.2283 – 0.3953i
-0.0000 – 0.0000i -0.0689 – 0.1710i 0.0363 – 0.2315i 0.0199 + 0.2998i -0.0948 + 0.6211i -0.0523 + 0.5134i 0.0370 + 0.2328i 0.1614 + 0.2795i
-0.0000 + 0.0000i 0.2904 + 0.0000i 0.1855 + 0.0000i 0.2623 + 0.0000i 0.5286 + 0.0000i -0.5890 + 0.0000i -0.3516 + 0.0000i 0.2500 + 0.0000i]; system, eigenvalue, eig MATLAB Answers — New Questions
Answer to Moving Windows section of the “Calculations with Vectors and Matrices” online course is identical to solution but marked wrong. How to get credit?
I’m taking the "Calculations with Vectors and Matrices" self-paced online course, but I’m not getting due credit for the section on Moving WIndow Calculations. I have screenshots to prove that even an answer that is identical to the one under "See solution" (which I reached indenpendently) is marked as wrong, saying I haven’t added minUsage and maxUsage to the plot. I’ve tried many different ways of recalculating, reformatting, and resubmitting Task 4, including eliminating the section break between the problem setup and Task 1 because I suspected that the duplication of the original plot from the setup to Task 1 might be part of the issue, but even that didn’t fix it. At this point, the only way I can get full credit for the course is if someone on the admin side can override the spurious error.I’m taking the "Calculations with Vectors and Matrices" self-paced online course, but I’m not getting due credit for the section on Moving WIndow Calculations. I have screenshots to prove that even an answer that is identical to the one under "See solution" (which I reached indenpendently) is marked as wrong, saying I haven’t added minUsage and maxUsage to the plot. I’ve tried many different ways of recalculating, reformatting, and resubmitting Task 4, including eliminating the section break between the problem setup and Task 1 because I suspected that the duplication of the original plot from the setup to Task 1 might be part of the issue, but even that didn’t fix it. At this point, the only way I can get full credit for the course is if someone on the admin side can override the spurious error. I’m taking the "Calculations with Vectors and Matrices" self-paced online course, but I’m not getting due credit for the section on Moving WIndow Calculations. I have screenshots to prove that even an answer that is identical to the one under "See solution" (which I reached indenpendently) is marked as wrong, saying I haven’t added minUsage and maxUsage to the plot. I’ve tried many different ways of recalculating, reformatting, and resubmitting Task 4, including eliminating the section break between the problem setup and Task 1 because I suspected that the duplication of the original plot from the setup to Task 1 might be part of the issue, but even that didn’t fix it. At this point, the only way I can get full credit for the course is if someone on the admin side can override the spurious error. online course, error, self-paced, moving window MATLAB Answers — New Questions
Data in msec is not displayed
Hello,
I am recording data each 100msec and send it in a bulk data JSON each 30 sec. I only receave data in thingspeak with a time stamp of 1 second, and not those in between each second (I mis 9 measurements each second)
part of the JSON string:
[{ "created_at":"2024-08-12 17:10:55.797Z","field1":817},{ "created_at":"2024-08-12 17:10:55.920Z","field1":864},{ "created_at":"2024-08-12 17:10:56.043Z","field1":856}…
is there a way to visualise all the data?Hello,
I am recording data each 100msec and send it in a bulk data JSON each 30 sec. I only receave data in thingspeak with a time stamp of 1 second, and not those in between each second (I mis 9 measurements each second)
part of the JSON string:
[{ "created_at":"2024-08-12 17:10:55.797Z","field1":817},{ "created_at":"2024-08-12 17:10:55.920Z","field1":864},{ "created_at":"2024-08-12 17:10:56.043Z","field1":856}…
is there a way to visualise all the data? Hello,
I am recording data each 100msec and send it in a bulk data JSON each 30 sec. I only receave data in thingspeak with a time stamp of 1 second, and not those in between each second (I mis 9 measurements each second)
part of the JSON string:
[{ "created_at":"2024-08-12 17:10:55.797Z","field1":817},{ "created_at":"2024-08-12 17:10:55.920Z","field1":864},{ "created_at":"2024-08-12 17:10:56.043Z","field1":856}…
is there a way to visualise all the data? json, msec MATLAB Answers — New Questions
How can I write data repeatedly to an Excel file on a network drive from MATLAB R2024a?
I have a MATLAB script where I am using repeated calls to "writematrix" to write data to an Excel file on a network drive. The script will sometimes run successfully, but sometimes it fails at various lines with the following error.
Unable to write to file ‘…’ You might not have write permissions or the file might be open by another application.
I am looking for a consistent approach to write all of my data to this Excel file.I have a MATLAB script where I am using repeated calls to "writematrix" to write data to an Excel file on a network drive. The script will sometimes run successfully, but sometimes it fails at various lines with the following error.
Unable to write to file ‘…’ You might not have write permissions or the file might be open by another application.
I am looking for a consistent approach to write all of my data to this Excel file. I have a MATLAB script where I am using repeated calls to "writematrix" to write data to an Excel file on a network drive. The script will sometimes run successfully, but sometimes it fails at various lines with the following error.
Unable to write to file ‘…’ You might not have write permissions or the file might be open by another application.
I am looking for a consistent approach to write all of my data to this Excel file. writematrix MATLAB Answers — New Questions
Why is my GPU not detected by Parallel Computing Toolbox?
When I execute "gpuDevice" command in MATLAB command prompt on a machine with a supported GPU installed, I get the following error message:
ERROR: >> gpuDeviceError using gpuDevice (line 26)
No supported GPU device was found on this computer. To learn more about supported GPU devices, see
www.mathworks.com/gpudevice.When I execute "gpuDevice" command in MATLAB command prompt on a machine with a supported GPU installed, I get the following error message:
ERROR: >> gpuDeviceError using gpuDevice (line 26)
No supported GPU device was found on this computer. To learn more about supported GPU devices, see
www.mathworks.com/gpudevice. When I execute "gpuDevice" command in MATLAB command prompt on a machine with a supported GPU installed, I get the following error message:
ERROR: >> gpuDeviceError using gpuDevice (line 26)
No supported GPU device was found on this computer. To learn more about supported GPU devices, see
www.mathworks.com/gpudevice. gpu, nvidia, gpudevice MATLAB Answers — New Questions
How does Parallel Computing Toolbox handle Performance and Efficiency core usage?
I have a computer with a CPU where the architecture has been split into Performance Cores and Efficiency Cores (P and E cores). I would like to use this with Parallel Computing Toolbox but I am unsure how many workers to run and whether I should be using both types of cores?I have a computer with a CPU where the architecture has been split into Performance Cores and Efficiency Cores (P and E cores). I would like to use this with Parallel Computing Toolbox but I am unsure how many workers to run and whether I should be using both types of cores? I have a computer with a CPU where the architecture has been split into Performance Cores and Efficiency Cores (P and E cores). I would like to use this with Parallel Computing Toolbox but I am unsure how many workers to run and whether I should be using both types of cores? cores, parallel, numworkers MATLAB Answers — New Questions
Where can I find a comprehensive explanation of the Filter Design tools available in Matlab?
I have been trying to learn about the filter design tools avaialable in Matlab so that I can make an informed decision about which tools I need to use for particular applications. Unfortunately, I have not found a comprehensive explanation. Instead, I have learned that there appear to be tools in the Signal Processing Tollbox as well as the DSP System toolbox. Some of these tools are GUI-based, and others are functions, but many of them seem to have overlapping features. Both toolboxes appear to have unique data objects for storing filter designs, but I cannot find references to tools for converting between data types. Normally, I use the low-level functions like BUTTER to generate analog or digital filter designs and I will either store these as NUM & DEN arrays or as LTI objects. I also cannot find any reference for how I can convert either NUM,DEN or LTI object formats to any of the unique data objects in the digital filter design/analysis GUI’s. This is incredibly confusing and is not what I am used to with regard to traditional MathWorks documentation. Please direct me to a comprehensive reference on all of the digital filter design tools supported by MathWorks. I really hope that I don’t have to read all of the documentation for every tool just to figure out which one I need to use…I have been trying to learn about the filter design tools avaialable in Matlab so that I can make an informed decision about which tools I need to use for particular applications. Unfortunately, I have not found a comprehensive explanation. Instead, I have learned that there appear to be tools in the Signal Processing Tollbox as well as the DSP System toolbox. Some of these tools are GUI-based, and others are functions, but many of them seem to have overlapping features. Both toolboxes appear to have unique data objects for storing filter designs, but I cannot find references to tools for converting between data types. Normally, I use the low-level functions like BUTTER to generate analog or digital filter designs and I will either store these as NUM & DEN arrays or as LTI objects. I also cannot find any reference for how I can convert either NUM,DEN or LTI object formats to any of the unique data objects in the digital filter design/analysis GUI’s. This is incredibly confusing and is not what I am used to with regard to traditional MathWorks documentation. Please direct me to a comprehensive reference on all of the digital filter design tools supported by MathWorks. I really hope that I don’t have to read all of the documentation for every tool just to figure out which one I need to use… I have been trying to learn about the filter design tools avaialable in Matlab so that I can make an informed decision about which tools I need to use for particular applications. Unfortunately, I have not found a comprehensive explanation. Instead, I have learned that there appear to be tools in the Signal Processing Tollbox as well as the DSP System toolbox. Some of these tools are GUI-based, and others are functions, but many of them seem to have overlapping features. Both toolboxes appear to have unique data objects for storing filter designs, but I cannot find references to tools for converting between data types. Normally, I use the low-level functions like BUTTER to generate analog or digital filter designs and I will either store these as NUM & DEN arrays or as LTI objects. I also cannot find any reference for how I can convert either NUM,DEN or LTI object formats to any of the unique data objects in the digital filter design/analysis GUI’s. This is incredibly confusing and is not what I am used to with regard to traditional MathWorks documentation. Please direct me to a comprehensive reference on all of the digital filter design tools supported by MathWorks. I really hope that I don’t have to read all of the documentation for every tool just to figure out which one I need to use… filter design, digital filter MATLAB Answers — New Questions
Is there a variant of nlfilter for color images?
I need to perform quite a complex operation on color image using sliding window way. Is there any variant for RGB images?I need to perform quite a complex operation on color image using sliding window way. Is there any variant for RGB images? I need to perform quite a complex operation on color image using sliding window way. Is there any variant for RGB images? sliding window, nlfilter, image processing MATLAB Answers — New Questions
How to Fix Polyspace CodeProver Orange Overflow errors
Hello,
I am getting the below Orange Overflow error due to operator *
How to fix these Overflow errors as we know this operation is not going to generate a result bigger than the datatype of int32 ?Hello,
I am getting the below Orange Overflow error due to operator *
How to fix these Overflow errors as we know this operation is not going to generate a result bigger than the datatype of int32 ? Hello,
I am getting the below Orange Overflow error due to operator *
How to fix these Overflow errors as we know this operation is not going to generate a result bigger than the datatype of int32 ? codeprover, overflow, *operator MATLAB Answers — New Questions
Why are the final values for velocity and acceleration from bsplinepolytraj() always equal to zero?
When creating splines using bsplinepolytraj() the last values for the x and y component of velocity and acceleration are always zero. Here’s an example from the documentation:
% Interpolate with B-Spline
% Create waypoints to interpolate with a B-Spline.
wpts1 = [0 1 2.1 8 4 3];
wpts2 = [0 1 1.3 .8 .3 .3];
wpts = [wpts1; wpts2];
L = length(wpts) – 1;
% Form matrices used to compute interior points of control polygon
r = zeros(L+1, size(wpts,1));
A = eye(L+1);
for i= 1:(L-1)
A(i+1,(i):(i+2)) = [1 4 1];
r(i+1,:) = 6*wpts(:,i+1)’;
end
% Override end points and choose r0 and rL.
A(2,1:3) = [3/2 7/2 1];
A(L,(L-1):(L+1)) = [1 7/2 3/2];
r(1,:) = (wpts(:,1) + (wpts(:,2) – wpts(:,1))/2)’;
r(end,:) = (wpts(:,end-1) + (wpts(:,end) – wpts(:,end-1))/2)’;
dInterior = (Ar)’;
% Construct a complete control polygon and use bsplinepolytraj to compute a polynomial with the new control points
cpts = [wpts(:,1) dInterior wpts(:,end)];
t = 0:0.01:1;
[q, dq, ddq, ~] = bsplinepolytraj(cpts, [0 1], t);
The values for
disp(dq(:,end))
and
disp(ddq(:, end))
I feel like this is wrong. Why are these values zero and how can I get a non-zero answer?When creating splines using bsplinepolytraj() the last values for the x and y component of velocity and acceleration are always zero. Here’s an example from the documentation:
% Interpolate with B-Spline
% Create waypoints to interpolate with a B-Spline.
wpts1 = [0 1 2.1 8 4 3];
wpts2 = [0 1 1.3 .8 .3 .3];
wpts = [wpts1; wpts2];
L = length(wpts) – 1;
% Form matrices used to compute interior points of control polygon
r = zeros(L+1, size(wpts,1));
A = eye(L+1);
for i= 1:(L-1)
A(i+1,(i):(i+2)) = [1 4 1];
r(i+1,:) = 6*wpts(:,i+1)’;
end
% Override end points and choose r0 and rL.
A(2,1:3) = [3/2 7/2 1];
A(L,(L-1):(L+1)) = [1 7/2 3/2];
r(1,:) = (wpts(:,1) + (wpts(:,2) – wpts(:,1))/2)’;
r(end,:) = (wpts(:,end-1) + (wpts(:,end) – wpts(:,end-1))/2)’;
dInterior = (Ar)’;
% Construct a complete control polygon and use bsplinepolytraj to compute a polynomial with the new control points
cpts = [wpts(:,1) dInterior wpts(:,end)];
t = 0:0.01:1;
[q, dq, ddq, ~] = bsplinepolytraj(cpts, [0 1], t);
The values for
disp(dq(:,end))
and
disp(ddq(:, end))
I feel like this is wrong. Why are these values zero and how can I get a non-zero answer? When creating splines using bsplinepolytraj() the last values for the x and y component of velocity and acceleration are always zero. Here’s an example from the documentation:
% Interpolate with B-Spline
% Create waypoints to interpolate with a B-Spline.
wpts1 = [0 1 2.1 8 4 3];
wpts2 = [0 1 1.3 .8 .3 .3];
wpts = [wpts1; wpts2];
L = length(wpts) – 1;
% Form matrices used to compute interior points of control polygon
r = zeros(L+1, size(wpts,1));
A = eye(L+1);
for i= 1:(L-1)
A(i+1,(i):(i+2)) = [1 4 1];
r(i+1,:) = 6*wpts(:,i+1)’;
end
% Override end points and choose r0 and rL.
A(2,1:3) = [3/2 7/2 1];
A(L,(L-1):(L+1)) = [1 7/2 3/2];
r(1,:) = (wpts(:,1) + (wpts(:,2) – wpts(:,1))/2)’;
r(end,:) = (wpts(:,end-1) + (wpts(:,end) – wpts(:,end-1))/2)’;
dInterior = (Ar)’;
% Construct a complete control polygon and use bsplinepolytraj to compute a polynomial with the new control points
cpts = [wpts(:,1) dInterior wpts(:,end)];
t = 0:0.01:1;
[q, dq, ddq, ~] = bsplinepolytraj(cpts, [0 1], t);
The values for
disp(dq(:,end))
and
disp(ddq(:, end))
I feel like this is wrong. Why are these values zero and how can I get a non-zero answer? bsplinepolytraj, spline, curve fitting, robotics, trajectory MATLAB Answers — New Questions
How do I get run time or system time of my Speedgoat target computer in R2020b?
I’m upgrading from R2019a to R2020b and I can’t find analogous blocks to the "Elapsed Time" and "Time Stamp Delta" blocks to get run time or clock time from my Simulink Real-Time (SLRT) target computer.I’m upgrading from R2019a to R2020b and I can’t find analogous blocks to the "Elapsed Time" and "Time Stamp Delta" blocks to get run time or clock time from my Simulink Real-Time (SLRT) target computer. I’m upgrading from R2019a to R2020b and I can’t find analogous blocks to the "Elapsed Time" and "Time Stamp Delta" blocks to get run time or clock time from my Simulink Real-Time (SLRT) target computer. MATLAB Answers — New Questions
Training a neural network for different operating points
Hello,
i want to train a neural network to predict the temperature of an electrical machine in different operating points.
I have input data in the form of:
4×1 Cell, each cell with 101×3 elements
So the first cell contains the data for the first operating point, the second for the second…
And Target Data:
4×1 Cell, each cell with 101×1 elements
Where the first cell contains data for the first operating point, the second…
My question is now, which input layer i should use, so that the data is treated correctly ?Hello,
i want to train a neural network to predict the temperature of an electrical machine in different operating points.
I have input data in the form of:
4×1 Cell, each cell with 101×3 elements
So the first cell contains the data for the first operating point, the second for the second…
And Target Data:
4×1 Cell, each cell with 101×1 elements
Where the first cell contains data for the first operating point, the second…
My question is now, which input layer i should use, so that the data is treated correctly ? Hello,
i want to train a neural network to predict the temperature of an electrical machine in different operating points.
I have input data in the form of:
4×1 Cell, each cell with 101×3 elements
So the first cell contains the data for the first operating point, the second for the second…
And Target Data:
4×1 Cell, each cell with 101×1 elements
Where the first cell contains data for the first operating point, the second…
My question is now, which input layer i should use, so that the data is treated correctly ? matlab, neural network, deep learning MATLAB Answers — New Questions