Items tagged with functions functions Tagged Items Feed

This may be a silly question, but does there exist some simple way of (Taylor) expanding an expression of 'small' functions in terms of these functions.

A simple example: Assume that diff(f(x),x) and g(x) are two functions both with range, say, in [-a,+a], where a << 1, and consider the following expression:

sqrt(1 + diff(f(x),x)) * (2 + g(x));

Its expansion to first order in terms of diff(f(x),x) and g(x) should be 2 + diff(f(x),x) + g(x). My problem is that mtaylor does not accept functions as variables to expand on, and I would prefer not to have to substitute back and forth with some 'placeholders'.

Hi! I'm trying to find the way to plot the solution with series representation. I need some help to find the easiest way.

Note: I realized some typing errors, which do not change the question a lot ,and I corrected them.

plot.mw

Typically sets are created like:

A:={a,b,c};

B:={c,q,w,e};

and then you can carryout A union B or B\A

 

what if  you wanted to create the set as

A:={values in some three dimensional space};

B:={volume, based on values taken from A};

Can these relationships be set up in Maple? If so, how? If there are commands that specifically handle these types of sets, what does maple call them?  I've seen the term 'set function' but what might Maple call them?

Note: I am not even sure i 'tagged' this correctly because it I am not sure the proper terms for these functions/sets.

Thanks in advance for any help.

I am working in Document mode, 2D input.  I have doing some complex number evalutions

Lets say I have a complex number Z= 2+3i

when I ask maple for the "abs(Z)" I get the display of "abs(2+3i)" rather than the numberic answer. This occurs with all the complex operation arg, abs, polar conversion, 

polar(abs(2+3*i), argument(2+3*i))   this is from Maple. 

How do I display the numeric value for these functions in my document

 

Thanks Bill

I have entered three functions into Maple and I would like to create a set of all possible two-function and three-function compositions involving the three functions. For instance, for my three functions f(x), g(x) and h(x), the set would contain f(g(x)), g(f(x)), f(g(h(x))), f(f(f(x))), etc. 

I'm also looking for a method that will be generalisable to larger numbers of initial functions than just three.

i'm using maple in a research but i want to add a recursive function h_m(t) in 2 case : if m is integer positive and not, 
la formule est donnée comme suit :  if (mod(m,1) = 0  and m>0) then  h:=proc(m,t)  local  t ;  h[0,t]:=t ;   for  i from -4 to  m  by  2 do  h [m,t]:= h[0, t]-(GAMMA(i/(2)))/(2*GAMMA((i+1)/(2)))*cos(Pi*t)*sin(Pi*t)  od:  fi:  end; 
  if (mod(m,1) = 0  and m>0) then  h:=proc(m,t)  local  t ;  h[0,t]:=t ;   for  i from -4 to  m  by  2 do  h [m,t]:= h[0, t]-(GAMMA(i/(2)))/(2*GAMMA((i+1)/(2)))*cos(Pi*t)*sin(Pi*t)  od:  fi:  end;
and i wanna to know how to programmate a Gaus Hypegeometric function. Thank You

 

I am fairly new to Maple and cannot figure this out.

I'm having some trouble in computing formally the derivatives of
some composite functions

h:= x -> f(g(x)),

imposing conditions on the unknown functions f and g.

For example, I cannot find a way to impose g'(0)=0,
such that the computation of

h'(0)

simply gives 0.

 

Thank you in advance!

This is a stripped down example of something I've been doing. Basically I'm building matrices which I then, using unapply, convert into functions of some variables of t.
.... but found that simplify seems to often not work as i'd wish.
 

restart:
mm:=Matrix([[cos(sqrt(g__1^2)*t), (-I*g__1*sin(sqrt(g__1^2)*t))*(1/sqrt(g__1^2))], [(-I*g__1*sin(sqrt(g__1^2)*t))*(1/sqrt(g__1^2)) ,cos(sqrt(g__1^2)*t)]]);

#great - simplifies as i'd expect:
simplify(mm) assuming g__1::positive;

Do the same thing but when matrix is a function of t
mmFun:=unapply(mm, t);

#the function works - gives what i'd expect
mmFun(3); mmFun(t);

#but now the simplification does not work - why the g__1 in the argument of cos does not get properly simplified?
simplify(mmFun(t)) assuming g__1::positive;

Any ideas if this is a bug? I'm using maple 2015.2 on linux 64-bit.

here is the worksheet: simplify_issue.mw

thanks

EDIT:

as a side note once can sometimes overcome this with mapping simplify  as in :

map(simplify, resultMatrix ) assuming g__1::positive;

