The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
fsolve accuracy with complex variables [SOLVED]
02-07-2016, 11:25 AM (This post was last modified: 02-04-2018 10:10 AM by JMB.)
Post: #1
fsolve accuracy with complex variables [SOLVED]
The following equation:
|x|^2-200*x+500+500*i = 0 (eq1)

where x is a complex variable, can be solved splitting it into two separate equations, one for the real part and another for the imaginary part. Applying this method, one gets the solution:
197.43587635+2.5*i (sol1)

Substituting sol1 into eq1, gives the exact value 0. Now, I was trying to solve this same equation using the function fsolve:

fsolve(|x|^2-200*x+500+500*i,x,190+i)

The calculator (firmware 8051) returns the value:
197.501663563-2.56405881565*i (sol2)

Trying different initials guesses leads to the same solution. The real parts of sol1 and sol2 are quite close, but not the imaginary parts.

Also: ABS(sol1)-ABS(sol2) = -0.066603127, and ARG(sol1)-ARG(sol2) = 2.56433999704E-2 (in radiants). So, depending on how you look at it, the solution given by fsolve is not so bad.

Does anyone know how to improve the calculator's accuracy?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
fsolve accuracy with complex variables [SOLVED] - JMB - 02-07-2016 11:25 AM



User(s) browsing this thread: 4 Guest(s)