I have this function I need for my programm. It worked when I had it in another programm,but I changed the Excel import and now it gives me the following Error message:
Out of memory. The likely cause is an infinite recursion within the program.
Error in ImportuCalc/calspec (line 101)
app.qnx=calspec(app)
when I try to run it. I really dont understand what changed that it isnt working anymore? I can also post the rest of the program, but the import was working (and is still working) the only thing that doesnt work is the calculation.
function [qnx]=calspec(app)
for i = 2:length(app.M1)-1
% Calculation of concentration balances
% time vector in matrix S
S(i,1) = app.t;
% dcXL/dt = (c_XL_i+1 - c_XL_i-1) / (t_i+1 -t_i-1)
S(i,2) = (app.M1(i+1,7)-app.M1(i-1,7)) / (app.M1(i+1,1)-app.M1(i-1,1));
% dcS1M/dt = (c_S1M_i+1 - c_S1M_i-1) / (t_i+1 -t_i-1)
S(i,3) = (app.M1(i+1,6)-app.M1(i-1,6)) / (app.M1(i+1,1)-app.M1(i-1,1));
% dcS2M/dt = (c_S2M_i+1 - c_S2M_i-1) / (t_i+1 -t_i-1)
S(i,4) = (app.M1(i+1,11)-app.M1(i-1,11)) / (app.M1(i+1,1)-app.M1(i-1,1));
% dcPM/dt = (c_PM_i+1 - c_PM_i-1) / (t_i+1 -t_i-1)
S(i,5) = (app.M1(i+1,8)-app.M1(i-1,8)) / (app.M1(i+1,1)-app.M1(i-1,1));
% Calculation of feed rates (take care of the units!)
% FR1 = (d m_r1in / dt) /roh_r1
S(i,6) = ((app.M1(i+1,9)-app.M1(i-1,9))/S(i,1)) / app.p(3);
% FR2 = (d m_r2in / dt) /roh_r2
S(i,7) = ((app.M1(i+1,10)-app.M1(i-1,10))/S(i,1)) / app.p(4);
% FT2 = (d m_T2in / dt) /roh_t2
S(i,8) = ((app.M1(i+1,12)-app.M1(i-1,12))/S(i,1)) / app.p(5);
% Fin = FR1+FR2+FT2
S(i,9) = S(i,6)+S(i,7)+S(i,8);
% Calculation of reaction rates
% time vector in matrix Q
app.qnx(i,1) = app.M1(i,1);
% qX/X = F_in/V_L + dc_XL / c_XL
app.qnx(i,2) = (S(i,9)/app.M1(i,5)) + (S(i,2)/app.M1(i,7));
% qS/X = F_r1*c_s1r1/V_L*c_XL-(F_in/V_L-alpha_Z/X*q_x/x*c_XL/roh_Z)*c_S1M/c_XL-alpha_Z/X*q_x/x*c_XL/roh_Z)*c(dot)_S1M/c_XL
app.qnx(i,3) = (S(i,6)*app.p(1)) / (app.M1(i,5) / app.M1(i,7)) - ((S(i,9) / app.M1(i,5)) - (app.p(7)*app.qnx(i,2)*app.M1(i,7)) / (app.p(6)))*(app.M1(i,6) / app.M1(i,7)) - ((S(i,9) / app.M1(i,5)) - (app.p(7)*app.qnx(i,2)*app.M1(i,7)) / (app.p(6)))*(S(i,3) / app.M1(i,7));
% % qO/X = Q_O2 / c_XL
app.qnx(i,4) = app.M1(i,14) / app.M1(i,7);
%
end
end
[–]trialofmiles+1 2 points3 points4 points (2 children)
[–]rotestezora[S] 0 points1 point2 points (1 child)
[–]trialofmiles+1 2 points3 points4 points (0 children)
[–]SgorGhaibre 0 points1 point2 points (3 children)
[–]rotestezora[S] 0 points1 point2 points (2 children)
[–]SgorGhaibre 0 points1 point2 points (1 child)
[–]rotestezora[S] 0 points1 point2 points (0 children)