TransWikia.com

whats wrong in this equation

TeX - LaTeX Asked by Mrinai on April 20, 2021

begin{equation}label{eq:42}
 E_t(k,d)=left{ begin{array}{cc} k * E_{ele} + k * E_{fs} * d^2 mbox{~ if} d< d_0 ,   k * E_{ele} + k * E_{mp} * d^4 mbox{~ if} dgeq d_0
 end{array}
end{equation}

2 Answers

It lacks a right. to close the left{. See the code below:

begin{equation}label{eq:42}
 E_t(k,d)=left{ begin{array}{cc} k * E_{ele} + k * E_{fs} * d^2 mbox{~ if} d< d_0 ,   k * E_{ele} + k * E_{mp} * d^4 mbox{~ if} dgeq d_0
 end{array}right. %<-- this one was missing
end{equation}

Another alternative is use cases from amsmath package:

begin{equation}
 E_t(k,d)=begin{cases}
 k * E_{ele} + k * E_{fs} * d^2  & mbox{~ if} d< d_0 , 
 k * E_{ele} + k * E_{mp} * d^4 & mbox{~ if} dgeq d_0
 end{cases}
end{equation}

I add a MWE with both options:

documentclass{article}
usepackage{amsmath}
begin{document}
begin{equation}label{eq:42}
 E_t(k,d)=left{ begin{array}{cc} k * E_{ele} + k * E_{fs} * d^2 mbox{~ if} d< d_0 ,   k * E_{ele} + k * E_{mp} * d^4 mbox{~ if} dgeq d_0
 end{array}right. %<-- this one was missing
end{equation}

medskip

begin{equation}
 E_t(k,d)=begin{cases}
 k * E_{ele} + k * E_{fs} * d^2  & mbox{~ if} d< d_0 , 
 k * E_{ele} + k * E_{mp} * d^4 & mbox{~ if} dgeq d_0
 end{cases}
end{equation}

end{document}

And the output:

enter image description here

Answered by Luis Turcio on April 20, 2021

There are many things wrong, I'm afraid.

The main error is about TeX syntax: a left command must have a corresponding right one, in this case right., since you don't want a right fence.

On the other hand, the output is not really pretty

enter image description here

Let's try to correct it.

  1. You should load amsmath and use its cases environment.
  2. Multiplication is never denoted with an asterisk in math.
  3. Textual subscripts should be upright.

enter image description here

documentclass{article}
usepackage{amsmath}

begin{document}

begin{equation}label{eq:42}
 E_t(k,d)=
begin{cases}
k E_{mathrm{ele}} + k E_{mathrm{fs}} d^2 & text{if } d< d_0 , 
k E_{mathrm{ele}} + k E_{mathrm{mp}} d^4 & text{if } dgeq d_0
end{cases}
end{equation}

end{document}

Answered by egreg on April 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP