Post Reply 
CAS: simplify terms seperately?
09-09-2018, 05:24 AM
Post: #1
CAS: simplify terms seperately?
Hi all,

Is there a way to apply simplify() individually to terms separated by a plus?

For example:

((c*r*v0+c*r*va)*e^(-t/(r*c)))/(c*r) + va

I want the RC to be canceled in the left term:

(v0+va)*e^(-t/(r*c)) + va

But simplify gives mr something weird, maybe due to prefering exp() with a positive value:

(v0 + va*exp(t/c*r) - va) / exp(t/c*r)

I would be ok with highlighting the part I want simplified and pressing a button, though I would prefer something with syntax if possible.

Also, most times I would prefer exp( - f(t) ) to be left with a negative value in the numerator, rather than rewritten as 1/exp(f(t)). If there is a flag or a way to do that, that would be awesome.

(I am working through Laplace transforms in a circuit book, if that helps with context. )

Thanks Prof. Parisse and HP for a great product, and forgive me my poor explanation.
Find all posts by this user
Quote this message in a reply
09-09-2018, 06:06 AM (This post was last modified: 09-09-2018 06:20 AM by parisse.)
Post: #2
RE: CAS: simplify terms seperately?
a:=normal(...) does almost what you want.
If a is a sum, then a[1]=='+' and you can work on individual arguments of the sum with a[2],...,a[n+1] where n=size(a). Therefore here factor(a[2]+a[3])+a[4] will return what you want.
Find all posts by this user
Quote this message in a reply
09-09-2018, 03:17 PM (This post was last modified: 09-09-2018 05:56 PM by Anders.)
Post: #3
RE: CAS: simplify terms seperately?
(09-09-2018 06:06 AM)parisse Wrote:  a:=normal(...) does almost what you want.
If a is a sum, then a[1]=='+' and you can work on individual arguments of the sum with a[2],...,a[n+1] where n=size(a). Therefore here factor(a[2]+a[3])+a[4] will return what you want.

So we've had this up for discussion before:


in Electrical Engineering in general you want to find away to keep all terms in the normalized form that wsprague described through out all your manipulations. It just does not work otherwise. when you move back and forth between frequency domain and time domain. this is true when you use Fourier transform, Laplace transforms and Z transform (for time discreet).

it would be immensely useful for Engineering students (Electrical, Computer, etc), if we have some sort of normalized simplification function like the one you described that almost does it, available as a soft button. (that you could enable through a setting.
Find all posts by this user
Quote this message in a reply
09-09-2018, 05:18 PM
Post: #4
RE: CAS: simplify terms seperately?
(09-09-2018 03:17 PM)Anders Wrote:  it would be immensely useful for Engineering students (Electrical, Computer, etc), if we have some sort of normalized simplification function like the one you described that almost does, it available as a soft button. (that yu could enable through a setting.

I agree. I think there is probably enough consensus on what is a standard form for engineering to be a soft button.

(As an aside, I wonder if standard forms could be described by a pattern language and generalized? Just speculating...)
Find all posts by this user
Quote this message in a reply
09-09-2018, 06:39 PM (This post was last modified: 09-09-2018 06:40 PM by Anders.)
Post: #5
RE: CAS: simplify terms seperately?
(09-09-2018 05:18 PM)wsprague Wrote:  
(09-09-2018 03:17 PM)Anders Wrote:  it would be immensely useful for Engineering students (Electrical, Computer, etc), if we have some sort of normalized simplification function like the one you described that almost does it, available as a soft button. (that you could enable through a setting.

I agree. I think there is probably enough consensus on what is a standard form for engineering to be a soft button.

(As an aside, I wonder if standard forms could be described by a pattern language and generalized? Just speculating...)
Pattern in my view, but Parisse disagreed last time I brought up this topic.
However, the difference this time is that we are NOT asking for the Simplify button to change behavior, but to have a new Normalization function (or button) to normalize an expression of transforms (time or frequency as a variable) so maybe we have better luck this time.

All Engineering text books at junior, senior and grad school level use the same normalized expression pattern more or less in EE, Systems theory, advanced differential equations classes etc.
Same apply to Transform theory and engineering oriented Complex Analysis classes and textbooks (if I remember correctly).

The 3 most important transforms used are:
- Fourier (used at introductory level)
- Laplace (more advanced and once you move from Fourier to Laplace) you rarely use Fourier anymore)
and the discreet versions of the same
- Z (advanced) transforms (immensely useful in computer engineering)

(it would be helpful if we also could include Mellin transforms because of it's scale invariance properties and it's application in comp sci.)

What Prime produce is usually not in the normalized form you want to make it useful and makes it hard to interpret the result (you basically have to do the normalization yourself to make sense out of what you got, i.e. 1st, 2nd 3rd..... order derivative form: f(n)(t) <-> s^n F(s) - sum s^(n-k) f^(k-1)(0+) )...
Find all posts by this user
Quote this message in a reply
09-09-2018, 06:43 PM
Post: #6
RE: CAS: simplify terms seperately?
Sorry, but "standard form" is not very descriptive.
Is it something like lin(normal(...)) ?
Find all posts by this user
Quote this message in a reply
09-09-2018, 08:02 PM
Post: #7
RE: CAS: simplify terms seperately?
(09-09-2018 06:43 PM)parisse Wrote:  Sorry, but "standard form" is not very descriptive.
Is it something like lin(normal(...)) ?

I think defining "standard form" that meets most cases will take some work, and at least a list of examples. (It might be possible to do everything in xcas programming language, possibly iterating over terms using the Q[a,b,c] notation, or maybe just using lin() and the like.)

In my particular instance, lin(normal(...)) matches the textbook -- thanks!. I will play around with other equations later today.

It might also be that someone (me?) writes a guide to getting xcas results into "standard form" for EE etc., and that everything is there already.
Find all posts by this user
Quote this message in a reply
Post Reply 




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