Understanding Symbolic Math in MATLAB: Real and Imaginary Parts

AI Thread Summary
In MATLAB, when using symbolic math, the imaginary unit is represented as 'sqrt(-1)' instead of 'i' in expressions. This occurs because MATLAB defaults to using 'sqrt(-1)' for clarity in symbolic computations. To extract the real part of an expression, the command 'real(ans)' returns the expression with 'sqrt(-1)' still present, indicating that the output retains the symbolic form. Users seeking to simplify the expression or convert it to a numerical form may need to apply additional functions or methods. Understanding these nuances is crucial for effective symbolic math manipulation 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
 
Thread 'Voltmeter readings for this circuit with switches'
TL;DR Summary: I would like to know the voltmeter readings on the two resistors separately in the picture in the following cases , When one of the keys is closed When both of them are opened (Knowing that the battery has negligible internal resistance) My thoughts for the first case , one of them must be 12 volt while the other is 0 The second case we'll I think both voltmeter readings should be 12 volt since they are both parallel to the battery and they involve the key within what the...
Thread 'Correct statement about a reservoir with an outlet pipe'
The answer to this question is statements (ii) and (iv) are correct. (i) This is FALSE because the speed of water in the tap is greater than speed at the water surface (ii) I don't even understand this statement. What does the "seal" part have to do with water flowing out? Won't the water still flow out through the tap until the tank is empty whether the reservoir is sealed or not? (iii) In my opinion, this statement would be correct. Increasing the gravitational potential energy of the...
Back
Top