Post Reply 
HP 48SX real/complex algebra
06-25-2024, 04:02 PM
Post: #2
RE: HP 48SX real/complex algebra
You would have to write your own expression-manipulating rules using the very powerful MATCH commands: MATCH↓ (top-down) or MATCH↑ (bottom-up), depending on your needs.

In your case, for instance, applying MATCH↑ to the following arguments:

2: 'RE((A+B*i)*(C+D*i))'
1: { 'RE((&1+&2*i)*(&3+&4*i))' '&1*&3-&2*&4' }


where the second-level argument represents the expression to be altered and the first-level argument the replacement rule, gives the desired result:

'A*C-B*D'


Along the same lines: If you don't want to limit the result to the sole real part, use the following replacement rule:

{ '(&1+&2*i)*(&3+&4*i)' '(&1*&3-&2*&4)+i*(&1*&4+&2*&3))' }


Applying MATCH↑ to the following arguments:

2: '(A+B*i)*(C+D*i)'
1: { '(&1+&2*i)*(&3+&4*i)' '(&1*&3-&2*&4)+i*(&1*&4+&2*&3))' }


would then give the following result:

'(A*C-B*D)+i*(A*D+B*C))'


Note that, within the replacement rule, any name that begins with the ampersand character "&" is interpreted as a wild card. Thus, "&1", "&2", "&3", and "&4" denote four, in principle different, expressions of arbitrary complexity.

As a further refinement, the list object containing the rule allows an optional third algebraic object which, when evaluated, must return a user flag determining whether the replacement should take place or not. For example, while simplifying square roots of squares, you may want to make sure that the arguments of the square function are actually positive:

{ '\v/(&1^2)' &1 '&1\>=0' }
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP 48SX real/complex algebra - Rick314 - 06-24-2024, 11:27 PM
RE: HP 48SX real/complex algebra - Giuseppe Donnini - 06-25-2024 04:02 PM
RE: HP 48SX real/complex algebra - Rick314 - 06-25-2024, 09:23 PM
RE: HP 48SX real/complex algebra - Gil - 06-25-2024, 11:37 PM
RE: HP 48SX real/complex algebra - Rick314 - 06-26-2024, 12:04 AM
RE: HP 48SX real/complex algebra - Gil - 06-26-2024, 01:02 AM
RE: HP 48SX real/complex algebra - Rick314 - 06-26-2024, 01:15 AM
RE: HP 48SX real/complex algebra - bxparks - 06-26-2024, 02:54 AM
RE: HP 48SX real/complex algebra - Gil - 06-26-2024, 01:27 AM



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