## how to verify lambda calculus is computable and re...

how to verify lambda calculus is computable and realizable in maple?

is it possible to realize lambda calculus into algebra ?

how to use β-reduction to convert algebra function into lambda calculus?

is there a way to convert back ?

how to combine multiple lambda calculus into one lambda calculus and check computable and then convert back to algebra function?

## Passing variable number of arguments...

I'm starting to use procs a lot just because they are more general and can more easily handle complex functionality.

I usually have to pass a function to them and that function may or may not take a series of arguments.

e.g.,

f := (x,y,a)->a*x*y;

g := proc(q, ...)

q(x,y,...)

end proc;

g(f, 3);

Here 3 should be passed for a(using ... to represent it).

If I pass a function

h := (x,y)->x*y

then it would be g(f)

I could possibly use nops, ops, arrays, etc... but looking for the right solution.

## Generation of numbers with Cauchy distribution in ...

Hello. To generate nine numbers with Cauchy distribution C(0,1) I use Sample(Random Variable(Cauchy(0, 1)), 9). Is there a way to make all generated numbers belong to the interval (-1,1)?

## how to make diff(y(x),x) display as y'(x) in works...

I spend some time searching and reading help. But not able to find if this is possible.

I use worksheet only (i.e. not 2D document). I have my display set as

I'd like diff(y(x),x) to display as y'(x) in output.

I know I can do this

`PDEtools:-declare(y(x), prime = x);`

And that will make diff(y(x),x) display as y'  but I want y'(x). And the same for diff(y(x),x\$2) to display as y''(x). And to be clear, y(x) will still display as y(x).  I am mainly interested in making the derivative display a little nicer if possible.

Is there a way to do this?

I am using 2019.1 on windows 10.

## Wrong values for Eigenvalues, depending on Digits ...

Hello!

I want to calculate Eigenvalues. Depending on values for digits and which datatype I choose Maple sometimes returns zero as Eigenvalues. Maybe there is a problem with the used routines: CLAPACK sw_dgeevx_, CLAPACK sw_zgeevx_.

 >

Problems LinearAlgebra:-Eigenvalues, Digits, ':-datatype' = ':-sfloat', ':-datatype' = ':-complex'( ':-sfloat' )

 > restart;
 > interface( ':-displayprecision' = 5 ):
 > infolevel['LinearAlgebra'] := 5; myPlatform := kernelopts( ':-platform' ); myVersion := kernelopts( ':-version' );
 (1.1)

Example 1

 > A1 := Matrix( 5, 5, [[0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1], [-10201/1000, 30199/10000, -5049/250, 97/50, -48/5]] );
 (1.1.1)
 > LinearAlgebra:-Eigenvalues( A1 );
 CharacteristicPolynomial: working on determinant of minor 2 CharacteristicPolynomial: working on determinant of minor 3 CharacteristicPolynomial: working on determinant of minor 4 CharacteristicPolynomial: working on determinant of minor 5
 (1.1.2)
 > A11 := Matrix( op( 1, A1 ),( i,j ) -> evalf( A1[i,j] ), ':-datatype' = ':-sfloat' );
 (1.1.3)
 > Digits := 89; LinearAlgebra:-Eigenvalues( A11 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.1.4)
 > Digits := 90; LinearAlgebra:-Eigenvalues( A11 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.1.5)
 > A12 := Matrix( op( 1, A1 ),( i,j ) -> evalf( A1[i,j] ), ':-datatype' = ':-complex'( ':-sfloat' ) );
 (1.1.6)
 > Digits := 100; LinearAlgebra:-Eigenvalues( A12 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.1.7)
 > Digits := 250; LinearAlgebra:-Eigenvalues( A12 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.1.8)
 >
 >

Example 2

 > A2 := Matrix(3, 3, [[0, 1, 0], [0, 0, 1], [3375, -675, 45]]);
 (1.2.1)
 > LinearAlgebra:-Eigenvalues( A2 );
 IntegerCharacteristicPolynomial: Computing characteristic polynomial for a 3 x 3 matrix IntegerCharacteristicPolynomial: Using prime 33554393 IntegerCharacteristicPolynomial: Using prime 33554383 IntegerCharacteristicPolynomial: Used total of  2  prime(s)
 (1.2.2)
 > A21 := Matrix( op( 1, A2 ),( i,j ) -> evalf( A2[i,j] ), ':-datatype' = ':-sfloat' );
 (1.2.3)
 > Digits := 77; LinearAlgebra:-Eigenvalues( A21 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.2.4)
 > Digits := 78; LinearAlgebra:-Eigenvalues( A21 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.2.5)
 > A22 := Matrix( op( 1, A2 ),( i,j ) -> evalf( A2[i,j] ), ':-datatype' = ':-complex'( ':-sfloat' ) );
 (1.2.6)
 > Digits := 58; LinearAlgebra:-Eigenvalues( A22 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.2.7)
 > Digits := 59; LinearAlgebra:-Eigenvalues( A22 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.2.8)
 >
 >

Example 3

 > A3 := Matrix(4, 4, [[0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1], [-48841, 8840, -842, 40]]);
 (1.3.1)
 > LinearAlgebra:-Eigenvalues( A3 );
 IntegerCharacteristicPolynomial: Computing characteristic polynomial for a 4 x 4 matrix IntegerCharacteristicPolynomial: Using prime 33554393 IntegerCharacteristicPolynomial: Using prime 33554383 IntegerCharacteristicPolynomial: Used total of  2  prime(s)
 (1.3.2)
 > A31 := Matrix( op( 1, A3 ),( i,j ) -> evalf( A3[i,j] ), ':-datatype' = ':-sfloat' );
 (1.3.3)
 > Digits := 75; LinearAlgebra:-Eigenvalues( A31 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.3.4)
 > Digits := 76; LinearAlgebra:-Eigenvalues( A31 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.3.5)
 > A32 := Matrix( op( 1, A3 ),( i,j ) -> evalf( A3[i,j] ), ':-datatype' = ':-complex'( ':-sfloat' ) );
 (1.3.6)
 > Digits := 100; LinearAlgebra:-Eigenvalues( A32 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.3.7)
 > Digits := 250; LinearAlgebra:-Eigenvalues( A32 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.3.8)
 >
 >

Example 4

 > A4 := Matrix(8, 8, [[0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 1], [-1050625/20736, 529925/1296, -15417673/10368, 3622249/1296, -55468465/20736, 93265/108, -1345/8, 52/3]]);
 (1.4.1)
 > LinearAlgebra:-Eigenvalues( A4 );
 CharacteristicPolynomial: working on determinant of minor 2 CharacteristicPolynomial: working on determinant of minor 3 CharacteristicPolynomial: working on determinant of minor 4 CharacteristicPolynomial: working on determinant of minor 5 CharacteristicPolynomial: working on determinant of minor 6 CharacteristicPolynomial: working on determinant of minor 7 CharacteristicPolynomial: working on determinant of minor 8
 (1.4.2)
 > A41 := Matrix( op( 1, A4 ),( i,j ) -> evalf( A4[i,j] ), ':-datatype' = ':-sfloat' );
 (1.4.3)
 > Digits := 74; LinearAlgebra:-Eigenvalues( A41 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.4.4)
 > Digits := 75; LinearAlgebra:-Eigenvalues( A41 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_dgeevx_
 (1.4.5)
 > A42 := Matrix( op( 1, A4 ),( i,j ) -> evalf( A4[i,j] ), ':-datatype' = ':-complex'( ':-sfloat' ) );
 (1.4.6)
 > Digits := 100; LinearAlgebra:-Eigenvalues( A42 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.4.7)
 > Digits := 250; LinearAlgebra:-Eigenvalues( A42 );
 Eigenvalues: calling external function Eigenvalues: initializing the output object Eigenvalues: using software external library Eigenvalues: CLAPACK sw_zgeevx_
 (1.4.8)
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >

## has anyone tried to use Peter Fritzone's book with...

has anyone tried to use Peter Fritzone's book with maplesim helloworld modelica??

The simple approach from Peter (creating a custom modelica component) is to getting started by running a simple simulation where x_dot(t) = - a*x,  where the normal form is x(t) = x^-a for logarithmic type decay.

plot of x(t) should be a decay curve.

Maple Code

SimData := A:-Simulate(outputs = x, returntype = datapoints, tf = 2);

Error, invalid input: Simulate expects value for keyword parameter [outputs, output] to be of type {list(algebraic), list(anyfunc(identical(t)))}, but received x

***********

Simcode

Model Main;

Imports

public HelloWorld HelloWorld1 annotation(Placement(transformation(origin={100.0,200.0},extent={{-20.0,-20.0},{20.0,20.0}},rotation=0)));
annotation(
Diagram(coordinateSystem(preserveAspectRatio=true, extent={{0,0},{200.0,200.0}}),graphics),
Icon(coordinateSystem(preserveAspectRatio=true, extent={{0,0},{200.0,200.0}}),graphics={Rectangle(extent={{0,0},{200.0,200.0}}, lineColor={0,0,0})}),
uses(Modelica(version="3.2.3")),
experiment(
StartTime = 0,
StopTime = 2.0,
__Maplesoft_solver = "ck45",
Tolerance = 0.1e-4,
__Maplesoft_tolerance_abs = 0.1e-4,
__Maplesoft_step_size = 0.1e-2,
__Maplesoft_min_step_size = 0,
__Maplesoft_max_step_size = 0,
__Maplesoft_plot_points = 2000,
__Maplesoft_numeric_jacobian = false,
__Maplesoft_constraint_iterations = 50,
__Maplesoft_event_iterations = 100,
__Maplesoft_algebraic_error_control = false,
__Maplesoft_algebraic_error_relaxation_factor = 1,
__Maplesoft_rate_hysteresis = 0.1e-9,
__Maplesoft_reduce_events = false,
__Maplesoft_integration_diagnostics = false,
__Maplesoft_compiler = true,
__Maplesoft_compiler_optimize = true,
__Maplesoft_scale_method = "none",
__Maplesoft_plot_event_points = true
)
);

end Main;

class HelloWorld
Real x (start =1);
parameter Real a = 1;
equation
der(x) = -a*x;
end HelloWorld;

## How do you find Fourier Transform of non-integer p...

Dear Maple users,

I want to find an expression for the Fourier Transform (FT) of an expression like  f(t)=exp(-t^2)/t^a, where a>0 is a constant.

I note that integer values of a (postive or negative) is ok; but non-integer fails. See sheet attached where I have tried 1 or 2 cases, a=0, 1, 0.3, etc.

So the questions are:

(1) how can I find the FT of the above for typical non-integer values of a>0 ?

(2) how can I find the FT of the above for general a -- i.e. declare a as a parameter?

Thanks

 (1)

 (2)

 (3)

 (4)

 (5)

## i want to plot a few equation with animate plot or...

hi

i want to plot this equations , i want to show that step by step and remind previous . i plot with animte plot but it do not show the previous

restart;
with(plottools);
co := blue;
with(plots);

t := 1;
for i from 20 by -1 to 0 do t := t+1; a[i] := -i*x/t+i; p[i] := plot(a[i], x = 0 .. 20, y = 0 .. 20, color = co, thickness = 3) end do;

plots[animate](plot, [a[k], x = 0 .. 20, y = 0 .. 20], k = [seq(i, i = 1 .. 20)]);

## Elliptical PDEs...

pde := (diff(u(r, theta), r) + r * diff(u(r, theta), r, r) + diff(u(r, theta), theta, theta) / r ) / r:
iv := u( 1, theta) = 0, u( 3, theta) = theta, u( r, 0) = 10, u( r, Pi/2) = 0:
Maple 2019 returns a symbolic solution for PDE:
pdsolve([pde, iv], u(r, theta));
But for the numeric option, it returns a message saying that Maple is unable to handle elliptical PDEs.
pdsolve(pde, {iv}, numeric, time = t, range = 1 .. 3);

Error, (in pdsolve/numeric) unable to handle elliptic PDEs
I found it strange.

Oliveira.

## FUNCTIONAL FORM OF INTERPOLATON...

How to get the functional form of interpolation in the given example below

GP.mw

Hi

## problems with ChiSquareSuitableModelTest...

Hi,

The procedure Statistics:-ChiSquareSuitableModelTest returns wrong or stupid results in some situations.
The stupid answer can easily be avoided if the user is careful enough.
The wrong answer is more serious: the standard deviation (in the second case below) is not correctly estimated.

PS: the expression "CORRECT ANSWER" is a short for "POTENTIALLY CORRECT ANSWER" given that what ChiSquareSuitableModelTest really does is not documented

 > restart:
 > with(Statistics):
 > randomize(): N := 100: S := Sample(Normal(0, 1), N):
 > infolevel[Statistics] := 1: # 0 parameter to fit from the sample S  CORRECT ANSWER ChiSquareSuitableModelTest(S, Normal(0, 1), level = 0.5e-1): print():
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution Bins:                    10 Degrees of freedom:      9 Distribution:            ChiSquare(9) Computed statistic:      15.8 Computed pvalue:         0.0711774 Critical value:          16.9189774487099 Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false
 (1)
 > # 2 parameters (mean and standard deviation) to fit from the sample S  INCORRECT ANSWER ChiSquareSuitableModelTest(S, Normal(a, b), level = 0.5e-1, fittedparameters = 2): print(): # verification m := Mean(S); s := StandardDeviation(S); t := sqrt(add((S-~m)^~2) / (N-1)); print(): error "the estimation of the StandardDeviation ChiSquareSuitableModelTest is not correct"; print():
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution Model specialization:    [a = -.2143e-1, b = .8489] Bins:                    10 Degrees of freedom:      7 Distribution:            ChiSquare(7) Computed statistic:      3.8 Computed pvalue:         0.802504 Critical value:          14.0671405764057 Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false
 (2)
 > # ONLY 1 parameter (mean OR standard deviation ?) to fit from the sample S  STUPID ANSWER # # A stupid answer: the parameter to fit not being declared, the procedure should return # an error of the type "don(t know what is the paramater tio fit" ChiSquareSuitableModelTest(S, Normal(a, b), level = 0.5e-1, fittedparameters = 1): print(): WARNING("ChiSquareSuitableModelTest should return it can't fit a single parameter"); print():
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution Model specialization:    [a = -.2143e-1, b = .8489] Bins:                    10 Degrees of freedom:      8 Distribution:            ChiSquare(8) Computed statistic:      3.8 Computed pvalue:         0.874702 Critical value:          15.5073130558655 Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false
 (3)
 > ChiSquareSuitableModelTest(S, Normal(a, 1), level = 0.5e-1, fittedparameters = 1):  #CORRECT ANSWER print(): # verification m := Mean(S); print():
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution Model specialization:    [a = -.2143e-1] Bins:                    10 Degrees of freedom:      8 Distribution:            ChiSquare(8) Computed statistic:      16.4 Computed pvalue:         0.0369999 Critical value:          15.5073130558655 Result: [Rejected] This statistical test provides evidence that the null hypothesis is false
 (4)
 > ChiSquareSuitableModelTest(S, Normal(0, b), level = 0.5e-1, fittedparameters = 1):  #CORRECT ANSWER print(): # verification s := sqrt((add(S^~2) - 0^2) / N); print():
 Chi-Square Test for Suitable Probability Model ---------------------------------------------- Null Hypothesis: Sample was drawn from specified probability distribution Alt. Hypothesis: Sample was not drawn from specified probability distribution Model specialization:    [b = .8492] Bins:                    10 Degrees of freedom:      8 Distribution:            ChiSquare(8) Computed statistic:      6.4 Computed pvalue:         0.60252 Critical value:          15.5073130558655 Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false
 (5)
 >

## How to get the result of this limit?...

How to get the result of this limit? I don't get the result.

`limit(sum(1/(i*sqrt(i+1)+(i+1)*sqrt(i)), i = 1 .. n), n = infinity);`

With Mathematica, I got the output is 1.

## How to get a random number from the list?...

Hello. Let's say I have a list of many items. Well, let's list A:=[1,1.732,1.23,4.42,9,6.45,3.45,8.428,9.1,12]. How to get three numbers from it randomly?

## How to convert expression in hypergeom to integral...

It shows that odetest() did not verify a solution to ODE becuase solution was using hypergeom special functions. If the solution to the ODE was in integral form, then odetest() will verify it OK.

But what to do if the solution I want to verify is already in hypergoem? If I try odetest() it will fail to verify now. Then I can try to convert the solution to integral form and try again.

But when  using convert(sol,Int) followed by odetest() it did not work.

The solutions I try to verify are hand solutions or book solutions, and not coming from dsolve.

But some of them are the same solution that comes from dsolve() when not using the useInt option.

Also, I am doing this all inside a Maple program. It is not an interactive process. So I can't do plots and look at them to decide on anything. So verification must all be implemented in code.

The question is: Why did convert(hand_solution,Int) not give the same result as dsolve(ode,useInt)? Is there another way around this? (May be I am asking for too much in this one based on answers in the above link, So that is OK if not possible. But I really like the solution given when using "useInt" option. Much more clear than otherwise).

 > restart;
 > ode := diff(y(x), x)*(x^3 + 1)^(2/3) + (1 + y(x)^3)^(2/3) = 0; sol_int:=dsolve(ode,useInt); odetest(sol_int,ode); #OK now, since solution in integral form

 > hand_solution:= x*hypergeom([1/3, 2/3], [4/3], -x^3) + y(x)*hypergeom([1/3, 2/3], [4/3], -y(x)^3) + _C1 = 0; convert(hand_solution,Int); #Why this did not give same result as ABOVE?

 > odetest(%,ode); #does not give zero

 >

Maple 2019.1