Month: July 2024
Plotted data changes when applying custom colormap
Question:
I am working with a very specific custom color map, that i apply to a matrix using imagesc(). When plotting my data with a built in colormap, everything plots as expected. When im using my own colormap, the image itself plots and the colormap works wonderfully. However: The y-coordinates of my matrix shift! The x coordinates are unaffected by this. Everything is plotted within the same figure, the only difference between the figures is the colormap() command. I hope this is a well known problem, however my internet search didnt resolve the issue.
Thanks in advance for anyone who answers!
Appendix:
Plot with built in colormap: Note that the top-right most pixel of my data is at [30, 60]
imagesc(Vertical_Time_Matrix);
Plot with my Colormap: Note that the top-right most pixel of my data is at [30, 78]
imagesc(Vertical_Time_Matrix);
colormap(myColormap);
A few words regarding my colormap and the data. The data is a 220×30 matrix containing numbers ("States") from 1-28. Depending on the state a color is chosen from a color map. Hence, the colormap is 28 entries long.Question:
I am working with a very specific custom color map, that i apply to a matrix using imagesc(). When plotting my data with a built in colormap, everything plots as expected. When im using my own colormap, the image itself plots and the colormap works wonderfully. However: The y-coordinates of my matrix shift! The x coordinates are unaffected by this. Everything is plotted within the same figure, the only difference between the figures is the colormap() command. I hope this is a well known problem, however my internet search didnt resolve the issue.
Thanks in advance for anyone who answers!
Appendix:
Plot with built in colormap: Note that the top-right most pixel of my data is at [30, 60]
imagesc(Vertical_Time_Matrix);
Plot with my Colormap: Note that the top-right most pixel of my data is at [30, 78]
imagesc(Vertical_Time_Matrix);
colormap(myColormap);
A few words regarding my colormap and the data. The data is a 220×30 matrix containing numbers ("States") from 1-28. Depending on the state a color is chosen from a color map. Hence, the colormap is 28 entries long. Question:
I am working with a very specific custom color map, that i apply to a matrix using imagesc(). When plotting my data with a built in colormap, everything plots as expected. When im using my own colormap, the image itself plots and the colormap works wonderfully. However: The y-coordinates of my matrix shift! The x coordinates are unaffected by this. Everything is plotted within the same figure, the only difference between the figures is the colormap() command. I hope this is a well known problem, however my internet search didnt resolve the issue.
Thanks in advance for anyone who answers!
Appendix:
Plot with built in colormap: Note that the top-right most pixel of my data is at [30, 60]
imagesc(Vertical_Time_Matrix);
Plot with my Colormap: Note that the top-right most pixel of my data is at [30, 78]
imagesc(Vertical_Time_Matrix);
colormap(myColormap);
A few words regarding my colormap and the data. The data is a 220×30 matrix containing numbers ("States") from 1-28. Depending on the state a color is chosen from a color map. Hence, the colormap is 28 entries long. colormap, figure MATLAB Answers — New Questions
Hotmail is conflicting with OneDrive through my Microsoft 365 account
I’ve been struggling for about one month, thus far, with my OneDrive through my Microsoft 365 account. Suddenly, my 40-year-old Hotmail account is frozen, and I cannot send, nor receive email because, the system indicates, my OneDrive is full. When I click on that, to be led to my OneDrive, it shows that I have used less than 0.2 GB from the 15 GB allocated space. In the meantime, I cannot use my Hotmail, where I have deleted about 10 GB of files. This has not helped me, and I cannot reach someone from Microsoft for assistance. Does anyone have any clue about how to resolve this mystery?
I’ve been struggling for about one month, thus far, with my OneDrive through my Microsoft 365 account. Suddenly, my 40-year-old Hotmail account is frozen, and I cannot send, nor receive email because, the system indicates, my OneDrive is full. When I click on that, to be led to my OneDrive, it shows that I have used less than 0.2 GB from the 15 GB allocated space. In the meantime, I cannot use my Hotmail, where I have deleted about 10 GB of files. This has not helped me, and I cannot reach someone from Microsoft for assistance. Does anyone have any clue about how to resolve this mystery? Read More
Generating data for a scheduling problem that deals with setup families.
clc
%clear all
x1 = 1:30;
x11 = 1:10;
x2 = 0.2:0.2:1;
x12 = 0.2:0.2:4;
%a = 6:100;%b = 125:25:1000;%c = 1050:50:2500;%cc = 3000:500:10000;%cc1 = 15000:5000:30000;%xx = [a b c cc cc1];%[A, B] = size(xx);%mx = max(xx);
n=input(‘n=’);
data = cell(n, 10, 3);
%families = 1:6;
familiesNumber = [2, 4, 6];
familiesSetup = 1:6;
for F = 1:3
% for j = 1:B
% n = xx(j);
% for ex = 1:10
releaseDate = randsrc(1, n, x1);
processingTime = randsrc(1, n, x11);
tf = randsrc(1, 1, x12);
ddr = randsrc(1, 1, x2);
g = sum(releaseDate);
min_due = tf * (1 – g – ddr / 2);
max_due = tf * (1 – g + ddr / 2);
if min_due < 1, min_due = 1; end % Ensure minimum due date is at least 1
if max_due < min_due, max_due = min_due + 1; end % Ensure range is valid
x = min_due:max_due;%linspace(min_due, max_due, n); % Create a range with n points
dueDate = randsrc(1, n, x); % Generate dueDate within the range
% Ensure dueDate is valid
for i = 1:n
if dueDate(i) < processingTime(i)
dueDate(i) = processingTime(i) + 1;
end
end
f = familiesNumber(F); disp(f);
m = mod(n, f);
nn = n – m;
setupTime = zeros(1, f);
for s = 1:f
setupTime = familiesSetup;
end
disp(setupTime);
nf = zeros(1, f);
if m == 0
for i = 1:f
nf(i) = n / f;
end
else
for i = 1:m
nf(i) = (nn / f) + 1;
end
for ii = m+1:f
nf(ii) = (nn / f);
end
end
disp(nf);
da = [releaseDate; processingTime; dueDate]; %disp(da);
data{n, ex, f} = da;
% end
% end
end
savefile = ‘a_data.mat’;
save(savefile, ‘data’);clc
%clear all
x1 = 1:30;
x11 = 1:10;
x2 = 0.2:0.2:1;
x12 = 0.2:0.2:4;
%a = 6:100;%b = 125:25:1000;%c = 1050:50:2500;%cc = 3000:500:10000;%cc1 = 15000:5000:30000;%xx = [a b c cc cc1];%[A, B] = size(xx);%mx = max(xx);
n=input(‘n=’);
data = cell(n, 10, 3);
%families = 1:6;
familiesNumber = [2, 4, 6];
familiesSetup = 1:6;
for F = 1:3
% for j = 1:B
% n = xx(j);
% for ex = 1:10
releaseDate = randsrc(1, n, x1);
processingTime = randsrc(1, n, x11);
tf = randsrc(1, 1, x12);
ddr = randsrc(1, 1, x2);
g = sum(releaseDate);
min_due = tf * (1 – g – ddr / 2);
max_due = tf * (1 – g + ddr / 2);
if min_due < 1, min_due = 1; end % Ensure minimum due date is at least 1
if max_due < min_due, max_due = min_due + 1; end % Ensure range is valid
x = min_due:max_due;%linspace(min_due, max_due, n); % Create a range with n points
dueDate = randsrc(1, n, x); % Generate dueDate within the range
% Ensure dueDate is valid
for i = 1:n
if dueDate(i) < processingTime(i)
dueDate(i) = processingTime(i) + 1;
end
end
f = familiesNumber(F); disp(f);
m = mod(n, f);
nn = n – m;
setupTime = zeros(1, f);
for s = 1:f
setupTime = familiesSetup;
end
disp(setupTime);
nf = zeros(1, f);
if m == 0
for i = 1:f
nf(i) = n / f;
end
else
for i = 1:m
nf(i) = (nn / f) + 1;
end
for ii = m+1:f
nf(ii) = (nn / f);
end
end
disp(nf);
da = [releaseDate; processingTime; dueDate]; %disp(da);
data{n, ex, f} = da;
% end
% end
end
savefile = ‘a_data.mat’;
save(savefile, ‘data’); clc
%clear all
x1 = 1:30;
x11 = 1:10;
x2 = 0.2:0.2:1;
x12 = 0.2:0.2:4;
%a = 6:100;%b = 125:25:1000;%c = 1050:50:2500;%cc = 3000:500:10000;%cc1 = 15000:5000:30000;%xx = [a b c cc cc1];%[A, B] = size(xx);%mx = max(xx);
n=input(‘n=’);
data = cell(n, 10, 3);
%families = 1:6;
familiesNumber = [2, 4, 6];
familiesSetup = 1:6;
for F = 1:3
% for j = 1:B
% n = xx(j);
% for ex = 1:10
releaseDate = randsrc(1, n, x1);
processingTime = randsrc(1, n, x11);
tf = randsrc(1, 1, x12);
ddr = randsrc(1, 1, x2);
g = sum(releaseDate);
min_due = tf * (1 – g – ddr / 2);
max_due = tf * (1 – g + ddr / 2);
if min_due < 1, min_due = 1; end % Ensure minimum due date is at least 1
if max_due < min_due, max_due = min_due + 1; end % Ensure range is valid
x = min_due:max_due;%linspace(min_due, max_due, n); % Create a range with n points
dueDate = randsrc(1, n, x); % Generate dueDate within the range
% Ensure dueDate is valid
for i = 1:n
if dueDate(i) < processingTime(i)
dueDate(i) = processingTime(i) + 1;
end
end
f = familiesNumber(F); disp(f);
m = mod(n, f);
nn = n – m;
setupTime = zeros(1, f);
for s = 1:f
setupTime = familiesSetup;
end
disp(setupTime);
nf = zeros(1, f);
if m == 0
for i = 1:f
nf(i) = n / f;
end
else
for i = 1:m
nf(i) = (nn / f) + 1;
end
for ii = m+1:f
nf(ii) = (nn / f);
end
end
disp(nf);
da = [releaseDate; processingTime; dueDate]; %disp(da);
data{n, ex, f} = da;
% end
% end
end
savefile = ‘a_data.mat’;
save(savefile, ‘data’); data generating, setup families, matlab, single machine scheduling problem MATLAB Answers — New Questions
Issue with WSL Installation on Windows 11 Insider Program 24H2
I am encountering an issue while trying to install WSL on my Windows 11 Insider Program 24H2. The installation process fails with the following error message:
“`
Installing, this may take a few minutes…
WslRegisterDistribution failed with error: 0x80070003
Error: 0x80070003 The system cannot find the path specified.
Press any key to continue…
“`
This problem started after I accidentally deleted the WSL folder from the Program Files directory. Since then, I have been unable to install WSL (Ubuntu) on my system.
Could someone please guide me on how to resolve this issue?
Thank you in advance for your help!
I am encountering an issue while trying to install WSL on my Windows 11 Insider Program 24H2. The installation process fails with the following error message:“`Installing, this may take a few minutes…WslRegisterDistribution failed with error: 0x80070003Error: 0x80070003 The system cannot find the path specified.Press any key to continue…“`This problem started after I accidentally deleted the WSL folder from the Program Files directory. Since then, I have been unable to install WSL (Ubuntu) on my system.Could someone please guide me on how to resolve this issue?Thank you in advance for your help! Read More
How to connect point by curve instead of line in MTALB plot
Hello, guys. I have some data points. When I plot these points in Matlab, it connects data points by line. However, I want to connect these points using a curve instead of a line graph for good representation. So please suggest to me which function we should use.
Thank you.Hello, guys. I have some data points. When I plot these points in Matlab, it connects data points by line. However, I want to connect these points using a curve instead of a line graph for good representation. So please suggest to me which function we should use.
Thank you. Hello, guys. I have some data points. When I plot these points in Matlab, it connects data points by line. However, I want to connect these points using a curve instead of a line graph for good representation. So please suggest to me which function we should use.
Thank you. plotting, curve, matlab, expert MATLAB Answers — New Questions
Mixed Exchange Server ECP portal not accessible
We have 4 servers, 2 exchange 2013 servers and 2 exchange 2016 servers, if all the servers are on ECP porta is accessible, but if we turn off 2 exchange 2013 servers, then ECP portal is not accessible, checked all the internal & External URL’s for ECP and OWA, checked the bindings, checked, SPN’s, checked DNS and all the configurations are Good, nothing we are able to get from Event logs also
Can anyone help on this… we want to get rid of exchange 2013 and run with exchange 2016 servers
We have 4 servers, 2 exchange 2013 servers and 2 exchange 2016 servers, if all the servers are on ECP porta is accessible, but if we turn off 2 exchange 2013 servers, then ECP portal is not accessible, checked all the internal & External URL’s for ECP and OWA, checked the bindings, checked, SPN’s, checked DNS and all the configurations are Good, nothing we are able to get from Event logs also Can anyone help on this… we want to get rid of exchange 2013 and run with exchange 2016 servers Read More
Windows 11 Can’t Log In and Won’t Let Me Set Pin
Hi all,
Just updated today to Windows 11. Upon my computer restarting, I got a ‘sign in’ button beneath my account instead of a box to enter my pin. When I sign in, it takes me to Microsoft account sign in and says “That Microsoft account doesn’t exist”. Before updating my PC, I changed the account associated with my Microsoft account to an Outlook one from the Gmail one I had been using, which is what comes up when I initially go to log in.
I go through the sign in process with my new email and it takes me to the Create a Pin screen. I click next and it says “Something went wrong. We weren’t able to set up your PIN.” It gives me the option to retry, which just takes me back to the “Something went wrong.”, or “Skip for now”, which takes me back to my computer’s lock screen and makes me go through the whole process again.
What can I do to get back into my computer? I’m not reliant on it for work, but I do have important files and some games installed on there.
Thanks in advance.
Hi all, Just updated today to Windows 11. Upon my computer restarting, I got a ‘sign in’ button beneath my account instead of a box to enter my pin. When I sign in, it takes me to Microsoft account sign in and says “That Microsoft account doesn’t exist”. Before updating my PC, I changed the account associated with my Microsoft account to an Outlook one from the Gmail one I had been using, which is what comes up when I initially go to log in. I go through the sign in process with my new email and it takes me to the Create a Pin screen. I click next and it says “Something went wrong. We weren’t able to set up your PIN.” It gives me the option to retry, which just takes me back to the “Something went wrong.”, or “Skip for now”, which takes me back to my computer’s lock screen and makes me go through the whole process again. What can I do to get back into my computer? I’m not reliant on it for work, but I do have important files and some games installed on there. Thanks in advance. Read More
Unraveling the future of POP3 on Outlook email accounts
Does 365 allow POP3 email?
For email, I use the Outlook 2016 desktop client with POP3. This client software reportedly ends in about 15 months. Is there any way I could stay with both POP3 and Outlook email after next year, other than by using third party clients like Thunderbird or Em-Client? Is it correct that 365 Outlook does not, or soon will not, support POP3 for Outlook email? [I assume outgoing Windows Mail and now Outlook for Windows excludes POP3.]
Does 365 allow POP3 email?For email, I use the Outlook 2016 desktop client with POP3. This client software reportedly ends in about 15 months. Is there any way I could stay with both POP3 and Outlook email after next year, other than by using third party clients like Thunderbird or Em-Client? Is it correct that 365 Outlook does not, or soon will not, support POP3 for Outlook email? [I assume outgoing Windows Mail and now Outlook for Windows excludes POP3.] Read More
How to downsample the 3D matrix in matlab??
Due to computational limitations, I need to downsample the 3D (1500x1500x1700) matrix by a factor of 2. The binning process should merg the 2x2x2 voxels and assign the mean intensity value of the group to the corresponding voxel in the reduced image.Due to computational limitations, I need to downsample the 3D (1500x1500x1700) matrix by a factor of 2. The binning process should merg the 2x2x2 voxels and assign the mean intensity value of the group to the corresponding voxel in the reduced image. Due to computational limitations, I need to downsample the 3D (1500x1500x1700) matrix by a factor of 2. The binning process should merg the 2x2x2 voxels and assign the mean intensity value of the group to the corresponding voxel in the reduced image. downsample, 3d matrix MATLAB Answers — New Questions
how do you develop a simulation software for drying grains using matlab
i am doing my final year project on simulation software for drying grains using mat lab but i do not have an idea on how to start on my methologyi am doing my final year project on simulation software for drying grains using mat lab but i do not have an idea on how to start on my methology i am doing my final year project on simulation software for drying grains using mat lab but i do not have an idea on how to start on my methology simulation, simulation-of-drying MATLAB Answers — New Questions
Unrecognized function or variable ‘efficiency’
I am getting the following error but can’t figure out why.
Unrecognized function or variable ‘efficiency’.
I am using a full version of MATLAB 2024a with an academic license and all of the toolboxes installed on April 3.
I regularly use the functions from the Antenna Toolbox so I am confident that it is installed correctly. I’ve also tried copying the text from the Help Center article to make sure there weren’t any typos.
‘doc efficiency’ and ‘help efficiency’ in the command window work as expected.
Is the ‘efficiency’ function still available in 2024a? Is there any other reason why it might not be recognized?I am getting the following error but can’t figure out why.
Unrecognized function or variable ‘efficiency’.
I am using a full version of MATLAB 2024a with an academic license and all of the toolboxes installed on April 3.
I regularly use the functions from the Antenna Toolbox so I am confident that it is installed correctly. I’ve also tried copying the text from the Help Center article to make sure there weren’t any typos.
‘doc efficiency’ and ‘help efficiency’ in the command window work as expected.
Is the ‘efficiency’ function still available in 2024a? Is there any other reason why it might not be recognized? I am getting the following error but can’t figure out why.
Unrecognized function or variable ‘efficiency’.
I am using a full version of MATLAB 2024a with an academic license and all of the toolboxes installed on April 3.
I regularly use the functions from the Antenna Toolbox so I am confident that it is installed correctly. I’ve also tried copying the text from the Help Center article to make sure there weren’t any typos.
‘doc efficiency’ and ‘help efficiency’ in the command window work as expected.
Is the ‘efficiency’ function still available in 2024a? Is there any other reason why it might not be recognized? antenna toolbox, efficiency MATLAB Answers — New Questions
Seeking Tables help
Looking for help on tables. I have a long list (140+) of names. I’m trying to set up to have 2 columns of limited rows, (so it shows at 2 tables on a printed page) but want to have it so that if I add a name in the middle of a data set, it’ll move everything below it down 1, and across other tables.
Example, when I go to print, Column 1 on page 1 has names A-C, column 2 has D-F. column 1 on page 3 has g-p. If I need to add a name in A-C, it’ll push the list down one, going into D-F and G-P, etc.
I hope that sort of explains what I’m looking for…
Looking for help on tables. I have a long list (140+) of names. I’m trying to set up to have 2 columns of limited rows, (so it shows at 2 tables on a printed page) but want to have it so that if I add a name in the middle of a data set, it’ll move everything below it down 1, and across other tables.Example, when I go to print, Column 1 on page 1 has names A-C, column 2 has D-F. column 1 on page 3 has g-p. If I need to add a name in A-C, it’ll push the list down one, going into D-F and G-P, etc.I hope that sort of explains what I’m looking for… Read More
how to use the parameters of neural network in simulink?
Hello all,
I trained a neural network dpending on two inputs (T and p) to predect density.
Now I have the best parameters to predect density using this code:
density = model (parameters, p, T);
Plese note that I have a simulink model with the time-step is 0.001 s, the problem is how to use this parameters of the NN in the Simulink model.
input are: p and T
output is: density
time-step is 0.001
Best regards, AhmadHello all,
I trained a neural network dpending on two inputs (T and p) to predect density.
Now I have the best parameters to predect density using this code:
density = model (parameters, p, T);
Plese note that I have a simulink model with the time-step is 0.001 s, the problem is how to use this parameters of the NN in the Simulink model.
input are: p and T
output is: density
time-step is 0.001
Best regards, Ahmad Hello all,
I trained a neural network dpending on two inputs (T and p) to predect density.
Now I have the best parameters to predect density using this code:
density = model (parameters, p, T);
Plese note that I have a simulink model with the time-step is 0.001 s, the problem is how to use this parameters of the NN in the Simulink model.
input are: p and T
output is: density
time-step is 0.001
Best regards, Ahmad parameters MATLAB Answers — New Questions
How do I use live script (*.mlx) files in source control?
I would like to use the live script files with source control, what is the workflow for that?I would like to use the live script files with source control, what is the workflow for that? I would like to use the live script files with source control, what is the workflow for that? live, editor, source, control, git MATLAB Answers — New Questions
Can I use a student license if I am not currently enrolled in courses?
I have been accepted to a university for a master’s degree, and I am learning MATLAB and reviewing other courses before I start it, which will be in Fall 2025. My university has a campus-wide license. Since I was accepted into the university, I have a student email address, even though I am not currently enrolled in any classes. Would I be able to use my university’s campus access, or should I consider purchasing a home license?I have been accepted to a university for a master’s degree, and I am learning MATLAB and reviewing other courses before I start it, which will be in Fall 2025. My university has a campus-wide license. Since I was accepted into the university, I have a student email address, even though I am not currently enrolled in any classes. Would I be able to use my university’s campus access, or should I consider purchasing a home license? I have been accepted to a university for a master’s degree, and I am learning MATLAB and reviewing other courses before I start it, which will be in Fall 2025. My university has a campus-wide license. Since I was accepted into the university, I have a student email address, even though I am not currently enrolled in any classes. Would I be able to use my university’s campus access, or should I consider purchasing a home license? student license MATLAB Answers — New Questions
Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative.
I tried to establish a dynamic model of the reactor using PDEs, but I couldn’t solve it. I don’t know why. The code is as follows:
In this problem, my boundary condition only has the left boundary, which is the u value and dudx when z=0. How should I write it?
function reactor_dynamic_model(obj)
global R miu comp_set A_for A_rev Ea_for Ea_rev Da lambda
Da = 1.8e-4;
lambda = 5e-4;
F_molar = obj.F_molar;
A = obj.cat_vol / obj.z0;
z0 = obj.z0;
y0 = obj.y0;
epsilon = obj.epsilon;
P = obj.P;
T0 = obj.T;
Fi0 = F_molar * y0;
Cpc = obj.Cpc;
rho = obj.rho;
epsilon = obj.epsilon;
nfe = obj.nfe;
ct0 = 0.001/pr(T0,P,y0);
Cpm0 = get_Cpm(T0,y0);
ci0=ct0.*y0;
uv0 = (epsilon*ct0.*Cpm0+Cpc*rho).*T0;
zspan = 0:z0/(nfe-1):z0;
tspan = 0:10:100;
sol = pdepe(0,@pdefun,@pdeic,@pdebc,zspan,tspan);
a=1;
function [c,f,s] = pdefun(z,t,u,dudx)
c1 = u(1);
c2 = u(2);
c3 = u(3);
c4 = u(4);
uv = u(5);
ct = c1+c2+c3+c4;
y1=c1/ct;
y2=c2/ct;
y3=c3/ct;
y4=c4/ct;
y = [y1,y2,y3,y4];
T = fzero(@solve_T_uv, T0,[],y,uv,ct);
function f0 = solve_T_uv(T,y,uv,ct)
f0 = (epsilon*ct*get_Cpm(T,y)+Cpc*rho)*T-uv;
end
dc1dz = dudx(1);
dc2dz = dudx(2);
dc3dz = dudx(3);
dc4dz = dudx(4);
dTdz = dudx(5);
x = (Fi0(1)-F_molar*y1) / (1-2*y1);
F1 = Fi0(1)-x;
F2 = Fi0(2) -3*x;
F3 = Fi0(3)+2*x;
F4 = Fi0(4);
Ft = F1+F2+F3+F4;
Cpm = get_Cpm(T, y);
h = Ft*Cpm*T;
X = (Fi0(1) – F1) / Fi0(1);
eta = get_eta(T, P, X);
r = get_r(T, P, y, eta, miu,A_for, A_rev, Ea_for, Ea_rev);
r1 = r(1);
r2 = r(2);
r3 = r(3);
r4 = r(4);
Hr = get_Hr(T, P);
c = [1;1;1;1;1];
f = [Da*dc1dz/epsilon;
Da*dc2dz/epsilon;
Da*dc3dz/epsilon;
Da*dc4dz/epsilon;
lambda*dTdz];
s = [r1/epsilon-F1/A/epsilon;
r2/epsilon-F2/A/epsilon;
r3/epsilon-F3/A/epsilon;
r4/epsilon-F4/A/epsilon;
r3*(-Hr)-h/A];
end
function u0 = pdeic(z)
class1 = PFR;
result = class1.reactor_steadystate_model(z);
T_init = result(1);
y_init = result(10:13);
ct_init = 0.001/pr(T_init,P,y_init);
ci_init = ct_init * y_init;
c1_init = ci_init(1);
c2_init = ci_init(2);
c3_init = ci_init(3);
c4_init = ci_init(4);
Cpm_init = get_Cpm(T_init,y_init);
uv_init = (epsilon*ct_init*Cpm_init+Cpc*rho)*T_init;
u0 = [c1_init;c2_init;c3_init;c4_init;uv_init];
end
function [pl,ql,pr,qr] = pdebc(zl,ul,zr,ur,t)
pl = [ul(1)-ci0(1);ul(2)-ci0(2);ul(3)-ci0(3);ul(4)-ci0(4);ul(5)-uv0];
ql = [0;0;0;0;0];
pr = [0;0;0;0;0];
qr = [0;0;0;0;0];
end
endI tried to establish a dynamic model of the reactor using PDEs, but I couldn’t solve it. I don’t know why. The code is as follows:
In this problem, my boundary condition only has the left boundary, which is the u value and dudx when z=0. How should I write it?
function reactor_dynamic_model(obj)
global R miu comp_set A_for A_rev Ea_for Ea_rev Da lambda
Da = 1.8e-4;
lambda = 5e-4;
F_molar = obj.F_molar;
A = obj.cat_vol / obj.z0;
z0 = obj.z0;
y0 = obj.y0;
epsilon = obj.epsilon;
P = obj.P;
T0 = obj.T;
Fi0 = F_molar * y0;
Cpc = obj.Cpc;
rho = obj.rho;
epsilon = obj.epsilon;
nfe = obj.nfe;
ct0 = 0.001/pr(T0,P,y0);
Cpm0 = get_Cpm(T0,y0);
ci0=ct0.*y0;
uv0 = (epsilon*ct0.*Cpm0+Cpc*rho).*T0;
zspan = 0:z0/(nfe-1):z0;
tspan = 0:10:100;
sol = pdepe(0,@pdefun,@pdeic,@pdebc,zspan,tspan);
a=1;
function [c,f,s] = pdefun(z,t,u,dudx)
c1 = u(1);
c2 = u(2);
c3 = u(3);
c4 = u(4);
uv = u(5);
ct = c1+c2+c3+c4;
y1=c1/ct;
y2=c2/ct;
y3=c3/ct;
y4=c4/ct;
y = [y1,y2,y3,y4];
T = fzero(@solve_T_uv, T0,[],y,uv,ct);
function f0 = solve_T_uv(T,y,uv,ct)
f0 = (epsilon*ct*get_Cpm(T,y)+Cpc*rho)*T-uv;
end
dc1dz = dudx(1);
dc2dz = dudx(2);
dc3dz = dudx(3);
dc4dz = dudx(4);
dTdz = dudx(5);
x = (Fi0(1)-F_molar*y1) / (1-2*y1);
F1 = Fi0(1)-x;
F2 = Fi0(2) -3*x;
F3 = Fi0(3)+2*x;
F4 = Fi0(4);
Ft = F1+F2+F3+F4;
Cpm = get_Cpm(T, y);
h = Ft*Cpm*T;
X = (Fi0(1) – F1) / Fi0(1);
eta = get_eta(T, P, X);
r = get_r(T, P, y, eta, miu,A_for, A_rev, Ea_for, Ea_rev);
r1 = r(1);
r2 = r(2);
r3 = r(3);
r4 = r(4);
Hr = get_Hr(T, P);
c = [1;1;1;1;1];
f = [Da*dc1dz/epsilon;
Da*dc2dz/epsilon;
Da*dc3dz/epsilon;
Da*dc4dz/epsilon;
lambda*dTdz];
s = [r1/epsilon-F1/A/epsilon;
r2/epsilon-F2/A/epsilon;
r3/epsilon-F3/A/epsilon;
r4/epsilon-F4/A/epsilon;
r3*(-Hr)-h/A];
end
function u0 = pdeic(z)
class1 = PFR;
result = class1.reactor_steadystate_model(z);
T_init = result(1);
y_init = result(10:13);
ct_init = 0.001/pr(T_init,P,y_init);
ci_init = ct_init * y_init;
c1_init = ci_init(1);
c2_init = ci_init(2);
c3_init = ci_init(3);
c4_init = ci_init(4);
Cpm_init = get_Cpm(T_init,y_init);
uv_init = (epsilon*ct_init*Cpm_init+Cpc*rho)*T_init;
u0 = [c1_init;c2_init;c3_init;c4_init;uv_init];
end
function [pl,ql,pr,qr] = pdebc(zl,ul,zr,ur,t)
pl = [ul(1)-ci0(1);ul(2)-ci0(2);ul(3)-ci0(3);ul(4)-ci0(4);ul(5)-uv0];
ql = [0;0;0;0;0];
pr = [0;0;0;0;0];
qr = [0;0;0;0;0];
end
end I tried to establish a dynamic model of the reactor using PDEs, but I couldn’t solve it. I don’t know why. The code is as follows:
In this problem, my boundary condition only has the left boundary, which is the u value and dudx when z=0. How should I write it?
function reactor_dynamic_model(obj)
global R miu comp_set A_for A_rev Ea_for Ea_rev Da lambda
Da = 1.8e-4;
lambda = 5e-4;
F_molar = obj.F_molar;
A = obj.cat_vol / obj.z0;
z0 = obj.z0;
y0 = obj.y0;
epsilon = obj.epsilon;
P = obj.P;
T0 = obj.T;
Fi0 = F_molar * y0;
Cpc = obj.Cpc;
rho = obj.rho;
epsilon = obj.epsilon;
nfe = obj.nfe;
ct0 = 0.001/pr(T0,P,y0);
Cpm0 = get_Cpm(T0,y0);
ci0=ct0.*y0;
uv0 = (epsilon*ct0.*Cpm0+Cpc*rho).*T0;
zspan = 0:z0/(nfe-1):z0;
tspan = 0:10:100;
sol = pdepe(0,@pdefun,@pdeic,@pdebc,zspan,tspan);
a=1;
function [c,f,s] = pdefun(z,t,u,dudx)
c1 = u(1);
c2 = u(2);
c3 = u(3);
c4 = u(4);
uv = u(5);
ct = c1+c2+c3+c4;
y1=c1/ct;
y2=c2/ct;
y3=c3/ct;
y4=c4/ct;
y = [y1,y2,y3,y4];
T = fzero(@solve_T_uv, T0,[],y,uv,ct);
function f0 = solve_T_uv(T,y,uv,ct)
f0 = (epsilon*ct*get_Cpm(T,y)+Cpc*rho)*T-uv;
end
dc1dz = dudx(1);
dc2dz = dudx(2);
dc3dz = dudx(3);
dc4dz = dudx(4);
dTdz = dudx(5);
x = (Fi0(1)-F_molar*y1) / (1-2*y1);
F1 = Fi0(1)-x;
F2 = Fi0(2) -3*x;
F3 = Fi0(3)+2*x;
F4 = Fi0(4);
Ft = F1+F2+F3+F4;
Cpm = get_Cpm(T, y);
h = Ft*Cpm*T;
X = (Fi0(1) – F1) / Fi0(1);
eta = get_eta(T, P, X);
r = get_r(T, P, y, eta, miu,A_for, A_rev, Ea_for, Ea_rev);
r1 = r(1);
r2 = r(2);
r3 = r(3);
r4 = r(4);
Hr = get_Hr(T, P);
c = [1;1;1;1;1];
f = [Da*dc1dz/epsilon;
Da*dc2dz/epsilon;
Da*dc3dz/epsilon;
Da*dc4dz/epsilon;
lambda*dTdz];
s = [r1/epsilon-F1/A/epsilon;
r2/epsilon-F2/A/epsilon;
r3/epsilon-F3/A/epsilon;
r4/epsilon-F4/A/epsilon;
r3*(-Hr)-h/A];
end
function u0 = pdeic(z)
class1 = PFR;
result = class1.reactor_steadystate_model(z);
T_init = result(1);
y_init = result(10:13);
ct_init = 0.001/pr(T_init,P,y_init);
ci_init = ct_init * y_init;
c1_init = ci_init(1);
c2_init = ci_init(2);
c3_init = ci_init(3);
c4_init = ci_init(4);
Cpm_init = get_Cpm(T_init,y_init);
uv_init = (epsilon*ct_init*Cpm_init+Cpc*rho)*T_init;
u0 = [c1_init;c2_init;c3_init;c4_init;uv_init];
end
function [pl,ql,pr,qr] = pdebc(zl,ul,zr,ur,t)
pl = [ul(1)-ci0(1);ul(2)-ci0(2);ul(3)-ci0(3);ul(4)-ci0(4);ul(5)-uv0];
ql = [0;0;0;0;0];
pr = [0;0;0;0;0];
qr = [0;0;0;0;0];
end
end pdepe, boundary condition, spatial discretization, elliptic, pdes, initial condition, pfr, dynamic model, ammonia synthesis MATLAB Answers — New Questions
My Windows Security stucked on Black Screen
I cant use Windows Security because everytime i open its just a black screen and after i do something, new window just pop up
I searched all over internet for fix, i found some “fixes” that dont work, i used commands, reseting, repairing and also used “SecurityHealthSetup.exe” that was on other blog with this exact problem used as fix, but it did nothing to me
I cant use Windows Security because everytime i open its just a black screen and after i do something, new window just pop upI searched all over internet for fix, i found some “fixes” that dont work, i used commands, reseting, repairing and also used “SecurityHealthSetup.exe” that was on other blog with this exact problem used as fix, but it did nothing to me Read More
Hours worked to be distributed into day shift, evening shift, and overnight shift
Hi !
I need help please.
I’m not sure how to efficiently distribute the hours worked by each worker into the different shift.
The information in the spreadsheet is as follow (also see screenshot below):
Time InTime outHours workedDay Shift (6 am – 6 pm)Evening shift (6 pm – 12 am)Overnight (12 am – 6 am)
Thanks in advance,
Arnaldo
Hi !I need help please.I’m not sure how to efficiently distribute the hours worked by each worker into the different shift.The information in the spreadsheet is as follow (also see screenshot below):Time InTime outHours workedDay Shift (6 am – 6 pm)Evening shift (6 pm – 12 am)Overnight (12 am – 6 am)Thanks in advance,Arnaldo Read More
ERROR: “Bad Request – Request Too Long” When Signing In To Microsoft 365 Using Work Profiles
When the following conditions are true:
Using the latest version of Microsoft Edge browser.When the browser is signed in to any Microsoft 365 account.When browsing to any Microsoft 365 website.
I receive the following browser error:
Bad Request – Request Too Long
HTTP Error 400. The size of the request headers is too long.
When I sign in to any Work Profile, no matter the account/tenant, the moment I browse to any Microsoft 365 page i.e. any website that redirects via: https://login.microsoftonline.com/, I receive the error above e.g. https://office.com, https://admin.microsoft.com, https://portal.azure.com etc.
If I sign-out from the Work Profile, everything works fine (i.e. I am presented with the usual Microsoft 365 sign-in dialogue for username and password, then 2FA code, then the expected page appears), if I then sign-in > browse > error … sign-out, works fine, sign-in, error etc. … consistently repeatable.
Using ‘Browse as Guest’ or any ‘Personal’ or ‘Work Profile’ without signing in works fine.
TROUBLESHOOTING ALREADY CARRIED OUT
Deleted/recreated all profiles.Signed in / out multiple accounts on multiple tenants.Sync options > all, some, none.‘Automatic sign in on Microsoft Edge’ enabled & disabled.‘Allow single sign-on for work or school sites using this profile’ enabled & disabled.‘Automatic profile switching’ all options on & all off.Deleted all cache/cookies, from all time in all profiles.Reset settings in all profiles.Completely uninstalled/reinstalled Microsoft Edge (i.e. Safe Mode > delete all files > all profile data> all temp files > all registry entries).
Q1 What could cause this error, only when the Work Profile is signed-in?
Q2 Aside from syncing settings, how would signing-in to the Work Profile effect OATH requests to https://login.microsoftonline.com/?
Q3 Has anybody experienced this or something like this before?
Q4 Are there any troubleshooting steps I haven’t tried?
When the following conditions are true: Using the latest version of Microsoft Edge browser.When the browser is signed in to any Microsoft 365 account.When browsing to any Microsoft 365 website.I receive the following browser error: Bad Request – Request Too LongHTTP Error 400. The size of the request headers is too long. When I sign in to any Work Profile, no matter the account/tenant, the moment I browse to any Microsoft 365 page i.e. any website that redirects via: https://login.microsoftonline.com/, I receive the error above e.g. https://office.com, https://admin.microsoft.com, https://portal.azure.com etc. If I sign-out from the Work Profile, everything works fine (i.e. I am presented with the usual Microsoft 365 sign-in dialogue for username and password, then 2FA code, then the expected page appears), if I then sign-in > browse > error … sign-out, works fine, sign-in, error etc. … consistently repeatable. Using ‘Browse as Guest’ or any ‘Personal’ or ‘Work Profile’ without signing in works fine. TROUBLESHOOTING ALREADY CARRIED OUT Deleted/recreated all profiles.Signed in / out multiple accounts on multiple tenants.Sync options > all, some, none.’Automatic sign in on Microsoft Edge’ enabled & disabled.’Allow single sign-on for work or school sites using this profile’ enabled & disabled.’Automatic profile switching’ all options on & all off.Deleted all cache/cookies, from all time in all profiles.Reset settings in all profiles.Completely uninstalled/reinstalled Microsoft Edge (i.e. Safe Mode > delete all files > all profile data> all temp files > all registry entries). Q1 What could cause this error, only when the Work Profile is signed-in?Q2 Aside from syncing settings, how would signing-in to the Work Profile effect OATH requests to https://login.microsoftonline.com/?Q3 Has anybody experienced this or something like this before?Q4 Are there any troubleshooting steps I haven’t tried? Read More