but this is not optimal, and sometimes does not work when i first multiply the matrix by say a vector.

 

 

 

Hello,

I would like to create a function from an equation.
I have define 4 functions u[1](t), ..., u[4](t).
From these 4 functions, I would like to define 4 equations. I would like to obtain this result:
Equ[1]:=u[1](t)=L/2*cos(w*t+phi[1])
Equ[2]:=u[2](t)=L/2*cos(w*t+phi[2])
Equ[3]:=u[3](t)=L/2*cos(w*t+phi[3])
Equ[4]:=u[4](t)=L/2*cos(w*t+phi[4])

My code is the following:

for i to 4
do
u[i]:=unapply(L/2*cos(w*t+phi[i]),t);
Equ[i]:='u[i](t)'=u[i](t);
end do;

These lines are not working because the left member is not incremented (u[i](t) stays at each iteration u[i](t))

Generally, how can I transform a function to an equation ?
And, in this specific case, how can I obtain the four equations mentioned above ?

Thanks a lot for your help.

 


The year 2015 has been one with interesting and relevant developments in the MathematicalFunctions  and FunctionAdvisor projects.

• 

Gaps were filled regarding mathematical formulas, with more identities for all of BesselI, BesselK, BesselY, ChebyshevT, ChebyshevU, Chi, Ci, FresnelC, FresnelS, GAMMA(z), HankelH1, HankelH2, InverseJacobiAM, the twelve InverseJacobiPQ for P, Q in [C,D,N,S], KelvinBei, KelvinBer, KelvinKei, KelvinKer, LerchPhi, arcsin, arcsinh, arctan, ln;

• 

Developments happened in the Mathematical function package, to both compute with symbolic sequences and symbolic nth order derivatives of algebraic expressions and functions;

• 

The input FunctionAdvisor(differentiate_rule, mathematical_function) now returns both the first derivative (old behavior) and the nth symbolic derivative (new behavior) of a mathematical function;

• 

A new topic, plot, used as FunctionAdvisor(plot, mathematical_function), now returns 2D and 3D plots for each mathematical function, following the NIST Digital Library of Mathematical Functions;

• 

The previously existing FunctionAdvisor(display, mathematical_function) got redesigned, so that it now displays more information about any mathematical function, and organized into a Section with subsections for each of the different topics, making it simpler to find the information one needs without getting distracted by a myriad of formulas that are not related to what one is looking for.

More mathematics

 

More mathematical knowledge is in place, more identities, differentiation rules of special functions with respect to their parameters, differentiation of functions whose arguments involve symbolic sequences with an indeterminate number of operands, and sum representations for special functions under different conditions on the functions' parameters.

Examples

   

More powerful symbolic differentiation (nth order derivative)

 

Significative developments happened in the computation of the nth order derivative of mathematical functions and algebraic expressions involving them.

Examples

   

Mathematical handling of symbolic sequences

 

Symbolic sequences enter various formulations in mathematics. Their computerized mathematical handling, however, was never implemented - only a representation for them existed in the Maple system. In connection with this, a new subpackage, Sequences , within the MathematicalFunctions package, has been developed.

Examples

   

Visualization of mathematical functions

 

When working with mathematical functions, it is frequently desired to have a rapid glimpse of the shape of the function for some sampled values of their parameters. Following the NIST Digital Library of Mathematical Functions, a new option, plot, has now been implemented.

Examples

   

Section and subsections displaying properties of mathematical functions

 

Until recently, the display of a whole set of mathematical information regarding a function was somehow cumbersome, appearing all together on the screen. That display was and is still available via entering, for instance for the sin function, FunctionAdvisor(sin) . That returns a table of information that can be used programmatically.

With time however, the FunctionAdvisor evolved into a consultation tool, where a better organization of the information being displayed is required, making it simpler to find the information we need without being distracted by a screen full of complicated formulas.

To address this requirement, the FunctionAdvisor now returns the information organized into a Section with subsections, built using the DocumentTools package. This enhances the presentation significantly.

Examples

   

These developments can be installed in Maple 2015 as usual, by downloading the updates (bundled with the Physics and Differential Equations updates) from the Maplesoft R&D webpage for Mathematical Functions and Differential Equations


Download MathematicalFunctionsAndFunctionAdvisor.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

I have functions like

g := (y, t)->sin(y(t))

diff(g(y, t), t) # ok

How to determine the derivative below with maple :

diff(g(y, t), y(t))

Thanks

How plot two functions of two variables to (2-dimension)?

