Error emerged when i run the following latex code, please help me. Thanks












0















documentclass[energies,article,accept,moreauthors,pdftex,10pt,a4paper]{mdpi}
usepackage{booktabs}
usepackage{array} newcommand{PreserveBackslash}[1]{lettemp=\#1let\=temp}
newcolumntype{C}[1]{>{PreserveBackslashcentering}m{#1}}
newcolumntype{R}[1]{>{PreserveBackslashraggedleft}m{#1}}
newcolumntype{L}[1]{>{PreserveBackslashraggedright}m{#1}}
usepackage{booktabs}
usepackage{multirow}
begin{document}
begin{algorithm}[H]
caption{EDE.}
label{pseudoEDE}

Parameters initialization ${Max.iter,CR, POP, and h}$;
Population generation using Equation (ref{eq:7}) ;
For {h = 1:H}
{
Compute mutant vector using Equation (ref{eq:8});
For{iter= 1:Max.iter}
{ Compute first trial vector with CR 0.3;
If {$rand() leq 0.3$}
{$mu_{j}=upsilon_{j}$\
else\
{$mu_{j}=x_{j}$}
}


Compute second trial vector with CR 0.6;
If {$rand() leq 0.6$}
{ $mu_{j}=upsilon_{j}$\
else\
{ $mu_{j}=x_{j}$ }
}

Compute third trial vector with CR 0.9;
If {$rand() leq 0.9$}
{$mu_{j}=upsilon_{j}$\
else\
{$mu_{j}=x_{j}$}
}

Create $4^{th}$ and $5^{th}$ trial vector using Equations (ref{4_trial}) and (ref{5_trial});
Findout trial vector which is best ;
$X_{new} gets$ best of $ mu_{j}$ ;
Compare trial vector with target vector;
If {$f({X_{new}}) < f (X_{j})$}
{$X_{j} = X_{new}$}
}
}
end{algorithm}

begin{algorithm}[H]
caption{GWO.}
label{pseudoGWO}
Parameters initialization ${Maxiter, POP, D, alpha, beta, delta}$;
Initial population of gray wolves generation $X{i} (i=1,2,...,n)$;
$X(i,j)= rand (POP, D)$;
While {iter $<$ Maxiter}
{
For{i=1:POP}
{
Compute fitness using Equation (ref{eq:17});
If {fitness $ < alpha_{score} $ }
{$alpha_{score}$=fitness;
$alpha_{Pos}$= $X(i, :)$;}
If {fitness $ > alpha_{score}$ and fitness$<beta_{score }$}
{$beta_{score}$=fitness;
$beta_{Pos}$= $X(i, :)$;}
If {fitness $ > alpha_{score}$ and fitness$>beta_{score }$ and fitness$<delta_{score }$}
{$delta_{score}$=fitness;
$delta_{Pos}$= $X(i, :)$;}
}
For {i = 1:POP}
{For {j = 1:D}
{ Create $r1$ and $r2$ randomly with rand command;
Compute fitness coefficients A and C using Equations (ref{eq:ENP3}) and (ref{eq:ENP4});
Update values of ${alpha, beta$, and $delta}$ using Equation (ref{H5})--(ref{H7});
}
}
}
end{algorithm}par
vspace{12pt}
begin{document}









share|improve this question




















  • 1





    What is the error?

    – jaspast
    11 hours ago






  • 1





    Where is mdpi.cls? By the way, you don't have end{document}. Moreover, in Update values of ${alpha, beta$, and $delta}$ using... (the seventh line from below), for what purpose are the { and } supposed to do?

    – JouleV
    11 hours ago











  • @JouleV - I suspect that the second begin{document} is supposed to be end{document}...

    – Mico
    11 hours ago


















0















documentclass[energies,article,accept,moreauthors,pdftex,10pt,a4paper]{mdpi}
usepackage{booktabs}
usepackage{array} newcommand{PreserveBackslash}[1]{lettemp=\#1let\=temp}
newcolumntype{C}[1]{>{PreserveBackslashcentering}m{#1}}
newcolumntype{R}[1]{>{PreserveBackslashraggedleft}m{#1}}
newcolumntype{L}[1]{>{PreserveBackslashraggedright}m{#1}}
usepackage{booktabs}
usepackage{multirow}
begin{document}
begin{algorithm}[H]
caption{EDE.}
label{pseudoEDE}

Parameters initialization ${Max.iter,CR, POP, and h}$;
Population generation using Equation (ref{eq:7}) ;
For {h = 1:H}
{
Compute mutant vector using Equation (ref{eq:8});
For{iter= 1:Max.iter}
{ Compute first trial vector with CR 0.3;
If {$rand() leq 0.3$}
{$mu_{j}=upsilon_{j}$\
else\
{$mu_{j}=x_{j}$}
}


Compute second trial vector with CR 0.6;
If {$rand() leq 0.6$}
{ $mu_{j}=upsilon_{j}$\
else\
{ $mu_{j}=x_{j}$ }
}

Compute third trial vector with CR 0.9;
If {$rand() leq 0.9$}
{$mu_{j}=upsilon_{j}$\
else\
{$mu_{j}=x_{j}$}
}

Create $4^{th}$ and $5^{th}$ trial vector using Equations (ref{4_trial}) and (ref{5_trial});
Findout trial vector which is best ;
$X_{new} gets$ best of $ mu_{j}$ ;
Compare trial vector with target vector;
If {$f({X_{new}}) < f (X_{j})$}
{$X_{j} = X_{new}$}
}
}
end{algorithm}

begin{algorithm}[H]
caption{GWO.}
label{pseudoGWO}
Parameters initialization ${Maxiter, POP, D, alpha, beta, delta}$;
Initial population of gray wolves generation $X{i} (i=1,2,...,n)$;
$X(i,j)= rand (POP, D)$;
While {iter $<$ Maxiter}
{
For{i=1:POP}
{
Compute fitness using Equation (ref{eq:17});
If {fitness $ < alpha_{score} $ }
{$alpha_{score}$=fitness;
$alpha_{Pos}$= $X(i, :)$;}
If {fitness $ > alpha_{score}$ and fitness$<beta_{score }$}
{$beta_{score}$=fitness;
$beta_{Pos}$= $X(i, :)$;}
If {fitness $ > alpha_{score}$ and fitness$>beta_{score }$ and fitness$<delta_{score }$}
{$delta_{score}$=fitness;
$delta_{Pos}$= $X(i, :)$;}
}
For {i = 1:POP}
{For {j = 1:D}
{ Create $r1$ and $r2$ randomly with rand command;
Compute fitness coefficients A and C using Equations (ref{eq:ENP3}) and (ref{eq:ENP4});
Update values of ${alpha, beta$, and $delta}$ using Equation (ref{H5})--(ref{H7});
}
}
}
end{algorithm}par
vspace{12pt}
begin{document}









share|improve this question




















  • 1





    What is the error?

    – jaspast
    11 hours ago






  • 1





    Where is mdpi.cls? By the way, you don't have end{document}. Moreover, in Update values of ${alpha, beta$, and $delta}$ using... (the seventh line from below), for what purpose are the { and } supposed to do?

    – JouleV
    11 hours ago











  • @JouleV - I suspect that the second begin{document} is supposed to be end{document}...

    – Mico
    11 hours ago
















0












0








0








documentclass[energies,article,accept,moreauthors,pdftex,10pt,a4paper]{mdpi}
usepackage{booktabs}
usepackage{array} newcommand{PreserveBackslash}[1]{lettemp=\#1let\=temp}
newcolumntype{C}[1]{>{PreserveBackslashcentering}m{#1}}
newcolumntype{R}[1]{>{PreserveBackslashraggedleft}m{#1}}
newcolumntype{L}[1]{>{PreserveBackslashraggedright}m{#1}}
usepackage{booktabs}
usepackage{multirow}
begin{document}
begin{algorithm}[H]
caption{EDE.}
label{pseudoEDE}

Parameters initialization ${Max.iter,CR, POP, and h}$;
Population generation using Equation (ref{eq:7}) ;
For {h = 1:H}
{
Compute mutant vector using Equation (ref{eq:8});
For{iter= 1:Max.iter}
{ Compute first trial vector with CR 0.3;
If {$rand() leq 0.3$}
{$mu_{j}=upsilon_{j}$\
else\
{$mu_{j}=x_{j}$}
}


Compute second trial vector with CR 0.6;
If {$rand() leq 0.6$}
{ $mu_{j}=upsilon_{j}$\
else\
{ $mu_{j}=x_{j}$ }
}

Compute third trial vector with CR 0.9;
If {$rand() leq 0.9$}
{$mu_{j}=upsilon_{j}$\
else\
{$mu_{j}=x_{j}$}
}

Create $4^{th}$ and $5^{th}$ trial vector using Equations (ref{4_trial}) and (ref{5_trial});
Findout trial vector which is best ;
$X_{new} gets$ best of $ mu_{j}$ ;
Compare trial vector with target vector;
If {$f({X_{new}}) < f (X_{j})$}
{$X_{j} = X_{new}$}
}
}
end{algorithm}

begin{algorithm}[H]
caption{GWO.}
label{pseudoGWO}
Parameters initialization ${Maxiter, POP, D, alpha, beta, delta}$;
Initial population of gray wolves generation $X{i} (i=1,2,...,n)$;
$X(i,j)= rand (POP, D)$;
While {iter $<$ Maxiter}
{
For{i=1:POP}
{
Compute fitness using Equation (ref{eq:17});
If {fitness $ < alpha_{score} $ }
{$alpha_{score}$=fitness;
$alpha_{Pos}$= $X(i, :)$;}
If {fitness $ > alpha_{score}$ and fitness$<beta_{score }$}
{$beta_{score}$=fitness;
$beta_{Pos}$= $X(i, :)$;}
If {fitness $ > alpha_{score}$ and fitness$>beta_{score }$ and fitness$<delta_{score }$}
{$delta_{score}$=fitness;
$delta_{Pos}$= $X(i, :)$;}
}
For {i = 1:POP}
{For {j = 1:D}
{ Create $r1$ and $r2$ randomly with rand command;
Compute fitness coefficients A and C using Equations (ref{eq:ENP3}) and (ref{eq:ENP4});
Update values of ${alpha, beta$, and $delta}$ using Equation (ref{H5})--(ref{H7});
}
}
}
end{algorithm}par
vspace{12pt}
begin{document}









share|improve this question
















documentclass[energies,article,accept,moreauthors,pdftex,10pt,a4paper]{mdpi}
usepackage{booktabs}
usepackage{array} newcommand{PreserveBackslash}[1]{lettemp=\#1let\=temp}
newcolumntype{C}[1]{>{PreserveBackslashcentering}m{#1}}
newcolumntype{R}[1]{>{PreserveBackslashraggedleft}m{#1}}
newcolumntype{L}[1]{>{PreserveBackslashraggedright}m{#1}}
usepackage{booktabs}
usepackage{multirow}
begin{document}
begin{algorithm}[H]
caption{EDE.}
label{pseudoEDE}

Parameters initialization ${Max.iter,CR, POP, and h}$;
Population generation using Equation (ref{eq:7}) ;
For {h = 1:H}
{
Compute mutant vector using Equation (ref{eq:8});
For{iter= 1:Max.iter}
{ Compute first trial vector with CR 0.3;
If {$rand() leq 0.3$}
{$mu_{j}=upsilon_{j}$\
else\
{$mu_{j}=x_{j}$}
}


Compute second trial vector with CR 0.6;
If {$rand() leq 0.6$}
{ $mu_{j}=upsilon_{j}$\
else\
{ $mu_{j}=x_{j}$ }
}

Compute third trial vector with CR 0.9;
If {$rand() leq 0.9$}
{$mu_{j}=upsilon_{j}$\
else\
{$mu_{j}=x_{j}$}
}

Create $4^{th}$ and $5^{th}$ trial vector using Equations (ref{4_trial}) and (ref{5_trial});
Findout trial vector which is best ;
$X_{new} gets$ best of $ mu_{j}$ ;
Compare trial vector with target vector;
If {$f({X_{new}}) < f (X_{j})$}
{$X_{j} = X_{new}$}
}
}
end{algorithm}

begin{algorithm}[H]
caption{GWO.}
label{pseudoGWO}
Parameters initialization ${Maxiter, POP, D, alpha, beta, delta}$;
Initial population of gray wolves generation $X{i} (i=1,2,...,n)$;
$X(i,j)= rand (POP, D)$;
While {iter $<$ Maxiter}
{
For{i=1:POP}
{
Compute fitness using Equation (ref{eq:17});
If {fitness $ < alpha_{score} $ }
{$alpha_{score}$=fitness;
$alpha_{Pos}$= $X(i, :)$;}
If {fitness $ > alpha_{score}$ and fitness$<beta_{score }$}
{$beta_{score}$=fitness;
$beta_{Pos}$= $X(i, :)$;}
If {fitness $ > alpha_{score}$ and fitness$>beta_{score }$ and fitness$<delta_{score }$}
{$delta_{score}$=fitness;
$delta_{Pos}$= $X(i, :)$;}
}
For {i = 1:POP}
{For {j = 1:D}
{ Create $r1$ and $r2$ randomly with rand command;
Compute fitness coefficients A and C using Equations (ref{eq:ENP3}) and (ref{eq:ENP4});
Update values of ${alpha, beta$, and $delta}$ using Equation (ref{H5})--(ref{H7});
}
}
}
end{algorithm}par
vspace{12pt}
begin{document}






horizontal-alignment algorithms algorithm2e algorithmicx algorithmic






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 11 hours ago









JouleV

10.3k22558




10.3k22558










asked 11 hours ago









Ghulam HafeezGhulam Hafeez

364




364








  • 1





    What is the error?

    – jaspast
    11 hours ago






  • 1





    Where is mdpi.cls? By the way, you don't have end{document}. Moreover, in Update values of ${alpha, beta$, and $delta}$ using... (the seventh line from below), for what purpose are the { and } supposed to do?

    – JouleV
    11 hours ago











  • @JouleV - I suspect that the second begin{document} is supposed to be end{document}...

    – Mico
    11 hours ago
















  • 1





    What is the error?

    – jaspast
    11 hours ago






  • 1





    Where is mdpi.cls? By the way, you don't have end{document}. Moreover, in Update values of ${alpha, beta$, and $delta}$ using... (the seventh line from below), for what purpose are the { and } supposed to do?

    – JouleV
    11 hours ago











  • @JouleV - I suspect that the second begin{document} is supposed to be end{document}...

    – Mico
    11 hours ago










1




1





What is the error?

– jaspast
11 hours ago





What is the error?

– jaspast
11 hours ago




1




1





Where is mdpi.cls? By the way, you don't have end{document}. Moreover, in Update values of ${alpha, beta$, and $delta}$ using... (the seventh line from below), for what purpose are the { and } supposed to do?

– JouleV
11 hours ago





Where is mdpi.cls? By the way, you don't have end{document}. Moreover, in Update values of ${alpha, beta$, and $delta}$ using... (the seventh line from below), for what purpose are the { and } supposed to do?

– JouleV
11 hours ago













@JouleV - I suspect that the second begin{document} is supposed to be end{document}...

– Mico
11 hours ago







@JouleV - I suspect that the second begin{document} is supposed to be end{document}...

– Mico
11 hours ago












0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483014%2ferror-emerged-when-i-run-the-following-latex-code-please-help-me-thanks%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483014%2ferror-emerged-when-i-run-the-following-latex-code-please-help-me-thanks%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)