Category: News
Embed pdf from SharePoint library with default zoom level
I want to embed a PDF file from a SharePoint site into my website. I have a link like https://etechua.sharepoint.com/sites/edocsrc/_layouts/15/embed.aspx?UniqueId=c385aa46-5a4a-4113-bc1b-e7d5768bab2d. Is it possible to set a default zoom level?
Currently, if we don’t specify it, the zoom level is set to fit page. I need it to be fit width.
I want to embed a PDF file from a SharePoint site into my website. I have a link like https://etechua.sharepoint.com/sites/edocsrc/_layouts/15/embed.aspx?UniqueId=c385aa46-5a4a-4113-bc1b-e7d5768bab2d. Is it possible to set a default zoom level?Currently, if we don’t specify it, the zoom level is set to fit page. I need it to be fit width. Read More
histogram
how to calculate threshold value using histogram ,that is average of two hightest velles in in histogramhow to calculate threshold value using histogram ,that is average of two hightest velles in in histogram how to calculate threshold value using histogram ,that is average of two hightest velles in in histogram histogram MATLAB Answers — New Questions
plot in designated subfigures in loops
I have the following code. I want to plotsubfigures as required in the comments in main.m. How to plot in designated subfigures in such loops below?
% main.m
tiledlayout(2,3)
for i=1:2
for j=1:3
function myfun;
end
end
% myfun.m
plot % in subplot(1,j)
plot % in subplot(2,j)I have the following code. I want to plotsubfigures as required in the comments in main.m. How to plot in designated subfigures in such loops below?
% main.m
tiledlayout(2,3)
for i=1:2
for j=1:3
function myfun;
end
end
% myfun.m
plot % in subplot(1,j)
plot % in subplot(2,j) I have the following code. I want to plotsubfigures as required in the comments in main.m. How to plot in designated subfigures in such loops below?
% main.m
tiledlayout(2,3)
for i=1:2
for j=1:3
function myfun;
end
end
% myfun.m
plot % in subplot(1,j)
plot % in subplot(2,j) plot, subplot, tilelayout, axes MATLAB Answers — New Questions
How do I install on Ubuntu?
I am a novice Ubuntu user, I know how to use Terminal. I am trying to install MATLAB 2020a on my Ubuntu machine, I have downloaded the Linux Installer which is a zip folder. What do I do from here? Thanks!I am a novice Ubuntu user, I know how to use Terminal. I am trying to install MATLAB 2020a on my Ubuntu machine, I have downloaded the Linux Installer which is a zip folder. What do I do from here? Thanks! I am a novice Ubuntu user, I know how to use Terminal. I am trying to install MATLAB 2020a on my Ubuntu machine, I have downloaded the Linux Installer which is a zip folder. What do I do from here? Thanks! 2020a, linux, ubuntu, install, installation MATLAB Answers — New Questions
Solve an ODE with the parameters defined in the function changing in a for loop in the main script
I have to cycle trough different values of stifness kp in the main script with a for loop and solve an Ode. How can I modify the kp value in the function defined used as imput to an ode45 in the main script?
Thanks in advance
function xdot = Time_domain_system(t,x)
theta_ref = 1;
m = 3;
L = 4;
J = 1/12*m*L^2;
c = 10;
g = 9.81;
k = 150;
kp = 50;
%equivalent parameters
mx = J+m*L^2/4;
cx = c*L^2/4;
kx = k*L^2/4 – m*g*L/2;
xdot(1) = x(2);
xdot(2) = kp*theta_ref/mx -(cx/mx)*x(2) – ((kx + kp)/mx)*x(1);
xdot = xdot’;
endI have to cycle trough different values of stifness kp in the main script with a for loop and solve an Ode. How can I modify the kp value in the function defined used as imput to an ode45 in the main script?
Thanks in advance
function xdot = Time_domain_system(t,x)
theta_ref = 1;
m = 3;
L = 4;
J = 1/12*m*L^2;
c = 10;
g = 9.81;
k = 150;
kp = 50;
%equivalent parameters
mx = J+m*L^2/4;
cx = c*L^2/4;
kx = k*L^2/4 – m*g*L/2;
xdot(1) = x(2);
xdot(2) = kp*theta_ref/mx -(cx/mx)*x(2) – ((kx + kp)/mx)*x(1);
xdot = xdot’;
end I have to cycle trough different values of stifness kp in the main script with a for loop and solve an Ode. How can I modify the kp value in the function defined used as imput to an ode45 in the main script?
Thanks in advance
function xdot = Time_domain_system(t,x)
theta_ref = 1;
m = 3;
L = 4;
J = 1/12*m*L^2;
c = 10;
g = 9.81;
k = 150;
kp = 50;
%equivalent parameters
mx = J+m*L^2/4;
cx = c*L^2/4;
kx = k*L^2/4 – m*g*L/2;
xdot(1) = x(2);
xdot(2) = kp*theta_ref/mx -(cx/mx)*x(2) – ((kx + kp)/mx)*x(1);
xdot = xdot’;
end ode45, ordinary differential equation controls, control MATLAB Answers — New Questions
Condition Formula
Hello..
Pls. help me to apply formula if i want to get a profit Value of Customer X in region 5 for the month of May. how to get that this by using formula.
Hello.. Pls. help me to apply formula if i want to get a profit Value of Customer X in region 5 for the month of May. how to get that this by using formula. Read More
A feature request in edge
It would be really helpful if the edge app on startup shows the list of all edge profiles segregating them by personal and work, like the chrome’s startup screen.
It would be really helpful if the edge app on startup shows the list of all edge profiles segregating them by personal and work, like the chrome’s startup screen. Read More
OneDrive for MacOS – can’t search files in Spotlight
Hi
When using OneDrive on MacOS I can’t search my OneDrive files in Spotlight, making file access more cumbersome. I tried to edit the Spotlight search settings, but I don’t see my OneDrive folder there.
I checekd the SpotLight settings under preferences – and the “Folders” and “Documents” options are both set. Is this a OneDrive Limitation ?
Environment: MacBook Pro (Intel), Ventura 13.6.6
HiWhen using OneDrive on MacOS I can’t search my OneDrive files in Spotlight, making file access more cumbersome. I tried to edit the Spotlight search settings, but I don’t see my OneDrive folder there.I checekd the SpotLight settings under preferences – and the “Folders” and “Documents” options are both set. Is this a OneDrive Limitation ? Environment: MacBook Pro (Intel), Ventura 13.6.6 Read More
Insert the number of rows from a word table in the title
I have a Table and want to display in the Titel-row the number of colums the table has. How can I do this? please step by step advise since I am 68!
Example:
Title Column: This Table contains xx Entries
Row 1
Row 2
…
Row x
I have a Table and want to display in the Titel-row the number of colums the table has. How can I do this? please step by step advise since I am 68!Example: Title Column: This Table contains xx EntriesRow 1Row 2…Row x Read More
About While Loops problems
Is there anyway to end the program by entering "quit"? As the program keeps going despite displays "Exiting…"
The following is the syntax.
function Individual_Project_Final()
disp(‘Welcome to Unit Converter interface! ‘);
disp(‘ ‘);
while true
% Accept user input
input_str = input(‘Enter a number to be converted (or type "quit" to exit program): ‘, ‘s’);
% Check if the user wants to quit
if strcmp(input_str, ‘quit’)
disp(‘Exiting…’)
break;
end
% Convert input string to a number
numin = str2double(input_str);
% Check if the input is a valid number
if isnan(numin)
disp(‘Input invalid. Please enter a whole or decimal number (or type "quit to exit program): ‘);
else
disp(‘Input valid. Now please select the unit conversion type (or type "quit to exit program): ‘);
break;
end
end
% Display the menu for selecting conversion type
disp(‘ ‘)
disp(‘Select conversion type:’)
disp(‘1) Celsius to Fahrenheit’)
disp(‘2) Fahrenheit to Celsius’)
disp(‘3) Centimeters to Inches’)
disp(‘4) Inches to Centimeters’)
disp(‘5) Meters to Foot’)
disp(‘6) Foot to Meters’)
disp(‘7) Kilometers to Miles’)
disp(‘8) Miles to Kilometers’)
disp(‘9) Grams to Ounces’)
disp(’10) Ounces to Grams’)
disp(’11) Kilograms to Pounds’)
disp(’12) Pounds to Kilograms’)
disp(’13) Tonnes to Tons’)
disp(’14) Tons to Tonnes’)
while true
% Accept user input
input_str = input(‘Please select conversion type (1-14) (or type "quit" to exit): ‘, ‘s’);
% Check if the user wants to quit
if strcmp(input_str, ‘quit’)
disp(‘Exiting…’);
break;
end
% Convert input string to a number
convtype = str2double(input_str);
% Check if input is a valid conversion type
if ~ismember(convtype, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])
disp(‘Conversion type invalid. Please enter a number from 1 to 14 (or type "quit to exit program): ‘);
else
disp(‘Input valid. We are now finalizing the resluts based on your input. ‘);
break;
end
end
% Call the user-defined function from Module 2
[numout,unit] = MyUnitConverter(numin,convtype);
% Output generation
disp(‘ ‘);
fprintf(‘The converted number is: %.2f %sn’, numout, unit);
endIs there anyway to end the program by entering "quit"? As the program keeps going despite displays "Exiting…"
The following is the syntax.
function Individual_Project_Final()
disp(‘Welcome to Unit Converter interface! ‘);
disp(‘ ‘);
while true
% Accept user input
input_str = input(‘Enter a number to be converted (or type "quit" to exit program): ‘, ‘s’);
% Check if the user wants to quit
if strcmp(input_str, ‘quit’)
disp(‘Exiting…’)
break;
end
% Convert input string to a number
numin = str2double(input_str);
% Check if the input is a valid number
if isnan(numin)
disp(‘Input invalid. Please enter a whole or decimal number (or type "quit to exit program): ‘);
else
disp(‘Input valid. Now please select the unit conversion type (or type "quit to exit program): ‘);
break;
end
end
% Display the menu for selecting conversion type
disp(‘ ‘)
disp(‘Select conversion type:’)
disp(‘1) Celsius to Fahrenheit’)
disp(‘2) Fahrenheit to Celsius’)
disp(‘3) Centimeters to Inches’)
disp(‘4) Inches to Centimeters’)
disp(‘5) Meters to Foot’)
disp(‘6) Foot to Meters’)
disp(‘7) Kilometers to Miles’)
disp(‘8) Miles to Kilometers’)
disp(‘9) Grams to Ounces’)
disp(’10) Ounces to Grams’)
disp(’11) Kilograms to Pounds’)
disp(’12) Pounds to Kilograms’)
disp(’13) Tonnes to Tons’)
disp(’14) Tons to Tonnes’)
while true
% Accept user input
input_str = input(‘Please select conversion type (1-14) (or type "quit" to exit): ‘, ‘s’);
% Check if the user wants to quit
if strcmp(input_str, ‘quit’)
disp(‘Exiting…’);
break;
end
% Convert input string to a number
convtype = str2double(input_str);
% Check if input is a valid conversion type
if ~ismember(convtype, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])
disp(‘Conversion type invalid. Please enter a number from 1 to 14 (or type "quit to exit program): ‘);
else
disp(‘Input valid. We are now finalizing the resluts based on your input. ‘);
break;
end
end
% Call the user-defined function from Module 2
[numout,unit] = MyUnitConverter(numin,convtype);
% Output generation
disp(‘ ‘);
fprintf(‘The converted number is: %.2f %sn’, numout, unit);
end Is there anyway to end the program by entering "quit"? As the program keeps going despite displays "Exiting…"
The following is the syntax.
function Individual_Project_Final()
disp(‘Welcome to Unit Converter interface! ‘);
disp(‘ ‘);
while true
% Accept user input
input_str = input(‘Enter a number to be converted (or type "quit" to exit program): ‘, ‘s’);
% Check if the user wants to quit
if strcmp(input_str, ‘quit’)
disp(‘Exiting…’)
break;
end
% Convert input string to a number
numin = str2double(input_str);
% Check if the input is a valid number
if isnan(numin)
disp(‘Input invalid. Please enter a whole or decimal number (or type "quit to exit program): ‘);
else
disp(‘Input valid. Now please select the unit conversion type (or type "quit to exit program): ‘);
break;
end
end
% Display the menu for selecting conversion type
disp(‘ ‘)
disp(‘Select conversion type:’)
disp(‘1) Celsius to Fahrenheit’)
disp(‘2) Fahrenheit to Celsius’)
disp(‘3) Centimeters to Inches’)
disp(‘4) Inches to Centimeters’)
disp(‘5) Meters to Foot’)
disp(‘6) Foot to Meters’)
disp(‘7) Kilometers to Miles’)
disp(‘8) Miles to Kilometers’)
disp(‘9) Grams to Ounces’)
disp(’10) Ounces to Grams’)
disp(’11) Kilograms to Pounds’)
disp(’12) Pounds to Kilograms’)
disp(’13) Tonnes to Tons’)
disp(’14) Tons to Tonnes’)
while true
% Accept user input
input_str = input(‘Please select conversion type (1-14) (or type "quit" to exit): ‘, ‘s’);
% Check if the user wants to quit
if strcmp(input_str, ‘quit’)
disp(‘Exiting…’);
break;
end
% Convert input string to a number
convtype = str2double(input_str);
% Check if input is a valid conversion type
if ~ismember(convtype, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])
disp(‘Conversion type invalid. Please enter a number from 1 to 14 (or type "quit to exit program): ‘);
else
disp(‘Input valid. We are now finalizing the resluts based on your input. ‘);
break;
end
end
% Call the user-defined function from Module 2
[numout,unit] = MyUnitConverter(numin,convtype);
% Output generation
disp(‘ ‘);
fprintf(‘The converted number is: %.2f %sn’, numout, unit);
end while loop MATLAB Answers — New Questions
Unable to outerjoin two tables, Error message of ‘Left and right key variables have incompatible types’
Hi, it seems that no matter what I try, my left and right key variables will always be of incompatible types.
It’s gotten so frustrating that I literally renamed Table A to have the exact same category names as Table B.
For example, each Table now has the same categories, One, Two, Three, Four, Five, and Six
But for some reason, matlab.mathworks.com keeps saying that ‘Ordinal arrays must have the same categories, including their order’ – which I believe I already made sure the tables were.
Dear community, what exactly am I doing wrong? Is MATLAB Online not compatible with joining tables?
My version is 2024a – Thanks.Hi, it seems that no matter what I try, my left and right key variables will always be of incompatible types.
It’s gotten so frustrating that I literally renamed Table A to have the exact same category names as Table B.
For example, each Table now has the same categories, One, Two, Three, Four, Five, and Six
But for some reason, matlab.mathworks.com keeps saying that ‘Ordinal arrays must have the same categories, including their order’ – which I believe I already made sure the tables were.
Dear community, what exactly am I doing wrong? Is MATLAB Online not compatible with joining tables?
My version is 2024a – Thanks. Hi, it seems that no matter what I try, my left and right key variables will always be of incompatible types.
It’s gotten so frustrating that I literally renamed Table A to have the exact same category names as Table B.
For example, each Table now has the same categories, One, Two, Three, Four, Five, and Six
But for some reason, matlab.mathworks.com keeps saying that ‘Ordinal arrays must have the same categories, including their order’ – which I believe I already made sure the tables were.
Dear community, what exactly am I doing wrong? Is MATLAB Online not compatible with joining tables?
My version is 2024a – Thanks. outerjoin, table, ordinal arrays, incompatible types MATLAB Answers — New Questions
Excel Formula help needed
Hi, sorry a real beginner here trying to be better!! I want to add certain column’s together but the formula adds the last column twice and I don’t know why.
I am using this formula =SUM(D11:D14:D19) D19 has been calculated twice, can anyone advise please?
Hi, sorry a real beginner here trying to be better!! I want to add certain column’s together but the formula adds the last column twice and I don’t know why. I am using this formula =SUM(D11:D14:D19) D19 has been calculated twice, can anyone advise please? Read More
Missing teams recordings
Hello every body
when I finished my lecture I noticed that it was saved in recording file but unfortunately there were no other recordings from the previous sessions I made;
I checked in one drive and I found the same thing only the last lecture was there.
thanx for your respond.
Hello every bodywhen I finished my lecture I noticed that it was saved in recording file but unfortunately there were no other recordings from the previous sessions I made;I checked in one drive and I found the same thing only the last lecture was there. thanx for your respond. Read More
problem in function inputs
Hi guys. I have this function that gives me the equations for my DAE system.
function S = Sec_model_fun(t,x,Q0,T1)
%%Dynamic state inputs
n_C2_gas=x(1); %Ethylene mols in gas phase[mol]
n_C4_gas=x(2); %Butene mols in gas phase[mol]
n_C6_gas=x(3); %Hexene mols in gas phase[mol]
n_C8_gas=x(4); %Octene mols in gas phase[mol]
n_C10_gas=x(5); %Decene mols in gas phase[mol]
n_C12_gas=x(6); %Dodecene mols in gas phase[mol]
n_C11_gas=x(7); %Undecene mols in gas phase[mol]
n_C2_liquid=x(8); %Ethylene mols in liquid phase[mol]
n_C4_liquid=x(9); %Butene mols in liquid phase[mol]
n_C6_liquid=x(10); %Hexene mols in liquid phase[mol]
n_C8_liquid=x(11); %Octene mols in liquid phase[mol]
n_C10_liquid=x(12); %Decene mols in liquid phase[mol]
n_C12_liquid=x(13); %Dodecene mols in liquid phase[mol]
n_C11_liquid=x(14); %Undecene mols in liquid phase[mol]
e_integral = x(15); %Error[mol/s]
%FGout = x(16); %Gas outlet[mol/s]
%% Constants
Kc_Total_gases = 1;
tauI_Total_gases =1;
%Q0=350; % Q_G etylene inflow (ml/min)
Q1=Q0*1e-6/60; % Q_G ethylene inflow (m3/s)
Q2=0; % Q_G butene inflow
Q3=0; % Q_G hexene inflow
Q4=0; % Q_G octene inflow
Q5=0; % Q_G decene inflow
Q6=0; % Q_G dodecene inflow
Q7=0; % Q_G undecane inflow
P1=36e5; % ethylene inflow pressure [Pa]
%T1=230+273.15; % T_Ethylene [K]
T2=230+273.15; % T_ref [K]
R=8.314; % gas constant [J/(mol.K)]
C1=P1/(R*T1); % ethylene inlet gas concentration [mol/m^3]
F0=0.0179; % gas outflow rate [mmol/s]
F1=F0.*1e-3; % gas outflow rate [mol/s]
VR=300e-6; % reactor volume [m^3]
VG=250e-6; % gas volume [m^3]
VL=50e-6; % liquid volume [m^3]
K=[3.24;2.23;1.72;0.2;0.1;0.08;0.09]; % solubility [nondim]
moleWt=[28;56;84;112;140;168;156]; % mole weight C2,C4,…,C12,C11 [g/mol]
wc=(0.3+0.25)*1e-3; % catalyst weight [kg]
kref=[2.224e-4;1.533e-4;3.988e-5;1.914e-7;4.328e-5;…
2.506e-7;4.036e-5;1.062e-6;6.055e-7;]; % rate at Tref=230C [mol/(s.g_cat)]
Eact=[109.5; 15.23; 7.88; 44.45; 9.438; 8.426; 10.91; 12.54; 7.127]; % activation energy [J/mol];
k=kref.*exp(-Eact*(1/T1-1/T2)/R); % rate at T=T2 [mol/(s.g)]
kL=1; kH=1;
% Specify initial conditions
xinit=zeros(15,1); % initial state vector
xinit(1)=C1*VR; % initial ethylene in gas (mol)
xinit(14)=36.63/156; % initial undecane in liquid (mol)
xinit(7) = xinit(14)*VG*K(7)/VL; % initial undecane in gas (mol)
xinit(8) = xinit(1)*VL/(K(1)*VG); % initial ethylene in liquid (mol)
xinit(15)=Q1*C1; % initial outflow rate (mol/s)
nToti=sum(xinit(1:7)); % initial moles in gas (mol)
%%Setpoint
nGin_setpoint=0.363839693638512;
%Set Point Tracking & Load Rejection
%t1 = 1800; t2 = 3600; t3 = 5400; t4 = 7200; t5 = 9000; t6 = 10800; t7 = 12600; t8 = 14400; t9 = 16200; t10 = 18000;
% Step 1
% +5% change in set point
%if t >= t1 && t <= t2
% nGin_setpoint = 0.616018502797380*1.05;
% Step 2
% -5% change in set point and disturbance
%elseif t >= t3 && t <= t4
% nGin_setpoint = 0.616018502797380*0.95;
% Step 3
% +10% change in setpoint
%elseif t >=t5 && t<= t6
% nGin_setpoint = 0.616018502797380*1.1;
% Step 4
% -10% change in set point
%elseif t >=t7 && t <= t8
% nGin_setpoint = 0.616018502797380*0.9;
% Step 5
% +20% change in set point
%elseif t >= t9 && t <= t10
% nGin_setpoint = 0.616018502797380*1.2;
%end
e_mol_gases = sum(x(1:7)) – nGin_setpoint;
F_G_R = Kc_Total_gases*(e_mol_gases+tauI_Total_gases*e_integral);
%Right-hand side evaluation of the dynamic model (DAE set)
S1 = Q1*C1-F_G_R*x(1)/sum(x(1:7))-VR*kL*(x(1)/VG-K(1)*x(8)/VL); % gas phase ethylene (mol/s)
S2 = Q2-F_G_R*x(2)/sum(x(1:7))-VR*kL*(x(2)/VG-K(2)*x(9)/VL); % gas phase butene (mol/s);
S3 = Q3-F_G_R*x(3)/sum(x(1:7))-VR*kL*(x(3)/VG-K(3)*x(10)/VL); % gas phase hexene (mol/s);
S4= Q4-F_G_R*x(4)/sum(x(1:7))-VR*kH*(x(4)/VG-K(4)*x(11)/VL); % gas phase octene (mol/s);
S5= Q5-F_G_R*x(5)/sum(x(1:7))-VR*kH*(x(5)/VG-K(5)*x(12)/VL); % gas phase decene (mol/s);
S6= Q6-F_G_R*x(6)/sum(x(1:7))-VR*kH*(x(6)/VG-K(6)*x(13)/VL); % gas phase dodecene (mol/s);
S7= Q7-F_G_R*x(7)/sum(x(1:7))-VR*kH*(x(7)/VG-K(7)*x(14)/VL); % gas phase undecane (mol/s) ;
S8= VR*kL*(x(1)/VG-K(1)*x(8)/VL)+wc*(-2*k(1)*x(8)^2/VL^2-k(2)*x(8)*x(9)/VL^2-k(3)*x(8)*x(10)/VL^2-k(5)*x(8)*x(11)/VL^2-k(7)*x(8)*x(12)/VL^2);
S9= VR*kL*(x(2)/VG-K(2)*x(9)/VL)+wc*(k(1)*x(8)^2/VL^2-k(2)*x(8)*x(9)/VL^2-2*k(4)*x(9)^2/VL.^2-k(6)*x(9)*x(10)/VL^2-k(8)*x(9)*x(11)/VL^2);
S10= VR*kL*(x(3)/VG-K(3)*x(10)/VL)+wc*(k(2)*x(8)*x(9)/VL^2-k(3)*x(8)*x(10)/VL^2-k(6)*x(9)*x(10)/VL.^2-2*k(9)*x(10)^2/VL^2);
S11= VR*kH*(x(4)/VG-K(4)*x(11)/VL)+wc*(k(3)*x(8)*x(10)/VL^2+k(4)*x(9)^2/VL^2-k(5)*x(8)*x(11)/VL^2-k(8)*x(9)*x(11)/VL^2);
S12= VR*kH*(x(5)/VG-K(5)*x(12)/VL)+wc*(k(5)*x(8)*x(11)/VL^2+k(6)*x(9)*x(10)/VL^2-k(7)*x(8)*x(12)/VL^2);
S13= VR*kH*(x(6)/VG-K(6)*x(13)/VL)+wc*(k(7)*x(8)*x(12)/VL^2+k(8)*x(9)*x(11)/VL^2+k(9)*x(10)^2/VL^2);
S14= VR*kH*(x(7)/VG-K(7)*x(14)/VL);
S15= sum(x(1:7))-(nGin_setpoint); %Error
S = ([S1; S2; S3; S4; S5; S6; S7; S8; S9; S10; S11; S12; S13; S14; S15]);
end
I want to solve the S1,S2,..,S15 equations for different Q0 and T1. I have tried this code:
clear variables
clc
%Initial Condition
Q0=350; T1=230;
%S = @Sec_model_fun_for_optimization;
%S1 = S(Q0,T1);
y0 = [0.258176232100050 0 0 0 0 0 0.105663461538462 0.0159368044506204 0 0 0 0 0 0.234807692307692 0 Q0 T1];
%options = odeset(‘RelTol’,1e-5,’AbsTol’,1e-7);
[t,y]= ode23s(@Sec_model_fun_for_optimization,[0 18000],y0);
but I have got this error:
Not enough input arguments.
Error in Sec_model_fun_for_optimization (line 27)
Q1=Q0*1e-6/60; % Q_G ethylene inflow (m3/s)
As you can see I have done it in a wrong way and MATLAB can’t recognize Q0 and T1 as my function inputs. What should I do to solve this problem??Hi guys. I have this function that gives me the equations for my DAE system.
function S = Sec_model_fun(t,x,Q0,T1)
%%Dynamic state inputs
n_C2_gas=x(1); %Ethylene mols in gas phase[mol]
n_C4_gas=x(2); %Butene mols in gas phase[mol]
n_C6_gas=x(3); %Hexene mols in gas phase[mol]
n_C8_gas=x(4); %Octene mols in gas phase[mol]
n_C10_gas=x(5); %Decene mols in gas phase[mol]
n_C12_gas=x(6); %Dodecene mols in gas phase[mol]
n_C11_gas=x(7); %Undecene mols in gas phase[mol]
n_C2_liquid=x(8); %Ethylene mols in liquid phase[mol]
n_C4_liquid=x(9); %Butene mols in liquid phase[mol]
n_C6_liquid=x(10); %Hexene mols in liquid phase[mol]
n_C8_liquid=x(11); %Octene mols in liquid phase[mol]
n_C10_liquid=x(12); %Decene mols in liquid phase[mol]
n_C12_liquid=x(13); %Dodecene mols in liquid phase[mol]
n_C11_liquid=x(14); %Undecene mols in liquid phase[mol]
e_integral = x(15); %Error[mol/s]
%FGout = x(16); %Gas outlet[mol/s]
%% Constants
Kc_Total_gases = 1;
tauI_Total_gases =1;
%Q0=350; % Q_G etylene inflow (ml/min)
Q1=Q0*1e-6/60; % Q_G ethylene inflow (m3/s)
Q2=0; % Q_G butene inflow
Q3=0; % Q_G hexene inflow
Q4=0; % Q_G octene inflow
Q5=0; % Q_G decene inflow
Q6=0; % Q_G dodecene inflow
Q7=0; % Q_G undecane inflow
P1=36e5; % ethylene inflow pressure [Pa]
%T1=230+273.15; % T_Ethylene [K]
T2=230+273.15; % T_ref [K]
R=8.314; % gas constant [J/(mol.K)]
C1=P1/(R*T1); % ethylene inlet gas concentration [mol/m^3]
F0=0.0179; % gas outflow rate [mmol/s]
F1=F0.*1e-3; % gas outflow rate [mol/s]
VR=300e-6; % reactor volume [m^3]
VG=250e-6; % gas volume [m^3]
VL=50e-6; % liquid volume [m^3]
K=[3.24;2.23;1.72;0.2;0.1;0.08;0.09]; % solubility [nondim]
moleWt=[28;56;84;112;140;168;156]; % mole weight C2,C4,…,C12,C11 [g/mol]
wc=(0.3+0.25)*1e-3; % catalyst weight [kg]
kref=[2.224e-4;1.533e-4;3.988e-5;1.914e-7;4.328e-5;…
2.506e-7;4.036e-5;1.062e-6;6.055e-7;]; % rate at Tref=230C [mol/(s.g_cat)]
Eact=[109.5; 15.23; 7.88; 44.45; 9.438; 8.426; 10.91; 12.54; 7.127]; % activation energy [J/mol];
k=kref.*exp(-Eact*(1/T1-1/T2)/R); % rate at T=T2 [mol/(s.g)]
kL=1; kH=1;
% Specify initial conditions
xinit=zeros(15,1); % initial state vector
xinit(1)=C1*VR; % initial ethylene in gas (mol)
xinit(14)=36.63/156; % initial undecane in liquid (mol)
xinit(7) = xinit(14)*VG*K(7)/VL; % initial undecane in gas (mol)
xinit(8) = xinit(1)*VL/(K(1)*VG); % initial ethylene in liquid (mol)
xinit(15)=Q1*C1; % initial outflow rate (mol/s)
nToti=sum(xinit(1:7)); % initial moles in gas (mol)
%%Setpoint
nGin_setpoint=0.363839693638512;
%Set Point Tracking & Load Rejection
%t1 = 1800; t2 = 3600; t3 = 5400; t4 = 7200; t5 = 9000; t6 = 10800; t7 = 12600; t8 = 14400; t9 = 16200; t10 = 18000;
% Step 1
% +5% change in set point
%if t >= t1 && t <= t2
% nGin_setpoint = 0.616018502797380*1.05;
% Step 2
% -5% change in set point and disturbance
%elseif t >= t3 && t <= t4
% nGin_setpoint = 0.616018502797380*0.95;
% Step 3
% +10% change in setpoint
%elseif t >=t5 && t<= t6
% nGin_setpoint = 0.616018502797380*1.1;
% Step 4
% -10% change in set point
%elseif t >=t7 && t <= t8
% nGin_setpoint = 0.616018502797380*0.9;
% Step 5
% +20% change in set point
%elseif t >= t9 && t <= t10
% nGin_setpoint = 0.616018502797380*1.2;
%end
e_mol_gases = sum(x(1:7)) – nGin_setpoint;
F_G_R = Kc_Total_gases*(e_mol_gases+tauI_Total_gases*e_integral);
%Right-hand side evaluation of the dynamic model (DAE set)
S1 = Q1*C1-F_G_R*x(1)/sum(x(1:7))-VR*kL*(x(1)/VG-K(1)*x(8)/VL); % gas phase ethylene (mol/s)
S2 = Q2-F_G_R*x(2)/sum(x(1:7))-VR*kL*(x(2)/VG-K(2)*x(9)/VL); % gas phase butene (mol/s);
S3 = Q3-F_G_R*x(3)/sum(x(1:7))-VR*kL*(x(3)/VG-K(3)*x(10)/VL); % gas phase hexene (mol/s);
S4= Q4-F_G_R*x(4)/sum(x(1:7))-VR*kH*(x(4)/VG-K(4)*x(11)/VL); % gas phase octene (mol/s);
S5= Q5-F_G_R*x(5)/sum(x(1:7))-VR*kH*(x(5)/VG-K(5)*x(12)/VL); % gas phase decene (mol/s);
S6= Q6-F_G_R*x(6)/sum(x(1:7))-VR*kH*(x(6)/VG-K(6)*x(13)/VL); % gas phase dodecene (mol/s);
S7= Q7-F_G_R*x(7)/sum(x(1:7))-VR*kH*(x(7)/VG-K(7)*x(14)/VL); % gas phase undecane (mol/s) ;
S8= VR*kL*(x(1)/VG-K(1)*x(8)/VL)+wc*(-2*k(1)*x(8)^2/VL^2-k(2)*x(8)*x(9)/VL^2-k(3)*x(8)*x(10)/VL^2-k(5)*x(8)*x(11)/VL^2-k(7)*x(8)*x(12)/VL^2);
S9= VR*kL*(x(2)/VG-K(2)*x(9)/VL)+wc*(k(1)*x(8)^2/VL^2-k(2)*x(8)*x(9)/VL^2-2*k(4)*x(9)^2/VL.^2-k(6)*x(9)*x(10)/VL^2-k(8)*x(9)*x(11)/VL^2);
S10= VR*kL*(x(3)/VG-K(3)*x(10)/VL)+wc*(k(2)*x(8)*x(9)/VL^2-k(3)*x(8)*x(10)/VL^2-k(6)*x(9)*x(10)/VL.^2-2*k(9)*x(10)^2/VL^2);
S11= VR*kH*(x(4)/VG-K(4)*x(11)/VL)+wc*(k(3)*x(8)*x(10)/VL^2+k(4)*x(9)^2/VL^2-k(5)*x(8)*x(11)/VL^2-k(8)*x(9)*x(11)/VL^2);
S12= VR*kH*(x(5)/VG-K(5)*x(12)/VL)+wc*(k(5)*x(8)*x(11)/VL^2+k(6)*x(9)*x(10)/VL^2-k(7)*x(8)*x(12)/VL^2);
S13= VR*kH*(x(6)/VG-K(6)*x(13)/VL)+wc*(k(7)*x(8)*x(12)/VL^2+k(8)*x(9)*x(11)/VL^2+k(9)*x(10)^2/VL^2);
S14= VR*kH*(x(7)/VG-K(7)*x(14)/VL);
S15= sum(x(1:7))-(nGin_setpoint); %Error
S = ([S1; S2; S3; S4; S5; S6; S7; S8; S9; S10; S11; S12; S13; S14; S15]);
end
I want to solve the S1,S2,..,S15 equations for different Q0 and T1. I have tried this code:
clear variables
clc
%Initial Condition
Q0=350; T1=230;
%S = @Sec_model_fun_for_optimization;
%S1 = S(Q0,T1);
y0 = [0.258176232100050 0 0 0 0 0 0.105663461538462 0.0159368044506204 0 0 0 0 0 0.234807692307692 0 Q0 T1];
%options = odeset(‘RelTol’,1e-5,’AbsTol’,1e-7);
[t,y]= ode23s(@Sec_model_fun_for_optimization,[0 18000],y0);
but I have got this error:
Not enough input arguments.
Error in Sec_model_fun_for_optimization (line 27)
Q1=Q0*1e-6/60; % Q_G ethylene inflow (m3/s)
As you can see I have done it in a wrong way and MATLAB can’t recognize Q0 and T1 as my function inputs. What should I do to solve this problem?? Hi guys. I have this function that gives me the equations for my DAE system.
function S = Sec_model_fun(t,x,Q0,T1)
%%Dynamic state inputs
n_C2_gas=x(1); %Ethylene mols in gas phase[mol]
n_C4_gas=x(2); %Butene mols in gas phase[mol]
n_C6_gas=x(3); %Hexene mols in gas phase[mol]
n_C8_gas=x(4); %Octene mols in gas phase[mol]
n_C10_gas=x(5); %Decene mols in gas phase[mol]
n_C12_gas=x(6); %Dodecene mols in gas phase[mol]
n_C11_gas=x(7); %Undecene mols in gas phase[mol]
n_C2_liquid=x(8); %Ethylene mols in liquid phase[mol]
n_C4_liquid=x(9); %Butene mols in liquid phase[mol]
n_C6_liquid=x(10); %Hexene mols in liquid phase[mol]
n_C8_liquid=x(11); %Octene mols in liquid phase[mol]
n_C10_liquid=x(12); %Decene mols in liquid phase[mol]
n_C12_liquid=x(13); %Dodecene mols in liquid phase[mol]
n_C11_liquid=x(14); %Undecene mols in liquid phase[mol]
e_integral = x(15); %Error[mol/s]
%FGout = x(16); %Gas outlet[mol/s]
%% Constants
Kc_Total_gases = 1;
tauI_Total_gases =1;
%Q0=350; % Q_G etylene inflow (ml/min)
Q1=Q0*1e-6/60; % Q_G ethylene inflow (m3/s)
Q2=0; % Q_G butene inflow
Q3=0; % Q_G hexene inflow
Q4=0; % Q_G octene inflow
Q5=0; % Q_G decene inflow
Q6=0; % Q_G dodecene inflow
Q7=0; % Q_G undecane inflow
P1=36e5; % ethylene inflow pressure [Pa]
%T1=230+273.15; % T_Ethylene [K]
T2=230+273.15; % T_ref [K]
R=8.314; % gas constant [J/(mol.K)]
C1=P1/(R*T1); % ethylene inlet gas concentration [mol/m^3]
F0=0.0179; % gas outflow rate [mmol/s]
F1=F0.*1e-3; % gas outflow rate [mol/s]
VR=300e-6; % reactor volume [m^3]
VG=250e-6; % gas volume [m^3]
VL=50e-6; % liquid volume [m^3]
K=[3.24;2.23;1.72;0.2;0.1;0.08;0.09]; % solubility [nondim]
moleWt=[28;56;84;112;140;168;156]; % mole weight C2,C4,…,C12,C11 [g/mol]
wc=(0.3+0.25)*1e-3; % catalyst weight [kg]
kref=[2.224e-4;1.533e-4;3.988e-5;1.914e-7;4.328e-5;…
2.506e-7;4.036e-5;1.062e-6;6.055e-7;]; % rate at Tref=230C [mol/(s.g_cat)]
Eact=[109.5; 15.23; 7.88; 44.45; 9.438; 8.426; 10.91; 12.54; 7.127]; % activation energy [J/mol];
k=kref.*exp(-Eact*(1/T1-1/T2)/R); % rate at T=T2 [mol/(s.g)]
kL=1; kH=1;
% Specify initial conditions
xinit=zeros(15,1); % initial state vector
xinit(1)=C1*VR; % initial ethylene in gas (mol)
xinit(14)=36.63/156; % initial undecane in liquid (mol)
xinit(7) = xinit(14)*VG*K(7)/VL; % initial undecane in gas (mol)
xinit(8) = xinit(1)*VL/(K(1)*VG); % initial ethylene in liquid (mol)
xinit(15)=Q1*C1; % initial outflow rate (mol/s)
nToti=sum(xinit(1:7)); % initial moles in gas (mol)
%%Setpoint
nGin_setpoint=0.363839693638512;
%Set Point Tracking & Load Rejection
%t1 = 1800; t2 = 3600; t3 = 5400; t4 = 7200; t5 = 9000; t6 = 10800; t7 = 12600; t8 = 14400; t9 = 16200; t10 = 18000;
% Step 1
% +5% change in set point
%if t >= t1 && t <= t2
% nGin_setpoint = 0.616018502797380*1.05;
% Step 2
% -5% change in set point and disturbance
%elseif t >= t3 && t <= t4
% nGin_setpoint = 0.616018502797380*0.95;
% Step 3
% +10% change in setpoint
%elseif t >=t5 && t<= t6
% nGin_setpoint = 0.616018502797380*1.1;
% Step 4
% -10% change in set point
%elseif t >=t7 && t <= t8
% nGin_setpoint = 0.616018502797380*0.9;
% Step 5
% +20% change in set point
%elseif t >= t9 && t <= t10
% nGin_setpoint = 0.616018502797380*1.2;
%end
e_mol_gases = sum(x(1:7)) – nGin_setpoint;
F_G_R = Kc_Total_gases*(e_mol_gases+tauI_Total_gases*e_integral);
%Right-hand side evaluation of the dynamic model (DAE set)
S1 = Q1*C1-F_G_R*x(1)/sum(x(1:7))-VR*kL*(x(1)/VG-K(1)*x(8)/VL); % gas phase ethylene (mol/s)
S2 = Q2-F_G_R*x(2)/sum(x(1:7))-VR*kL*(x(2)/VG-K(2)*x(9)/VL); % gas phase butene (mol/s);
S3 = Q3-F_G_R*x(3)/sum(x(1:7))-VR*kL*(x(3)/VG-K(3)*x(10)/VL); % gas phase hexene (mol/s);
S4= Q4-F_G_R*x(4)/sum(x(1:7))-VR*kH*(x(4)/VG-K(4)*x(11)/VL); % gas phase octene (mol/s);
S5= Q5-F_G_R*x(5)/sum(x(1:7))-VR*kH*(x(5)/VG-K(5)*x(12)/VL); % gas phase decene (mol/s);
S6= Q6-F_G_R*x(6)/sum(x(1:7))-VR*kH*(x(6)/VG-K(6)*x(13)/VL); % gas phase dodecene (mol/s);
S7= Q7-F_G_R*x(7)/sum(x(1:7))-VR*kH*(x(7)/VG-K(7)*x(14)/VL); % gas phase undecane (mol/s) ;
S8= VR*kL*(x(1)/VG-K(1)*x(8)/VL)+wc*(-2*k(1)*x(8)^2/VL^2-k(2)*x(8)*x(9)/VL^2-k(3)*x(8)*x(10)/VL^2-k(5)*x(8)*x(11)/VL^2-k(7)*x(8)*x(12)/VL^2);
S9= VR*kL*(x(2)/VG-K(2)*x(9)/VL)+wc*(k(1)*x(8)^2/VL^2-k(2)*x(8)*x(9)/VL^2-2*k(4)*x(9)^2/VL.^2-k(6)*x(9)*x(10)/VL^2-k(8)*x(9)*x(11)/VL^2);
S10= VR*kL*(x(3)/VG-K(3)*x(10)/VL)+wc*(k(2)*x(8)*x(9)/VL^2-k(3)*x(8)*x(10)/VL^2-k(6)*x(9)*x(10)/VL.^2-2*k(9)*x(10)^2/VL^2);
S11= VR*kH*(x(4)/VG-K(4)*x(11)/VL)+wc*(k(3)*x(8)*x(10)/VL^2+k(4)*x(9)^2/VL^2-k(5)*x(8)*x(11)/VL^2-k(8)*x(9)*x(11)/VL^2);
S12= VR*kH*(x(5)/VG-K(5)*x(12)/VL)+wc*(k(5)*x(8)*x(11)/VL^2+k(6)*x(9)*x(10)/VL^2-k(7)*x(8)*x(12)/VL^2);
S13= VR*kH*(x(6)/VG-K(6)*x(13)/VL)+wc*(k(7)*x(8)*x(12)/VL^2+k(8)*x(9)*x(11)/VL^2+k(9)*x(10)^2/VL^2);
S14= VR*kH*(x(7)/VG-K(7)*x(14)/VL);
S15= sum(x(1:7))-(nGin_setpoint); %Error
S = ([S1; S2; S3; S4; S5; S6; S7; S8; S9; S10; S11; S12; S13; S14; S15]);
end
I want to solve the S1,S2,..,S15 equations for different Q0 and T1. I have tried this code:
clear variables
clc
%Initial Condition
Q0=350; T1=230;
%S = @Sec_model_fun_for_optimization;
%S1 = S(Q0,T1);
y0 = [0.258176232100050 0 0 0 0 0 0.105663461538462 0.0159368044506204 0 0 0 0 0 0.234807692307692 0 Q0 T1];
%options = odeset(‘RelTol’,1e-5,’AbsTol’,1e-7);
[t,y]= ode23s(@Sec_model_fun_for_optimization,[0 18000],y0);
but I have got this error:
Not enough input arguments.
Error in Sec_model_fun_for_optimization (line 27)
Q1=Q0*1e-6/60; % Q_G ethylene inflow (m3/s)
As you can see I have done it in a wrong way and MATLAB can’t recognize Q0 and T1 as my function inputs. What should I do to solve this problem?? function, ode MATLAB Answers — New Questions
To Do Crashing on iPhone
Hi,
I have been using To Do on my iphone for few years and just recently started crashing and becoming annoying.
I tried many things such as deleting the app and reinstalling it, restarting my iphone, etc. but with no luck. I have been doing that for at least 3 weeks.
I am using the latest To Do version and iOS 17.5
Any help or Microsoft contact for To Do?
Thanks
Hi,I have been using To Do on my iphone for few years and just recently started crashing and becoming annoying. I tried many things such as deleting the app and reinstalling it, restarting my iphone, etc. but with no luck. I have been doing that for at least 3 weeks. I am using the latest To Do version and iOS 17.5 Any help or Microsoft contact for To Do?Thanks Read More
Renumber specific footnote
Hello
I would like my footnote numbering to skip numbers 71-75 and go from 70 to 76.
Footnote 76 is not in a different chapter; Actually my document is consisted of extracts of a single chapter text (hence the omission of several footnotes) but I still want the original footnote numbering kept.
Thanks
Hello I would like my footnote numbering to skip numbers 71-75 and go from 70 to 76. Footnote 76 is not in a different chapter; Actually my document is consisted of extracts of a single chapter text (hence the omission of several footnotes) but I still want the original footnote numbering kept. Thanks Read More
Excel Script Sharing Issues
Hi All,
I’ve created a sheet that uses a series of scripts for its basic functionality. The scripts have been working perfectly well for months (they need to get run multiple times per hour). When i originally shared the workbooks with people I created a sharing link and emailed it to them. This rapidly became unworkable because this didn’t easily include the ability to remove people’s access (and the people who need/don’t need access changes fairly constantly). So i removed everyones access, and re-shared person by person. Since I made this change issues have arisen around people within the organisation being able to run the scripts. I’ve gone so far as to turn the principle users into full owners of both the onedrive folder that contains the workbook as well as the folder that contains the various scripts.
The mad thing is when they open the workbook, they can run the script once, and then it stops working saying they need to contact the script owner as it has been unshared. Can anyone advise a good solution? Ideally I would like to embed the script entirely within the sheet so there are not sharing access issues (like a VBA macro used to be). Is there any way to do this?
Thanks for any advice.
Hi All, I’ve created a sheet that uses a series of scripts for its basic functionality. The scripts have been working perfectly well for months (they need to get run multiple times per hour). When i originally shared the workbooks with people I created a sharing link and emailed it to them. This rapidly became unworkable because this didn’t easily include the ability to remove people’s access (and the people who need/don’t need access changes fairly constantly). So i removed everyones access, and re-shared person by person. Since I made this change issues have arisen around people within the organisation being able to run the scripts. I’ve gone so far as to turn the principle users into full owners of both the onedrive folder that contains the workbook as well as the folder that contains the various scripts. The mad thing is when they open the workbook, they can run the script once, and then it stops working saying they need to contact the script owner as it has been unshared. Can anyone advise a good solution? Ideally I would like to embed the script entirely within the sheet so there are not sharing access issues (like a VBA macro used to be). Is there any way to do this? Thanks for any advice. Read More
MSIX Packaging Tool 1.2024.405.0 Release available
There is a new release of the MMPT available in the Microsoft store. It is version 1.2024.405.0. The release notes may be found at MSIX Packaging Tool release notes – MSIX | Microsoft Learn . Seems mostly about updates to what they can do with their version of the PSF.
Note: There is also a newer release build (1.2024.508.0) in the MMPT insider program mentioned on the page above. This would seem to be the support for the long awaited change to Azure Code Signing from the V2 to the new version that has been in preview mode itself for a long time. Perhaps that means we’ll see GA on that soon.
There is a new release of the MMPT available in the Microsoft store. It is version 1.2024.405.0. The release notes may be found at MSIX Packaging Tool release notes – MSIX | Microsoft Learn . Seems mostly about updates to what they can do with their version of the PSF.
Note: There is also a newer release build (1.2024.508.0) in the MMPT insider program mentioned on the page above. This would seem to be the support for the long awaited change to Azure Code Signing from the V2 to the new version that has been in preview mode itself for a long time. Perhaps that means we’ll see GA on that soon. Read More
matrix division
how to divide a full table by a fixed number?
how to divide a full table by a fixed number? Read More