restart;
approximate := exp(-2*t)+x*exp(-2*t)+(1/2)*exp(-2*t)*x^2+(1/6)*exp(-2*t)*x^3+(1/24)*exp(-2*t)*x^4+(1/120)*exp(-2*t)*x^5+(1/720)*exp(-2*t)*x^6+(1/5040)*exp(-2*t)*x^7+(1/40320)*exp(-2*t)*x^8+(1/362880)*exp(-2*t)*x^9+(1/3628800)*exp(-2*t)*x^10+(1/39916800)*exp(-2*t)*x^11+(1/479001600)*exp(-2*t)*x^12+(1/6227020800)*exp(-2*t)*x^13+(1/87178291200)*exp(-2*t)*x^14+(1/1307674368000)*exp(-2*t)*x^15+(1/20922789888000)*exp(-2*t)*x^16+(1/355687428096000)*exp(-2*t)*x^17+(1/6402373705728000)*exp(-2*t)*x^18+(1/121645100408832000)*exp(-2*t)*x^19+(1/2432902008176640000)*exp(-2*t)*x^20+(1/51090942171709440000)*exp(-2*t)*x^21;
apr := unapply(approximate, x, t);
Exact := (x, t)-> exp(x-2*t) ;
plot3d(exp(x-2*t)-approximate, x = 0 .. 5, t = 0 .. 5);

 

plot.mw

In Maple 18, I'm trying to define a matrix consisting of the output of the diff function from Physics, but it seems to return an empty matrix for some reason.

First, the setup:

with(Physics);
(D(x))(t) := x(t)^2+y(t)^2;
(D(y))(t) := x(t)^2-y(t)^2;


Then if I try to input the output of e.g. diff(x'(t),x(t)) directly into a matrix structure, it outputs an empty space for that entry.

I can work around it setting the output of diff into variables first, and then using those in my matrix structure, but that's a bit annoying.

See attached image for input/output

 

I have double indexed functiions f[j,k] of one variable and double indexed coefficients a[j,k].

I want my print do look like a[1,1]f11+a[1,2]f12 that is, the values of a[j,k] should appear beside the functions' names, like

7f11+2f12-3f21 etc.

Thank yopu for any help

 

Symbolic sequences enter in various formulations in mathematics. This post is about a related new subpackage, Sequences, within the MathematicalFunctions package, available for download in Maplesoft's R&D page for Mathematical Functions and Differential Equations (currently bundled with updates to the Physics package).

 

Perhaps the most typical cases of symbolic sequences are:

 

1) A sequence of numbers - say from n to m - frequently displayed as

n, `...`, m

 

2) A sequence of one object, say a, repeated say p times, frequently displayed as

 "((a,`...`,a))"

3) A more general sequence, as in 1), but of different objects and not necessarily numbers, frequently displayed as

a[n], `...`, a[m]

or likewise a sequence of functions

f(n), `...`, f(m)

In all these cases, of course, none of n, m, or p are known: they are just symbols, or algebraic expressions, representing integer values.

 

These most typical cases of symbolic sequences have been implemented in Maple since day 1 using the `$` operator. Cases 1), 2) and 3) above are respectively entered as `$`(n .. m), `$`(a, p), and `$`(a[i], i = n .. m) or "`$`(f(i), i = n .. m)." To have computer algebra representations for all these symbolic sequences is something wonderful, I would say unique in Maple.

Until recently, however, the typesetting of these symbolic sequences was frankly poor, input like `$`(a[i], i = n .. m) or ``$\``(a, p) just being echoed in the display. More relevant: too little could be done with these objects; the rest of Maple didn't know how to add, multiply, differentiate or map an operation over the elements of the sequence, nor for instance count the sequence's number of elements.

 

All this has now been implemented.  What follows is a brief illustration.

restart

First of all, now these three types of sequences have textbook-like typesetting:

`$`(n .. m)

`$`(n .. m)

(1)

`$`(a, p)

`$`(a, p)

(2)

For the above, a$p works the same way

`$`(a[i], i = n .. m)

`$`(a[i], i = n .. m)

(3)

Moreover, this now permits textbook display of mathematical functions that depend on sequences of paramateters, for example:

hypergeom([`$`(a[i], i = 1 .. p)], [`$`(b[i], i = 1 .. q)], z)

hypergeom([`$`(a[i], i = 1 .. p)], [`$`(b[i], i = 1 .. q)], z)

(4)

IncompleteBellB(n, k, `$`(factorial(j), j = 1 .. n-k+1))

IncompleteBellB(n, k, `$`(factorial(j), j = 1 .. n-k+1))

(5)

More interestingly, these new developments now permit differentiating these functions even when their arguments are symbolic sequences, and displaying the result as in textbooks, with copy and paste working properly, for instance

