Post Reply 
Change displayed form?
10-20-2018, 09:52 AM
Post: #1
Change displayed form?
Command Line: laplace(2*t*e^(-3*t)+5,t,s); // purge(t,s,x) first....
Displayed result: (5*s^2+32*s+45) / (s^3+6*s^2+9*s)

How to display result in this form? (2/(s+3)^2) + 5/s
Find all posts by this user
Quote this message in a reply
10-20-2018, 12:33 PM (This post was last modified: 10-20-2018 12:56 PM by Albert Chan.)
Post: #2
RE: Change displayed form?
convert((5s^2+32s+45) / (s^3+6s^2+9s), parfrac) ==> 5/s + 2/(s+3)^2

partfrac((5s^2+32s+45) / (s^3+6s^2+9s)) ==> 5/s + 2/(s+3)^2

Edit: tried to break up fraction, say 11/30 to 1/2 - 1/3 + 1/5, but unsuccessful...
Find all posts by this user
Quote this message in a reply
10-20-2018, 05:20 PM
Post: #3
RE: Change displayed form?
(10-20-2018 12:33 PM)Albert Chan Wrote:  convert((5s^2+32s+45) / (s^3+6s^2+9s), parfrac) ==> 5/s + 2/(s+3)^2

partfrac((5s^2+32s+45) / (s^3+6s^2+9s)) ==> 5/s + 2/(s+3)^2

Edit: tried to break up fraction, say 11/30 to 1/2 - 1/3 + 1/5, but unsuccessful...

Thank you for the help on that!
Find all posts by this user
Quote this message in a reply
10-24-2018, 02:18 AM (This post was last modified: 10-24-2018 03:36 AM by Anders.)
Post: #4
RE: Change displayed form?
1. normalized laplace expressions
partfrac() is a great way to normalize the output from Laplace for many (but not all) conversions. Maybe we should add parameter to laplace() to tell laplace() that we want the result in the normalized form..., i.e. laplace(expression of parameter 1, [param 1 (i.e. t)], [param 2 (i.e. s)], [normalized flag]) where the normalized flag is either 1 or 0 for yes and no, with default = 1 for yes.

In the normalized form we want a sum of terms, where each term is a function of s that corresponds 1:1 to each term in the original expression (where each term was a function of t)

Example of common terms (of t and the corresponding terms of s):
unit step : 1 <-> 1/s
ramp: t <-> 1/s^2
sine: sin(a*t) <-> a/(s^2 +a^2)

see more attached

2. Found some issues with laplace and ilaplace/invlaplace

I played around with laplace() and ilaplace() and noticed that they no longer behave like the used to

ilaplace((1/(x^2+1)^2)) (or invlaplace() which is and works the same ilapalce())

results in:

1/4*(-x*e^(i*x)-x*e^(−i*x)−i*e^(i*x)+i*e^(−i*x))

which is correct (if you apply Euler) but it is no longer presented in the usual recognizable formal (like it used to do and indeed the help menu shows it should/did):

1/2*sin(x)-1/2*x*cos(x)

I realize that I had "i" checked in CAS settings and if I uncheck that I get the expected result: 1/2*sin(x)-1/2*x*cos(x).

Is this the way this should work - the transformation being dependent of "i" being checked or not?

I was using a "physical " prime
version is 2.0.0.13865 from 2018 07 06
Hardware version C

Also, the virtual Prime does not behave the same way as the "physical" Prime.

The virtual Prime does not like when you use the familiar parameters s and t but prefers x.

laplace(2*t*e^(-3*t)+5,t,s)
results in
"laplace(2*t*e^(-3*t)+5,t,s) Error: Bad Argument Value"

but:

laplace(2*x*e^(-3*x)+5,x,s)
works fine
(5*s^2+32*s+45)/(s^3+6*s^2+9*s)

The Virtual Prime have the same version and date (version is 2.0.0.13865 from 2018 07 06) as the "real" Prime.
Find all posts by this user
Quote this message in a reply
10-24-2018, 03:42 AM
Post: #5
RE: Change displayed form?
Playing a bit more on the virtual Prime, the same issue appears symmetrically (as far as i tried) with ztrans() and invztrans().

invztrans(z/(z^4-1),z,n)
->
"invztrans(z/(z^4-1),z,n)
Error: Bad Argument Value"

