HP Forums

Full Version: Solve a System of complex equatoins
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone, new here obviously. Just purchased an HP Prime, coming from a TI89. Still trying to get used to the new syntax and commands.

How do I solve a system of complex equations?

such as;

-12+(-i4+i5)*A-i3*B
(12+i6)*B-i3*A

In the ti8 it was csolve( {-12+(-i4+i5)*A-i3*B,(12+i6)*B-i3*A},{A,B} )

But this is not the case with the HP Prime. Thoughts?

Thank you!
In CAS: try
fsolve({-12+(-4*+5*)*A-3**B,(12+6*)*B-3**A},{'A','B'})
[/code]
What is the significance of i4, i5, etc? Is it something specific or just "a variable"?
csolve should work. Beware that fsolve is approx.
Hello
(10-03-2017 07:16 AM)kitsunekatari Wrote: [ -> ]How do I solve a system of complex equations?

such as;

-12+(-i4+i5)*A-i3*B
(12+i6)*B-i3*A

Please first note those are not equations,
also important : on cas, you must use lowercase variable,
I added "=0" to have equations, and tried it :

csolve({-12+(4i+5i)*a-3i*b=0, (12+6i)*b-3i*a=0}, {a,b})

I got
{ (-16-8i)/(5-12i) , -4i/(5-12*i) }
Not necessary. I used capital letter "A" & "B" with csolve in CAS mode on the HP Prime and got the same answer as Primer.
Perhaps not necessary but perhaps it should. Expressions aren't equations, evaluating is not solving, etc.

I wouldn't mind if functions like the various *solve functions would generate an exception when being given an expression rather than an equation... It might actually prevent a lot of user errors at the "expense" of a trivial amount of overhead.
(10-03-2017 07:53 PM)Tim Wessman Wrote: [ -> ]What is the significance of i4, i5, etc? Is it something specific or just "a variable"?

They are imaginary. Standard syntax in EE is to use j followed by the quantity of said unit, in this case, Ohms.

Thank you everyone for your input. I am just trying to get used to the different syntax. In the 89, variables were variables, you put in x, it returns x, unless a value is stored in said variable. In the Prime, you put in A, or X, it returns 0 because nothing is stored in it. So sometimes it's hard to check to see if an equation simplifies correctly.
Most HP solvers, including cSolve, assume "=0" if the input expression is not an equation. You don't have to include it yourself. Prime's help screen for cSolve even says so explicitly:

HP Wrote:Syntax:
cSolve(Expr,[Var])

Returns the solutions, including complex solutions, of Expr, for Var.

If Expr is an expression, solves the equation Expr=0.

(10-05-2017 02:19 AM)AlexFekken Wrote: [ -> ]Perhaps not necessary but perhaps it should. Expressions aren't equations, evaluating is not solving, etc.

There's actually a reason for it working this way. The solvers treat "=" as "-" and solve the resulting expression (which is not an equation) for equality to zero. That being the case, it's more efficient for both the user and the calculator to omit "=0" from the input.
(10-05-2017 03:12 AM)Joe Horn Wrote: [ -> ]There's actually a reason for it working this way. The solvers treat "=" as "-" and solve the resulting expression (which is not an equation) for equality to zero. That being the case, it's more efficient for both the user and the calculator to omit "=0" from the input.
I get the convenience of it, but I guess I am too much of a mathematician to appreciate the sloppiness. And a C programmer would probably argue that "!= 0" must have been omitted :-)
(10-05-2017 04:48 AM)AlexFekken Wrote: [ -> ]
(10-05-2017 03:12 AM)Joe Horn Wrote: [ -> ]There's actually a reason for it working this way. The solvers treat "=" as "-" and solve the resulting expression (which is not an equation) for equality to zero. That being the case, it's more efficient for both the user and the calculator to omit "=0" from the input.
I get the convenience of it, but I guess I am too much of a mathematician to appreciate the sloppiness. And a C programmer would probably argue that "!= 0" must have been omitted :-)

in most computer languages you can do this:

if x then...

and the language assumes you mean

if x<>0 then...
(10-05-2017 05:55 PM)toml_12953 Wrote: [ -> ]in most computer languages you can do this:

if x then...

and the language assumes you mean

if x<>0 then...

Exactly my point: it does *not* mean "if x = 0 then ..."
(10-05-2017 02:57 AM)kitsunekatari Wrote: [ -> ]In the Prime, you put in A, or X, it returns 0 because nothing is stored in it. So sometimes it's hard to check to see if an equation simplifies correctly.

in the prime, that's easy too : go to CAS mode, and use lowercase
Then you will see x will be x, not 0.
(10-06-2017 07:44 AM)AlexFekken Wrote: [ -> ]
(10-05-2017 05:55 PM)toml_12953 Wrote: [ -> ]in most computer languages you can do this:

if x then...

and the language assumes you mean

if x<>0 then...

Exactly my point: it does *not* mean "if x = 0 then ..."

You're right. It's not very consistent, is it?
Reference URL's