Laplace + Differential equation solver package version 1.2.2

This package contains functions for solving single or multiple differential 
equations with constant coefficients. Differential equations can be of any 
order and complexity. The functions have also the ability to find the 
solutions of most integral equations or combinations of differential and 
integral equations (integro-differential equations). Method used: Laplace-
transformation. 

This package also contains functions for Laplace-transformation. If you 
already have Laplace92 it can be replaced by this package.

Keep the functions together in a separate folder with the name "LAPLACE"
and do not create any variable in it. 

Functions:
SolveD	 solve single differential/integral equations
SimultD	 solve multiple simultaneous differential/integral equations
Laplace	 transforms from time to Laplace domain.
iLaplace transforms from Laplace to time domain.

Before using functions set TI-92 MODE
  Complex Format to RECTANGULAR
  Angle to RADIAN
  Exact/Approx to AUTO

You have to do these settings yourself because; the programs cannot change
the mode setting on the calculator. 

----------------------------------------------------------------------------
Help

This program will give online information about and demonstrate the use of
functions in this package. When you do not need this program any longer just 
delete it.

Syntax: Help()
----------------------------------------------------------------------------
SolveD

Solving single differential/integral equation. The Principe in this function is, 
first it will transform the equation in to the Laplace-domain and second it 
solves the equation as a linear equations, third it transforms the solution back 
to the time-domain (see Laplace/iLaplace for further information about Laplace-
transformation).

In Principe SolveD can solve differential/integral equations of any order. The 
only limitation is the size of the calculator's memory (if it is a very complex 
solution, it may run out of memory). 

Equations/initial conditions may contain constants of any kind, but the letter 
's' may not be used in any connection. 

Heaviside/Dirac delta functions can be used in equation (see Laplace for 
further information).

Syntax: SolvD

SolvD(equation,{function ,initial conditions})

equation    differential/integral equation
	    derivative of a function is written: d(f(x),x,n) 
            where "d()" is the normal differentiation function
            on the calculator and 'n' is the order.
            Integrals of a function is written: 'int'(f(x),x) 
            or d(f(x),x,-n). Where 'int'() is the calculators 
            normal integral-function

function	function to solve fore: f(x)
initial conditions	f(0),f'(0),f''(0),..

Example 1:
Solving second order differential equation: 

Equation: d^2x(t)/dt^2+2*dx(t)/dt+5=sin(2*t) and t>=0

Initial conditions: x'=3 and x=1 at t=0

SolveD(d(x(t),t,2)+2*d(x(t),t)+5=e^(-t),{x(t),1,3})

d() is the normal differentiation function on the calculator.

Result:  x(t)= 10 - t*e^(-t) - 9*e^(-t) - 5*t +10
---------------------------------------------------------------
Example 2:

Obtain the solution x(t), t>=0, of the differential equation

d^2x(t)/dt^2+5*dx(t)/dt+6=f(t)

where f(t) is the pulse function

         | 3 (0<= t <6)
 f(t) =  |
         | 0 (t >= 6)

Initial conditions x(0)=0 and x'(0)=2

First rewriting f(t) to Heaviside functions

f(t) = 3*(u(t) - u(t-6))

Now the equation can be solved with SolvD

SolveD( d(x(t),t,2)+5*d(x(t),t)+6=3*(u(t)-u(t-6)),{x(t),0,2})

Result

x(t)=(13/25-3*t/5-13*e^(-5t)/25)*u(t)+(93/25-3*t/5-3*e^(-5*t+30)/25)*u(t-6)
---------------------------------------------------------------
Example 3:

Obtain the solution x(t), t>=0, of the integral equation

 'int'(x(t),t)+x=sin(5*t)

Where 'int'() is the calculators normal integral-function

SolveD('int'(x(t),t)+x=sin(5*t),{x(t)})

Result
 x(t)=5*cos(5*t)/26+25*sin(5*t)/26-5*e^(-t)/26
---------------------------------------------------------------
Example 4:

Obtain the solution x(t), t>=0, of the mixed differential/integral equation

 'int'(x(t),t)+dx/dt=cos(t)

Initial conditions: unknown

SimultD('int'(x(t),t)+d(x(t),t)=cos(t),{x(t)})

Solution

 x(t)=t*cos(t)/2+x0*cos(t)+sin(t)/2

Here "x0"= the unknown initial condition

----------------------------------------------------------------------------

SimultD

Solving multiple simultaneous differential/integral equations. The Principe in 
this function is, first it will transform the equations in to the Laplace-
domain and second it solves the equations as a system of linear equations, 
third it transforms the solutions back to the time-domain (see Laplace/iLaplace 
for further information about Laplace-transformation).

There are very few rules to obey when using SimultD. First, there has to be an 
equal number of equations and unknown variables. Second, the variable has to be
a function of the type f(var). 

Equations do not need to be of same order. In Principe SimultD can solve any 
number of simultaneous differential/integral equations of any order or mixture 
of different orders, if there are a sufficient number of equations. The only 
limitation is the size of the calculator's memory (if it is a very complex 
solution, it can run out of memory). 

Equations/initial conditions may contain constants of any kind, but the letter 's' 
may not be used in any connection. 

Heaviside/Dirac delta functions may be used in equations (see Laplace for 
further information).

Syntax: SimultD

