Evaluating exp(x) * sin(x): What's the Problem?

  • Thread starter waht
  • Start date
In summary, the purpose of evaluating exp(x) * sin(x) is to determine the value of the mathematical expression exp(x) * sin(x) at a specific value of x. However, there can be problems with this evaluation, such as numerical instability and overflow/underflow errors. To address these issues, specialized numerical methods can be used. This evaluation is commonly used in physics, engineering, finance, and numerical analysis and scientific computing.
  • #1
waht
1,501
4
When I generate a list x = (-10:0.1:10)

and want to evaluate it using a function

exp(x) * sin(x)

I get this error

error: operator *: nonconformant arguments (op1 is 1x101, op2 is 1x101)
error: evaluating binary operator `*' near line 4, column 11
error: evaluating assignment expression near line 4, column 3

wondering what's the problem here?
 
Physics news on Phys.org
  • #2
try exp(x).*sin(x) which is a matrix element by element multiply which should give you a 1 x 101 matrix.
 
  • #3
Thanks in worked. Didn't know you had to use .* operator.
 

1. What is the purpose of evaluating exp(x) * sin(x)?

The purpose of evaluating exp(x) * sin(x) is to determine the value of the mathematical expression exp(x) * sin(x) at a specific value of x. This can be useful in solving various mathematical problems and understanding the behavior of exponential and trigonometric functions.

2. What is the problem with evaluating exp(x) * sin(x)?

The problem with evaluating exp(x) * sin(x) is that both exponential and trigonometric functions can have very large or very small values, which can lead to numerical instability or inaccuracies in the result. This is especially true when x is a large or small number, or when it approaches zero.

3. How can the problem with evaluating exp(x) * sin(x) be addressed?

One way to address the problem is by using specialized numerical methods, such as Taylor series or Chebyshev polynomials, to evaluate the expression. These methods can handle large and small values of x more accurately and efficiently than direct evaluation.

4. Are there any other possible issues when evaluating exp(x) * sin(x)?

Yes, another issue that can arise when evaluating exp(x) * sin(x) is the potential for overflow or underflow errors. These errors occur when the result of the computation is too large or too small to be represented by the computer's memory, leading to incorrect or meaningless results.

5. In what fields or applications is evaluating exp(x) * sin(x) commonly used?

Evaluating exp(x) * sin(x) is commonly used in fields such as physics, engineering, and finance, where exponential and trigonometric functions are frequently encountered. It is also used in numerical analysis and scientific computing to solve various mathematical problems and simulations.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
881
  • Calculus and Beyond Homework Help
Replies
1
Views
825
Replies
3
Views
263
  • Programming and Computer Science
Replies
7
Views
1K
  • Programming and Computer Science
Replies
1
Views
646
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top