(%diff = diff)(hypergeom([`$`(a[i], i = 1 .. p)], [`$`(b[i], i = 1 .. q)], z), z)

%diff(hypergeom([`$`(a[i], i = 1 .. p)], [`$`(b[i], i = 1 .. q)], z), z) = (product(a[i], i = 1 .. p))*hypergeom([`$`(a[i]+1, i = 1 .. p)], [`$`(b[i]+1, i = 1 .. q)], z)/(product(b[i], i = 1 .. q))

(6)

It is very interesting how much this enhances the representation capabilities; to mention but one, this makes 100% possible the implementation of the Faa-di-Bruno  formula for the nth symbolic derivative of composite functions (more on this in a post to follow this one).

But the bread-and-butter first: the new package for handling sequences is

with(MathematicalFunctions:-Sequences)

[Add, Differentiate, Map, Multiply, Nops]

(7)

The five commands that got loaded do what their name tells. Consider for instance the first kind of sequences mentione above, i.e

`$`(n .. m)

`$`(n .. m)

(8)

Check what is behind this nice typesetting

lprint(`$`(n .. m))

`$`(n .. m)

 

All OK. How many operands (an abstract version of Maple's nops  command):

Nops(`$`(n .. m))

m-n+1

(9)

That was easy, ok. Add the sequence

Add(`$`(n .. m))

(1/2)*(m-n+1)*(n+m)

(10)

Multiply the sequence

Multiply(`$`(n .. m))

factorial(m)/factorial(n-1)

(11)

Map an operation over the elements of the sequence

Map(f, `$`(n .. m))

`$`(f(j), j = n .. m)

(12)

lprint(`$`(f(j), j = n .. m))

`$`(f(j), j = n .. m)

 

Map works as map, i.e. you can map extra arguments as well

MathematicalFunctions:-Sequences:-Map(Int, `$`(n .. m), x)

`$`(Int(j, x), j = n .. m)

(13)

All this works the same way with symbolic sequences of forms "((a,`...`,a))" , and a[n], `...`, a[m]. For example:

`$`(a, p)

`$`(a, p)

(14)

lprint(`$`(a, p))

`$`(a, p)

 

MathematicalFunctions:-Sequences:-Nops(`$`(a, p))

p

(15)

Add(`$`(a, p))

a*p

(16)

Multiply(`$`(a, p))

a^p

(17)

Differentation also works

Differentiate(`$`(a, p), a)

`$`(1, p)

(18)

MathematicalFunctions:-Sequences:-Map(f, `$`(a, p))

`$`(f(a), p)

(19)

MathematicalFunctions:-Sequences:-Differentiate(`$`(f(a), p), a)

`$`(diff(f(a), a), p)

(20)

For a symbolic sequence of type 3)

`$`(a[i], i = n .. m)

`$`(a[i], i = n .. m)

(21)

MathematicalFunctions:-Sequences:-Nops(`$`(a[i], i = n .. m))

m-n+1

(22)

Add(`$`(a[i], i = n .. m))

sum(a[i], i = n .. m)

(23)

Multiply(`$`(a[i], i = n .. m))

product(a[i], i = n .. m)

(24)

The following is nontrivial: differentiating the sequence a[n], `...`, a[m], with respect to a[k] should return 1 when n = k (i.e the running index has the value k), and 0 otherwise, and the same regarding m and k. That is how it works now:

Differentiate(`$`(a[i], i = n .. m), a[k])

`$`(piecewise(k = i, 1, 0), i = n .. m)

(25)

lprint(`$`(piecewise(k = i, 1, 0), i = n .. m))

`$`(piecewise(k = i, 1, 0), i = n .. m)

 

MathematicalFunctions:-Sequences:-Map(f, `$`(a[i], i = n .. m))

`$`(f(a[i]), i = n .. m)

(26)

Differentiate(`$`(f(a[i]), i = n .. m), a[k])

`$`((diff(f(a[i]), a[i]))*piecewise(k = i, 1, 0), i = n .. m)

(27)

lprint(`$`((diff(f(a[i]), a[i]))*piecewise(k = i, 1, 0), i = n .. m))

`$`((diff(f(a[i]), a[i]))*piecewise(k = i, 1, 0), i = n .. m)

 

 

And that is it. Summarizing: in addition to the former implementation of symbolic sequences, we now have textbook-like typesetting for them, and more important: Add, Multiply, Differentiate, Map and Nops. :)

 

The first large application we have been working on taking advantage of this is symbolic differentiation, with very nice results; I will see to summarize them in a post to follow in a couple of days.

 

Download MathematicalFunctionsSequences.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

1 2 3 4 5 6 7 Last Page 1 of 43