SimultD([equation;equation;...], [f1(var),f1(0),f1'(0),..;f2(var), f2(0),f2'(0),..;.. ])

equation; equation;..      differential/integral equations separated by ';' 
                           derivative of a function is written: d(f(x),x,n) 
                           where "d()" is the normal differentiation function on
                           the calculator and 'n' is the order.
                           Integrals of a function is written: 'int'(f(x),x) or 
                           d(f(x),x,-n). Where 'int'() is the calculators normal
                           integral-function

f1(var),f1(0),..; f2(var),..    functions and  belonging initial conditions separated
                                by ';'
                                              
Example 1.

Solve for t>=0 the first-order simultaneous differential equation

dx/dt+dy/dt+5*x+3*y=e^(-t)

2*dx/dt+dy/dt+x+y=3

initial conditions x=2 and y=1 at t=0

[d(x(t),t)+d(y(t),t)+5*x+3*y=e^(-t); 2*d(x(t),t)+d(y(t),t)+x+y=3] ->matx1

SimultD(matx1, [x(t),2;y(t),1])

result
| x(t)=25*e^(t)/3-11*e^(-2*t)-9/2                |
|                                                |
| y(t)=-25*e^(t)/2+1*e^(-t)/2+11*e^(-2*t)/2+15/2 |

----------------------------------------------------------------------------
ATTENTION when solving equations containing integrals. There are some 
situations where Laplace-transformation gives a wrong answer. 

1. When an answer from SolveD/SimultD contains Dirac Delta-functions, it may 
   indicate, that something is wrong. Use the function Check to see if the 
   solution is correct. If Check return something different from zero the 
   solution may be false. In most cases just remove the Dirac-functions, the 
   rest of the answer will be the correct solution to equation. 

2. When the equation contains constants like this:
    'int'(f(t),t)+f(t)+sin(t)=const 
   Laplace-transformation will give the solution for:
    'int'(f(t),t)+f(t)+sin(t)=0

Remember when interpreting the results from Check

'int'('Delta'(t),t) =  'Heaviside'(t) = 1

'int'('Delta'(t),t,2) =  t*'Heaviside'(t) = t and t>=0


I do actually not know why Laplace-transformation gives these false solutions. 
If somebody knows the explanation/solution to this, I would like to know it.
----------------------------------------------------------------------------

Check

Function constructed to check that the results from SolveD/SimultD are correct. 
Check will replace the functions in the equations with the output from 
SolveD/SimultD and return the result.

Check always the results from SolveD/SimultD.

Function: Check

Syntax: Check(equation, result from SolveD/SimultD)

equation    has to be exactly the same as past to SimultD/SolveD.
result from SolveD/SimultD  the second parameter has to be the result returned 
from SolveD/SimultD.

----------------------------------------------------------------------------

Menu

Creates a Custom Menu with functions included in this package.
After executing the program press '2nd' 'CUSTUM' to activate/deactivate the menu.

Program: Menu

Syntax: Menu()

----------------------------------------------------------------------------
Laplace92 version 2.5.1

This packet contains two functions to work with Laplace transforms and one 
Function to solve convolution integrals (folding integrals). All of them
are able to work with symbols or numbers. 

---------------------------------------------------------------------------

Laplace(f(var), var) 
Transforms the expression "f(t)" from time domain  to Laplace domain.

f(var): can be any expression, which have a Laplace transform.
var   : is  the name of the variable to transform normally 't', but can 
        be any name.
const:  the expression may contain constants of any kind.
        

Special transforms:
Unit step function (Heaviside function):
      Laplace(u(t - a),t) = e^(-a*s)/s

Dirac delta function:
      Laplace('delta'(t - a),t) = e^(-a*s)

You can get 'delta' by pressing 'green diamond' + G + D on TI-92.

---------------------------------------------------------------------------

iLaplace(F(var), var):
Transform the other way around from Laplace domain to time domain.


F(var): can be any polynomial. It may contain ln() and
        atan().
var:    is  the name of the variable to transform normally  's', but can
        be any name.
const:  the expression may contain constants of any kind. The letter 's' 
        is reserved for the program.

Special transforms:
iLaplace(e^(-a*s)/s,s) = u(t - a)
iLaplace(e^(-a*s),s)   = 'delta'(t - a)

iLaplace may never give an error if used correct. It shall be able to 
transform any real polynomial. If this is not the case please report it to 
me. 

----------------------------------------------------------------------------

fold(f(var), g(var), var)

Solving convolution integrals f*g. 

f(var) and g(var): can be any expressions, which has a Laplace transform.
var:               is  the name of the variable to integrate normally 't',
                   but can be any name.

This function use the fact that, if f(t) and g(t) are of exponential order, 
piecewise-continuous on t>=0 and have Laplace transforms F(s) and G(s) 
respectively, then, for Re(s)>0 f*g=InvL{F(s)G(s)}

Example:
 f(t) = t*u(t)
 g(t) = sin(2t)*u(t)

To solve f*g write following on the commandline:
 fold(t*u(t),sin(2t)*u(t),t)

This gives the result: t/2-sin(2t)/4. 

----------------------------------------------------------------------------
Programs of same type:

 Type				Name		

 inverse Z-transformation	inverseZ	

Please send questions and comments to Lars Frederiksen

ASK@POST8.TELE.DK

PS. Please do not ask for more programs.

