ACA 2014 Applications of Computer Algebra Session: Integration: implementation and applications Fordham University New York, NY, USA, July 9-12.

Slides:



Advertisements
Similar presentations
Integration of Piecewise Continuous Functions Michel Beaudin, Frédérick Henri, Geneviève Savard ÉTS, Montréal, Canada ACA 2013 Applications of Computer.
Advertisements

Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
Lecture 5: Linear Systems and Convolution
TIME 2014 Technology in Mathematics Education July 1 st - 5 th 2014, Krems, Austria.
Continuous-Time Convolution EE 313 Linear Systems and Signals Fall 2005 Initial conversion of content to PowerPoint by Dr. Wade C. Schwartzkopf Prof. Brian.
Chapter 3 1 Laplace Transforms 1. Standard notation in dynamics and control (shorthand notation) 2. Converts mathematics to algebraic operations 3. Advantageous.
Leo Lam © Signals and Systems EE235. Leo Lam © Convergence Two mathematicians are studying a convergent series. The first one says:
2.1 The Addition Property of Equality
TIME 2014 Technology in Mathematics Education July 1 st - 5 th 2014, Krems, Austria.
Differential Equations
5.7 Impulse Functions In some applications, it is necessary to deal with phenomena of an impulsive nature—for example, voltages or forces of large magnitude.
Chapter 3: The Laplace Transform
ACA 2014 Applications of Computer Algebra Session: Computer Algebra in Education Fordham University New York, NY, USA, July 9-12.
Mathematics Department
Engineering Mathematics Class #11 Part 2 Laplace Transforms (Part2)
ORDINARY DIFFERENTIAL EQUATION (ODE) LAPLACE TRANSFORM.
THE LAPLACE TRANSFORM IN CIRCUIT ANALYSIS. A Resistor in the s Domain R + v i v=Ri (Ohm’s Law). V(s)=RI(s R + V I.
ES250: Electrical Science
1 Consider a given function F(s), is it possible to find a function f(t) defined on [0,  ), such that If this is possible, we say f(t) is the inverse.
TIME 2012 Technology and its Integration in Mathematics Education 10 th Conference for CAS in Education & Research July 10-14, Tartu, Estonia.
Time-Domain Representations of LTI Systems
1 Chapter 8 Ordinary differential equation Mathematical methods in the physical sciences 3rd edition Mary L. Boas Lecture 5 Introduction of ODE.
Time-Domain Representations of LTI Systems
INTRODUCTION TO LAPLACE TRANSFORM Advanced Circuit Analysis Technique.
Engineering Mathematics Class #12 Laplace Transforms (Part3)
Prepared by Mrs. Azduwin Binti Khasri
Fourier Series. Introduction Decompose a periodic input signal into primitive periodic components. A periodic sequence T2T3T t f(t)f(t)
Integrals  In Chapter 2, we used the tangent and velocity problems to introduce the derivative—the central idea in differential calculus.  In much the.
Chapter 2 Laplace Transform 2.1 Introduction The Laplace transform method can be used for solving linear differential equations. Laplace transforms can.
Course Outline (Tentative) Fundamental Concepts of Signals and Systems Signals Systems Linear Time-Invariant (LTI) Systems Convolution integral and sum.
Chapter 2. Signals and Linear Systems
Chapter 2 Time Domain Analysis of CT System Basil Hamed
10. Laplace TransforM Technique
THE LAPLACE TRANSFORM LEARNING GOALS Definition
ABE425 Engineering Measurement Systems ABE425 Engineering Measurement Systems Laplace Transform Dr. Tony E. Grift Dept. of Agricultural & Biological Engineering.
Chapter 5 Laplace Transform
Chapter 7 The Laplace Transform
In Chapters 6 and 8, we will see how to use the integral to solve problems concerning:  Volumes  Lengths of curves  Population predictions  Cardiac.
Signals and Systems Analysis NET 351 Instructor: Dr. Amer El-Khairy د. عامر الخيري.
Topics 1 Specific topics to be covered are: Discrete-time signals Z-transforms Sampling and reconstruction Aliasing and anti-aliasing filters Sampled-data.
Eeng360 1 Chapter 2 Linear Systems Topics:  Review of Linear Systems Linear Time-Invariant Systems Impulse Response Transfer Functions Distortionless.
Description and Analysis of Systems Chapter 3. 03/06/06M. J. Roberts - All Rights Reserved2 Systems Systems have inputs and outputs Systems accept excitation.
ENEE 322: Continuous-Time Fourier Transform (Chapter 4)
Laplace Transforms Shiva choudhary En No.: Electronics and comm. Dept K.I.T.,Jamnagar.
1.7 – Day 1 Inequalities. 2 Objectives ► Solving Linear Inequalities ► Solving Nonlinear Inequalities ► Absolute Value Inequalities ► Modeling with Inequalities.
Math for CS Fourier Transforms
DYNAMIC BEHAVIOR OF PROCESSES :
Class 3 Linear System Solution Using the Laplace Transform
Time Domain Representations of Linear Time-Invariant Systems
Second Shifting Theorem
CHAPTER III LAPLACE TRANSFORM
CHAPTER 4 The Laplace Transform.
Fig Solving an IVP by Laplace transforms
Advanced Engineering Mathematics 6th Edition, Concise Edition
SIGMA INSTITUTE OF ENGINEERING
Mathematical Modeling of Control Systems
Description and Analysis of Systems
Mathematical Descriptions of Systems
UNIT II Analysis of Continuous Time signal
Mechatronics Engineering
Lecture 5: Linear Systems and Convolution
Fundamentals of Electric Circuits Chapter 15
Copyright © Cengage Learning. All rights reserved.
§1—2 State-Variable Description The concept of state
Laplace Transforms Lecture-11 Additional chapters of mathematics
Signals and Systems Lecture 2
Inequalities Some problems in algebra lead to inequalities instead of equations. An inequality looks just like an equation, except that in the place of.
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
Laplace Transforms Important analytical method for solving linear ordinary differential equations. - Application to nonlinear ODEs? Must linearize first.
Presentation transcript:

ACA 2014 Applications of Computer Algebra Session: Integration: implementation and applications Fordham University New York, NY, USA, July 9-12

2 Introduction Convolution of two functions : Case of Laplace transforms Continuous LTI systems Computing the convolution Symbolic Convolution in Nspire CAS Conclusion Overview

3 Why this subject? At the last ACA conference, we showed how useful it was for a Computer Algebra System (CAS) to perform symbolic integration of Piecewise Continuous Functions (PCF) and expressions containing such functions. Sadly, Texas Instruments computer algebra system Nspire CAS is able to deal with PCF but presents some limitations. Introduction

4 Let a PCF be defined over an interval (or the entire real line) and be continuous over each sub- interval. Here is what Nspire CAS does well : The symbolic derivative, the symbolic indefinite integral and the symbolic definite integral. The system correctly checks the endpoints for the derivative and adjusts the constants of integration for each sub-interval for the integral. Introduction

5 Constants are added to obtain a continuous antiderivative. Exact value. Here is an example.

6 Function f(x) and definite integral: Introduction

7 Important: a continuous antiderivative! Introduction

8 We just saw that Nspire CAS uses templates to define piecewise functions. These templates are attractive but some limitations appear if one wants to perform more complicated symbolic operations. Introduction

As an example, we continue with our earlier function y = f(x) and try to compute. 9 Introduction Unable to compute! No exact value!

10 Nspire CAS built-in integrator is unable to perform the symbolic integration of a product of a single expression with a piecewise function. Furthermore, it only returns a floating point approximation for the definite integral. Introduction

11 This is why Frédérick Henri has programmed some functions (showed last year at ACA). With these functions (included in a special library used by us at ETS), Nspire CAS is now able to do all of this correctly! Introduction

Here is a brief recap of how it works: 1.We group into a single piecewise function an expression using the function grouper_fct(ex, var) where ex is an expression in variable var. 12 Introduction

13 2.We use the built-in integrator of Nspire CAS to perform the integral. Note that in the upcoming slide: kit_ETS_fh\integral_mcx(ex, var) stands for the indefinite integral of ex wrt to var. kit_ETS_fh\integral_mcx_d(ex, var, lo, up) stands for the definite integral of ex wrt var from lo to up. Introduction

14 Introduction Nspire CAS built-in integrator. Only a floating point approximation. Symbolic piecewise antiderative! Exact value!

15  Case of Laplace transforms Usually, students are introduced to Laplace transforms inside an ODE course. Functions f(t) are defined for and the Laplace transform of f is the function F defined by the improper integral Convolution of Two Functions

16  Case of Laplace transforms Let’s use the notation for the correspondence between the function f(t) and its transform F(s). Note that f(t) is in fact f(t) u(t) where u(t) is the unit-step function (Heaviside function): Convolution of Two Functions

17  Case of Laplace transforms Then we have the “convolution property” This last integral is called the convolution (in the sense of Laplace transforms) of f and g. Convolution of Two Functions

18  Case of Laplace transforms Note that it can be written in the more general form if x(t) = f(t)u(t) and h(t) = g(t)u(t). Convolution of Two Functions

19  Case of Laplace transforms Unfortunately, in a classical ODE course, few words are said about convolution or the reasons why it is important. For simplicity, let’s take a linear second order, constant coefficients ODE Convolution of Two Functions

20  Case of Laplace transforms Then the solution of is given by the convolution where h(t) is known as the impulse response and H(s) as the transfer function. Convolution of Two Functions

21  Case of Laplace transforms Usually, the ODE represents a damped mass- spring problem or a RLC circuit problem. In this case, the coefficients a, b and c are positive and there is no loss of generality taking zero initial conditions since the transient solution dies out. So, the convolution solves the ODE. Convolution of Two Functions

22  Continuous LTI systems We now consider a (continuous) system where an input x(t) enters the system and an output y(t) is produced. Some examples: Convolution of Two Functions x(t)x(t)SYSTEMy(t)y(t)

23  Continuous LTI systems Another example is a mass-spring system: the external force f(t) is the input (f(t) = 0 if t < 0) and the position y(t) of the object at time t is the output. The following ODE is the model used: Convolution of Two Functions Mass of the object Constant of friction Spring constant

24  Continuous LTI systems Let the input produce the output and let the input produce the output. The system is linear if the linearly combined input produces the linear combined output Convolution of Two Functions

25  Continuous LTI systems Let the input x(t) produces the output y(t), let a be any real number. The system is time-invariant if the shifted output y(t  a) is the same as the output produced by the shifted input x(t  a). That is: S(x(t)) = y(t) S(x(t  a)) = y(t  a) Convolution of Two Functions

26  Continuous LTI systems The system is said linear, time-invariant (LTI) if both conditions are satisfied. Example: consider again the capacitor as a system. When a current i(t) passes through the capacitor C, the voltage across the capacitor is Convolution of Two Functions

27  Continuous LTI systems This is a linear system because of the linearity of the integral. The system is also time-invariant as a change of variable shows it. Convolution of Two Functions

28  Computing the convolution In signal analysis courses, students learn how to compute by hand the convolution of two signals. They are introduced to important functions such as unit step function u(t) and unit-impulse (Dirac delta) “function”  (t). But there is no need to deal with the theory of generalized functions. Convolution of Two Functions

29  Computing the convolution Instead, they are using limiting process. The Dirac delta “function” is replaced by an approximate unit-impulse function: In Derive, this is nothing else than Convolution of Two Functions

30  Computing the convolution Given a system, the output to the unit-impulse  (t) is called the system impulse response h(t). Fact: in a continuous LTI system, the output y(t) to the input x(t) is given by the convolution Convolution of Two Functions

31  Computing the convolution This is easy to justify. The signal x(t) is replaced by a staircase approximation and a limit: If is the output to, then the linearity of the integral and time invariance yields the result. Convolution of Two Functions

32  Computing the convolution Suppose you want to perform a convolution: Then, 4 steps must be completed : reverse the time in the signal h; shift the variable; multiply by the signal x; integrate over all values of , doing this for every value of t. Convolution of Two Functions

33  Computing the convolution For example, the convolution of two rectangular pulses of finite (but different) duration is a trapezoidal signal: Let’s switch to Nspire CAS and show an animation of this. Convolution of Two Functions Convolution of x(t) and h(t).

34  Computing the convolution Derive can easily perform the last convolution because of its ability to integrate piecewise functions. Even though the Dirac delta function has never been implemented into Derive, we can compute symbolic limits involving indicator functions. So we can use impulse functions! Convolution of Two Functions

35  Computing the convolution Let us show a Derive screen where the convolution is defined. Then we will show the convolution of the two rectangular pulses x(t) = CHI(0, t, 1) and h(t) = 1.5CHI(0, t, 2). In Derive, CHI(a, x, b) is the indicator function of the open interval a < x < b. The notation is  (a, x, b). Convolution of Two Functions

36  Computing the convolution Finally, we will illustrate the fact that the convolution with the shifted Dirac delta function  (t  a) produces a translation on a signal x(t): The next slide shows this with a = 1. Convolution of Two Functions

37 Convolution of Two Functions It is so easy to define a convolution of 2 signals in Derive! We take 2 rectangular pulses, using the indicator function  of Derive. Here is the result and the graph. Now we convolve the « output » with  (t  1), using a limit of indicator function: this produces, as expected, a translation of the signal « output ».

38 We know Nspire CAS can’t simplify the product of a piecewise expression with another expression. So, if x(t) is piecewise with compact support, the integral of x(t) with another expression only yields a floating point value. The next slide illustrates this. Symbolic Convolution in Nspire CAS

39 Here is, again, an example. Now let’s try to perform the convolution of x(t) and h(t). Symbolic Convolution in Nspire CAS No exact value. Exact value!

40 Nspire CAS built-in integrator won’t succeed … Symbolic Convolution in Nspire CAS Oups…!

41 … neither will Frédérick’s function! Symbolic Convolution in Nspire CAS

42 So, what can we do? Our goal is to find a way for Nspire CAS to compute the symbolic convolution without giving up the use of templates. As far as integration is concerned, endpoints of each subinterval are irrelevant. Symbolic Convolution in Nspire CAS

43 Here is what we will do: 1.Convert a piecewise function into a linear combination of signum functions. 2.Import from Derive a very important rule: Symbolic Convolution in Nspire CAS

44 3.Perform the symbolic integration of each term. 4.Convert the result into a piecewise expression (if applicable). 5.Moreover, if one needs to use a Dirac delta function, it should be possible to achieve, using limit of indicator functions. Symbolic Convolution in Nspire CAS

Note : the rule yields a continuous antiderivative. Here is why. Let G(x) be an antiderivative of F(x). Consider the function “Albert”: This function is everywhere continuous and differentiable except at the point x =  b/a. Symbolic Convolution in Nspire CAS 45

The derivative of SIGN(ax + b) is 0 except at x =  b/a. So, for x ≠  b/a, For x ≠  b/a, Albert(x) is continuous everywhere because SIGN and G are continuous. If x =  b/a, it is also continuous because SIGN is a bounded function: Symbolic Convolution in Nspire CAS 46

47 New functions were defined and saved in an updated version of the library Kit_ETS_FH. Frédérick Henri took care of the programming side of the job and Michel Beaudin took care of the mathematical requests. Here is a description of the principal functions. Symbolic Convolution in Nspire CAS

48 The sign function is already implemented into Nspire CAS. We have defined the unit step function and the piecewise indicator function of the interval ]a, b[: Frédérick’s function unpiece transforms a piecewise function into a linear combination of indicator functions. The inverse is achieved with the function signtopiece. Symbolic Convolution in Nspire CAS

Here are some examples: Symbolic Convolution in Nspire CAS We add the « step » function. We add the indicator function and call it « chi ». We « unpiece ». We« convert » to piecewise. « grouper_fct » finishes the job. 49

50 Nspire CAS is now able to do as Derive when comes time to integrate a product of sign with another expression. In fact, Frédérick has programmed the function integral_sign in order to compute the integral of expressions as sign(ax + b)·f(x). For more complicated examples, expansion is used and the function integral2 does the job. Let’s take a look at an example. Symbolic Convolution in Nspire CAS

51 The answer would be different if sign(2x  5) was factored out first; the 2 answers would differ by a constant, as for primitives. Symbolic Convolution in Nspire CAS Nspire built-in integrator. Frédérick’s function! Derive built-in integrator. It is the same!

52 Now, let be given 2 piecewise continuous signals, say x(t) and h(t). We “unpiece” the product x(  )h(t  ). This become a linear combination of sign functions and we integrate it using the new integral2 function. The antiderivative is then evaluated between ∞ and  ∞. This yields the convolution of x and h. The function convol_gen does the job. Symbolic Convolution in Nspire CAS

53 If the answer is a linear combination of absolute values expressions, our function conv_abs_to_p converts it into a piecewise function. Let’s give a concrete example, taking the two earlier rectangular pulses: Symbolic Convolution in Nspire CAS

54 Definition of both signals. Convolution of both signals. Conversion to a piecewise function. Simplification of the answer and its graph.

55 Finally, the convolution of this output trapezoidal signal with  (t  1) should produce a translation of one unit on the right: that is the last trapezoidal output should move one unit to the right. Again, we will use a limit of indicator function in order to use a Dirac delta function. Symbolic Convolution in Nspire CAS

56 Symbolic Convolution in Nspire CAS The 2 signals. We call the convolution of the 2 signals « output ». We take an approximate unit-impulse. The convolution of « output » with the approximate unit-impulse is a huge expression! But we know we will take the limit of this.

57 Symbolic Convolution in Nspire CAS And the limit is exactly what we are expecting. The graph is the trapezoidal signal moved one unit to the right.

58 In 2006, at the beginning of Nspire CAS, Bernhard Kutzler proclaimed it as the “true successor of Derive”. Albert Rich would have disagreed… Michel Beaudin, with the help of Frédérick Henri, wants to make Bernhard’s affirmation come true. But there is a lot more to be done, as far as the CAS part of the system is concerned. Conclusion

59 This represents a fantastic opportunity to do mathematics and to discover, day after day, how Derive was special. Helping Nspire CAS to become more powerful (in the CAS sense) represents my contribution to a product that gave me a lot of enthusiasm for the past 15 years! Conclusion

60