Understanding Symbolic Math in MATLAB: Real and Imaginary Parts

Click For Summary
SUMMARY

The discussion focuses on the behavior of symbolic math in MATLAB, specifically regarding the representation of imaginary numbers. When defining variables using the symbolic toolbox with the command syms RF R1 R2 w, the expression 3*R1*w*(RF + 200)/((R2*w*29*i + 3)*(3*R1*w - 2*i)) simplifies to include sqrt(-1) instead of i. The user seeks clarification on this behavior and how to extract the real part of the expression using real(ans), which returns a complex expression involving sqrt(-1).

PREREQUISITES
  • Familiarity with MATLAB symbolic toolbox
  • Understanding of complex numbers and their representation
  • Knowledge of MATLAB syntax for mathematical expressions
  • Basic concepts of real and imaginary parts in mathematics
NEXT STEPS
  • Explore MATLAB's symbolic math documentation for complex numbers
  • Learn how to manipulate symbolic expressions in MATLAB
  • Investigate the differences between i and sqrt(-1) in MATLAB
  • Research methods to extract real and imaginary parts from symbolic expressions in MATLAB
USEFUL FOR

Mathematics students, engineers, and researchers using MATLAB for symbolic computations, particularly those working with complex numbers and seeking to understand their representation in MATLAB.

zhaniko93
Messages
13
Reaction score
0
I have such MATLAB problem: I create variables R1 RF R2 and w so:
Code:
syms RF R1 R2 w
then I write expression:
Code:
3*R1*w*(RF + 200)/((R2*w*29*i + 3)*(3*R1*w - 2*i))
which gives:
Code:
(3*R1*w*(RF + 200))/((3*R1*w - 2*sqrt(-1))*(R2*w*29*sqrt(-1) + 3))
why sqrt(-1) and not i? furthermore? if I want real part of the expression and write:
Code:
real(ans)
it gives:
Code:
3*real((R1*w*(RF + 200))/((3*R1*w - 2*sqrt(-1))*(R2*w*29*sqrt(-1) + 3)))
can anyone please help me??
 
Physics news on Phys.org
anybody please
 

Similar threads

Replies
5
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
11K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
3K
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K