etc
Find all posts by this user
Quote this message in a reply
10-24-2018, 05:27 AM
Post: #6
RE: Change displayed form?
Anders: the way to do the computation of Laplace transform depends on the complex setting, since the first step for ilaplace is factorization.
Run purge(t,s).
Find all posts by this user
Quote this message in a reply
10-24-2018, 03:36 PM (This post was last modified: 10-24-2018 03:37 PM by Anders.)
Post: #7
RE: Change displayed form?
(10-24-2018 05:27 AM)parisse Wrote:  Anders: the way to do the computation of Laplace transform depends on the complex setting, since the first step for ilaplace is factorization.
Run purge(t,s).

I did purge(s), purge(t), purge(x) before when I got above results (virtual and physical Prime. Should have written that. I trred today again and got the same results.

so I found that whether "complex" is checked or not does NOT matter for the output form, but if "i" is set does. I should have included that above as well. I tried today again and got the same results.

Also, it does not explain the difference between virtual and physical prime.
Find all posts by this user
Quote this message in a reply
10-25-2018, 02:01 AM (This post was last modified: 10-25-2018 02:01 AM by rushfan.)
Post: #8
RE: Change displayed form?
(10-24-2018 02:18 AM)Anders Wrote:  1. normalized laplace expressions
partfrac() is a great way to normalize the output from Laplace for many (but not all) conversions. Maybe we should add parameter to laplace() to tell laplace() that we want the result in the normalized form..., i.e. laplace(expression of parameter 1, [param 1 (i.e. t)], [param 2 (i.e. s)], [normalized flag]) where the normalized flag is either 1 or 0 for yes and no, with default = 1 for yes.

In the normalized form we want a sum of terms, where each term is a function of s that corresponds 1:1 to each term in the original expression (where each term was a function of t)

Example of common terms (of t and the corresponding terms of s):
unit step : 1 <-> 1/s
ramp: t <-> 1/s^2
sine: sin(a*t) <-> a/(s^2 +a^2)

see more attached

2. Found some issues with laplace and ilaplace/invlaplace

I played around with laplace() and ilaplace() and noticed that they no longer behave like the used to

ilaplace((1/(x^2+1)^2)) (or invlaplace() which is and works the same ilapalce())

results in:

1/4*(-x*e^(i*x)-x*e^(−i*x)−i*e^(i*x)+i*e^(−i*x))

which is correct (if you apply Euler) but it is no longer presented in the usual recognizable formal (like it used to do and indeed the help menu shows it should/did):

1/2*sin(x)-1/2*x*cos(x)

I realize that I had "i" checked in CAS settings and if I uncheck that I get the expected result: 1/2*sin(x)-1/2*x*cos(x).

Is this the way this should work - the transformation being dependent of "i" being checked or not?

I was using a "physical " prime
version is 2.0.0.13865 from 2018 07 06
Hardware version C

Also, the virtual Prime does not behave the same way as the "physical" Prime.

The virtual Prime does not like when you use the familiar parameters s and t but prefers x.

laplace(2*t*e^(-3*t)+5,t,s)
results in
"laplace(2*t*e^(-3*t)+5,t,s) Error: Bad Argument Value"

but:

laplace(2*x*e^(-3*x)+5,x,s)
works fine
(5*s^2+32*s+45)/(s^3+6*s^2+9*s)

The Virtual Prime have the same version and date (version is 2.0.0.13865 from 2018 07 06) as the "real" Prime.

Running simplify( exp2trig( ilaplace(1/(x^2+1)^2))) works for me.

You can create a program to run simplify( exp2trig( ilaplace( ))).
Find all posts by this user
Quote this message in a reply
10-25-2018, 02:56 AM
Post: #9
RE: Change displayed form?
(10-25-2018 02:01 AM)rushfan Wrote:  
(10-24-2018 02:18 AM)Anders Wrote:  1. normalized laplace expressions
partfrac() is a great way to normalize the output from Laplace for many (but not all) conversions. Maybe we should add parameter to laplace() to tell laplace() that we want the result in the normalized form..., i.e. laplace(expression of parameter 1, [param 1 (i.e. t)], [param 2 (i.e. s)], [normalized flag]) where the normalized flag is either 1 or 0 for yes and no, with default = 1 for yes.

In the normalized form we want a sum of terms, where each term is a function of s that corresponds 1:1 to each term in the original expression (where each term was a function of t)

Example of common terms (of t and the corresponding terms of s):
unit step : 1 <-> 1/s
ramp: t <-> 1/s^2
sine: sin(a*t) <-> a/(s^2 +a^2)

see more attached

2. Found some issues with laplace and ilaplace/invlaplace

I played around with laplace() and ilaplace() and noticed that they no longer behave like the used to

ilaplace((1/(x^2+1)^2)) (or invlaplace() which is and works the same ilapalce())

results in:

1/4*(-x*e^(i*x)-x*e^(−i*x)−i*e^(i*x)+i*e^(−i*x))

which is correct (if you apply Euler) but it is no longer presented in the usual recognizable formal (like it used to do and indeed the help menu shows it should/did):

1/2*sin(x)-1/2*x*cos(x)

I realize that I had "i" checked in CAS settings and if I uncheck that I get the expected result: 1/2*sin(x)-1/2*x*cos(x).

Is this the way this should work - the transformation being dependent of "i" being checked or not?

I was using a "physical " prime
version is 2.0.0.13865 from 2018 07 06
Hardware version C

Also, the virtual Prime does not behave the same way as the "physical" Prime.

The virtual Prime does not like when you use the familiar parameters s and t but prefers x.

laplace(2*t*e^(-3*t)+5,t,s)
results in
"laplace(2*t*e^(-3*t)+5,t,s) Error: Bad Argument Value"

but:

laplace(2*x*e^(-3*x)+5,x,s)
works fine
(5*s^2+32*s+45)/(s^3+6*s^2+9*s)

The Virtual Prime have the same version and date (version is 2.0.0.13865 from 2018 07 06) as the "real" Prime.

Running simplify( exp2trig( ilaplace(1/(x^2+1)^2))) works for me.

You can create a program to run simplify( exp2trig( ilaplace( ))).

Thanks. I get that, but that was not really my point (there were many). To know that you need to apply exp2trig you need to know the answer (which you typically do not until; you have tried ilaplace() first).

My view was that the average EE (or any engineering doing differential equations) undergrad student pov would not immediately know this when they see a bunch of e ^ -ix....., but that a student would reasonably expect the ilaplace() to present the familiar mapping back to the time domain.
You now, like the classic laplace tables the professor gives the students at the beginning a circuit class. Just look at Wikipedia for instance Laplace transform
same goes for z transforms dealing with the discrete time domain:
Z-transforms
Hugely important also in comp sci.

What that student need to know is that "i" should not be checked in CAS setting for the mapping to work as expected.

In some ways it is actually good that ilaplace can present both the complex form and the non-complex. It makes it more flexible if you want to do more advance stuff but, maybe by default, ilaplace() should always show the non-complex form (regardless of "i" CAS setting) and have a parameter complex on/off to explicitly tell CAS to show complex form. ilaplace(expression of parameter 1, [param 1 (i.e. t)], [param 2 (i.e. s)], [normalized flag Y/N: default Y], [complex Y/N: default N])

Just a thought. I think HP/Parisse, would get fewer questions and the students would better intuitive and immediate use of the HP Prime.

I would certainly have loved to have had and HP Prime with that capability in grad school. It would save so much time and avoid errors in the mapping back and forth the between time and frequency domain of complex circuits analysis.

Anyway, the other errors I mentioned above is still a problem.
Find all posts by this user
Quote this message in a reply
10-25-2018, 04:17 AM (This post was last modified: 10-25-2018 04:20 AM by rushfan.)
Post: #10
RE: Change displayed form?
(10-25-2018 02:56 AM)Anders Wrote:  
(10-25-2018 02:01 AM)rushfan Wrote:  Running simplify( exp2trig( ilaplace(1/(x^2+1)^2))) works for me.

You can create a program to run simplify( exp2trig( ilaplace( ))).

Thanks. I get that, but that was not really my point (there were many). To know that you need to apply exp2trig you need to know the answer (which you typically do not until; you have tried ilaplace() first).

My view was that the average EE (or any engineering doing differential equations) undergrad student pov would not immediately know this when they see a bunch of e ^ -ix....., but that a student would reasonably expect the ilaplace() to present the familiar mapping back to the time domain.
You now, like the classic laplace tables the professor gives the students at the beginning a circuit class. Just look at Wikipedia for instance Laplace transform
same goes for z transforms dealing with the discrete time domain:
Z-transforms
Hugely important also in comp sci.

What that student need to know is that "i" should not be checked in CAS setting for the mapping to work as expected.

In some ways it is actually good that ilaplace can present both the complex form and the non-complex. It makes it more flexible if you want to do more advance stuff but, maybe by default, ilaplace() should always show the non-complex form (regardless of "i" CAS setting) and have a parameter complex on/off to explicitly tell CAS to show complex form. ilaplace(expression of parameter 1, [param 1 (i.e. t)], [param 2 (i.e. s)], [normalized flag Y/N: default Y], [complex Y/N: default N])

Just a thought. I think HP/Parisse, would get fewer questions and the students would better intuitive and immediate use of the HP Prime.

I would certainly have loved to have had and HP Prime with that capability in grad school. It would save so much time and avoid errors in the mapping back and forth the between time and frequency domain of complex circuits analysis.

Anyway, the other errors I mentioned above is still a problem.

Having the answers displayed in complex exponential form is essential in a signals and systems course, on an EET (Electronics Engineering) graduation. I learned how to do the transforms by hand in that course before being asked to do them "by table". And in this case, the default settings present the familiar answer (in terms of the functions) as it should, so not an issue IMHO.

And yes, there are a ton of not intuitive and not sufficiently detailed and exemplified things in the cas documentation. Recently, it took me a forum post to figure out that the function "normal()" exists and does what I needed.
Find all posts by this user
Quote this message in a reply
10-25-2018, 05:59 AM (This post was last modified: 10-25-2018 06:53 AM by Anders.)
Post: #11
RE: Change displayed form?
(10-25-2018 04:17 AM)rushfan Wrote:  
(10-25-2018 02:56 AM)Anders Wrote:  Thanks. I get that, but that was not really my point (there were many). To know that you need to apply exp2trig you need to know the answer (which you typically do not until; you have tried ilaplace() first).

My view was that the average EE (or any engineering doing differential equations) undergrad student pov would not immediately know this when they see a bunch of e ^ -ix....., but that a student would reasonably expect the ilaplace() to present the familiar mapping back to the time domain.
You now, like the classic laplace tables the professor gives the students at the beginning a circuit class. Just look at Wikipedia for instance Laplace transform
same goes for z transforms dealing with the discrete time domain:
Z-transforms
Hugely important also in comp sci.

What that student need to know is that "i" should not be checked in CAS setting for the mapping to work as expected.

In some ways it is actually good that ilaplace can present both the complex form and the non-complex. It makes it more flexible if you want to do more advance stuff but, maybe by default, ilaplace() should always show the non-complex form (regardless of "i" CAS setting) and have a parameter complex on/off to explicitly tell CAS to show complex form. ilaplace(expression of parameter 1, [param 1 (i.e. t)], [param 2 (i.e. s)], [normalized flag Y/N: default Y], [complex Y/N: default N])

Just a thought. I think HP/Parisse, would get fewer questions and the students would better intuitive and immediate use of the HP Prime.

I would certainly have loved to have had and HP Prime with that capability in grad school. It would save so much time and avoid errors in the mapping back and forth the between time and frequency domain of complex circuits analysis.

Anyway, the other errors I mentioned above is still a problem.

Having the answers displayed in complex exponential form is essential in a signals and systems course, on an EET (Electronics Engineering) graduation. I learned how to do the transforms by hand in that course before being asked to do them "by table". And in this case, the default settings present the familiar answer (in terms of the functions) as it should, so not an issue IMHO.

And yes, there are a ton of not intuitive and not sufficiently detailed and exemplified things in the cas documentation. Recently, it took me a forum post to figure out that the function "normal()" exists and does what I needed.

Yes, so I think we agree then.... CAS Documentation remains a challenge.

As there are several typs of uses where you absolutely want the complex exponential form (e.g. fundamental to the detail components R,C,L in circuits) and looking at the systems level (time discrete/ continuous systems and control theory) it is beneficial to work in the z and s standard form. Also, it is also beneficial to manipulate and transform entire systems (formulated in s and z) in vector and matrix form back and forth...

Both "complex" and s,z form as well as normalized/default form are needed as output AND need to be documented.

Ideally the laplace() and ilapalce() (as well as ztrans and invztans) needs to have parameters allowing the user to specify what output form he/she wants rather than changing a CAS system setting.

This would allow the user to move between the time domain and frequency domain using different forms efficiently without going in and changing CAS settings back and forth.

However, the issues with the virtual Prime is still a problem. At least it does not work for me even with purge(s,x,t)...
Find all posts by this user
Quote this message in a reply
Post Reply 




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