MaplePrimes Questions

Hello everyone, I'm a new one to Maple, I've just learnt some basic tools.

I want to creat a command that can animate the graph of line y=ax+b by the parameter a, and b will be subscribe later. For example, I can plot y=x+b by:

F:=b->plot(x+b,x=-1..1):

display(F(1));

It did work.

However, applying this with animation didn't seem to work. 

F:=b->animate(plot,[a*x+b,x=-1..1],a=0..10,frames=5):

display(F(1));

It did not create an animation, instead 5 frames of this graph for a=0, 2.5, 5, 7.5, 10

Please show me a solution for this problem, thank you

 

I am wondering if Selection Statement 'if' can be coded in Embedded Components such as Text Area.

I have typed codes in the Text Area(%text_beta_degress) as follows:

if %text_beta_degress=1.2 then Do(%text_ps=28);Do(%text_l4=5.439);
elif %text_beta_degress=8.77 then Do(%text_ps=15);Do(%text_l4=2.785);
elif %text_beta_degress=10 then Do(%text_ps=12.83);Do(%text_l4=2.348);
elif %text_beta_degress=14.4 then Do(%text_ps=5);Do(%text_l4=0.758);
end if

When I typed 1.2 or 8.77 into the Text Area(%text_beta_degress) and tapped 'Enter', %text_ps and %text_l4 didn't response.

Is there any solution?

Hi

 

f := x->x^2:

AB(f, 0, 5);

But my proc is not true for below example:

f := x -> x^3-2*x;
AB(f, -1, 4);
I think c has two value and it is not true.

How can I add a condition to my proc that c be between a and b (a<c<b)?

 

 

How can I solve the following system in Maple for $S_1$ and $S_{i+1}$? I have the code written, but it is giving me nothing as output.

eq1 := Q-A*S[1]*C/X+B*D*(sum(S[j], j = 2 .. i+1))/Y-r[1]*S[1] = 0;
eq2 := A*S[i-1]*C/X-A*S[i]*C/X-B*S[i]*D/Y-r[1]*S[i] = 0;
eq3 := A*S[i]*C/X-B*S[i+1]*D/(Y+S[i+1])-r[2]*S[i+1] = 0;
solve({eq1, eq2, eq3}, {S[1], S[i+1]});

The only non-constants in the system are the $S_j$'s for $j = 1, \ldots, i+1$.

Here is the system in math mode:
$$Q-\frac{AC}{X}S_1-r_1 S_1 +\frac{BD}{Y}\sum\limits_{j=2}^{i+1}S_j = 0 \\
\frac{AC}{X}S_{i-1} - \frac{AC}{X}S_i - \frac{BD}{Y}S_i - r_1 S_i = 0\\
\frac{AC}{X}S_i - \frac{BD S_{i+1}}{Y+S_{i+1}} - r_2 S_{i+1} = 0 $$

I have a head start on it by hand, but it's too cumbersome to complete.

Basically, my strategy is to solve for $S_{i+1}$ as a function of $S_1$ and some constants. Then to plug in $S_2, \ldots, S_{i+1}$ in the summation and solve for $S_1$ as a function of constants. Then I would obtain $S_{i+1}$ as a function of constants itself.

Thanks for any help.

Probability_density_normalization.mw

In this code I'm trying to separately normalize two independent probability densities and then combine them to get the joint probability density that's normalized and then use it to calculate the probability that the two variables are equal. fD(x) is a Gaussian divided by x^2 and fA(x) is a Gaussian. The first problem occurs when I'm checking the normalization of the joint probability density by doing the double integral over all space for fD(x)*fA(y)dxdy, I get weird vanishing number when the parameter "hartree" takes a certain value, namely 27.211. If I change hartree to 27 or 1 or 2 it all worked, but 27.211 is not good. Also later when I do a single integral over all space for fD(x)*fA(x)dx to get the probability that these two are equal, I find the result is dependent on hartree. This hartree thing is a unit conversion in my physical problem and in principle should not interfere with either the normalization or the probability result at all. I suspect this is a coding bug but I can't find what it is. I'd appreciate any input.

Thank you very much!

 

Edit: I found out that the problem with the double integral normalization may have something to do with the discretization for numerical evaluation of the integral, since if I change the lower bound to 1/hartree and upper to 10/hartree then it's fine, however if I use lower bound at 1/hartree and upper at 5/hartree it doesn't work, although the distribution has no value between 5/hartree and 10/hartree. However after this is fixed I still have the problem with the single integral over all space for fD(x)*fA(x)dx changing with hartree. Well as a probability I would expect the integral to be bound between 0 and 1, but since it almost linearly depends on hartree, at hartree around 27 I would get the integral value to be about 25, which doesn't make sense. In fact, I now suspect it is not Maple, but my calculation of the probability of the two random variables taking the same value is wrong, I'd appreciate it very much if someone can confirm this.

Integral.mw

Hi all

 

Please help me to solve this Integral...

 

 

 

phi := sin((1/4)*Pi*x)*(c__1*cosh((1/4)*Pi*y)+c__3*y*cosh(Pi/(4*y))+c__4*y*sinh((1/4)*Pi*y));

sin((1/4)*Pi*x)*(c__1*cosh((1/4)*Pi*y)+c__3*y*cosh((1/4)*Pi/y)+c__4*y*sinh((1/4)*Pi*y))

(1)

phi

sin((1/4)*Pi*x)*(c__1*cosh((1/4)*Pi*y)+c__3*y*cosh((1/4)*Pi/y)+c__4*y*sinh((1/4)*Pi*y))

(2)

diff((2), y);

sin((1/4)*Pi*x)*((1/4)*c__1*sinh((1/4)*Pi*y)*Pi+c__3*cosh((1/4)*Pi/y)-(1/4)*c__3*sinh((1/4)*Pi/y)*Pi/y+c__4*sinh((1/4)*Pi*y)+(1/4)*c__4*y*cosh((1/4)*Pi*y)*Pi)

(3)

diff((3), y);

sin((1/4)*Pi*x)*((1/16)*c__1*cosh((1/4)*Pi*y)*Pi^2+(1/16)*c__3*cosh((1/4)*Pi/y)*Pi^2/y^3+(1/2)*c__4*cosh((1/4)*Pi*y)*Pi+(1/16)*c__4*y*sinh((1/4)*Pi*y)*Pi^2)

(4)

phi

sin((1/4)*Pi*x)*(c__1*cosh((1/4)*Pi*y)+c__3*y*cosh((1/4)*Pi/y)+c__4*y*sinh((1/4)*Pi*y))

(5)

diff((5), x);

(1/4)*cos((1/4)*Pi*x)*Pi*(c__1*cosh((1/4)*Pi*y)+c__3*y*cosh((1/4)*Pi/y)+c__4*y*sinh((1/4)*Pi*y))

(6)

diff((6), x);

-(1/16)*sin((1/4)*Pi*x)*Pi^2*(c__1*cosh((1/4)*Pi*y)+c__3*y*cosh((1/4)*Pi/y)+c__4*y*sinh((1/4)*Pi*y))

(7)

phi

sin((1/4)*Pi*x)*(c__1*cosh((1/4)*Pi*y)+c__3*y*cosh((1/4)*Pi/y)+c__4*y*sinh((1/4)*Pi*y))

(8)

diff((8), x);

(1/4)*cos((1/4)*Pi*x)*Pi*(c__1*cosh((1/4)*Pi*y)+c__3*y*cosh((1/4)*Pi/y)+c__4*y*sinh((1/4)*Pi*y))

(9)

diff((9), y);

(1/4)*cos((1/4)*Pi*x)*Pi*((1/4)*c__1*sinh((1/4)*Pi*y)*Pi+c__3*cosh((1/4)*Pi/y)-(1/4)*c__3*sinh((1/4)*Pi/y)*Pi/y+c__4*sinh((1/4)*Pi*y)+(1/4)*c__4*y*cosh((1/4)*Pi*y)*Pi)

(10)

``

(11)

-(1/16)*Pi^2*sin((1/4)*Pi*x)*(c__1*cosh((1/4)*Pi*y)+c__3*y*cosh((1/4)*Pi/y)+c__4*y*sinh((1/4)*Pi*y))=0;

-(1/16)*Pi^2*sin((1/4)*Pi*x)*(c__1*cosh((1/4)*Pi*y)+c__3*y*cosh((1/4)*Pi/y)+c__4*y*sinh((1/4)*Pi*y)) = 0

(12)

eval( (12), [x = 0]);

0 = 0

(13)

-(1/16)*Pi^2*sin((1/4)*Pi*x)*(c__1*cosh((1/4)*Pi*y)+c__3*y*cosh((1/4)*Pi/y)+c__4*y*sinh((1/4)*Pi*y)) = 0

-(1/16)*Pi^2*sin((1/4)*Pi*x)*(c__1*cosh((1/4)*Pi*y)+c__3*y*cosh((1/4)*Pi/y)+c__4*y*sinh((1/4)*Pi*y)) = 0

(14)

eval( (14), [x = 20]);

0 = 0

(15)

sin((1/4)*Pi*x)*((1/16)*c__1*Pi^2*cosh((1/4)*Pi*y)+(1/16)*c__3*Pi^2*cosh((1/4)*Pi/y)/y^3+(1/2)*c__4*Pi*cosh((1/4)*Pi*y)+(1/16)*c__4*y*Pi^2*sinh((1/4)*Pi*y)) = 0

sin((1/4)*Pi*x)*((1/16)*c__1*Pi^2*cosh((1/4)*Pi*y)+(1/16)*c__3*Pi^2*cosh((1/4)*Pi/y)/y^3+(1/2)*c__4*Pi*cosh((1/4)*Pi*y)+(1/16)*c__4*y*Pi^2*sinh((1/4)*Pi*y)) = 0

(16)

eval( (16), [y = 9]);

sin((1/4)*Pi*x)*((1/16)*c__1*Pi^2*cosh((9/4)*Pi)+(1/11664)*c__3*Pi^2*cosh((1/36)*Pi)+(1/2)*c__4*Pi*cosh((9/4)*Pi)+(9/16)*c__4*Pi^2*sinh((9/4)*Pi)) = 0

(17)

evalf[5]( (17) );

sin(.78540*x)*(362.25*c__1+0.84938e-3*c__3+4182.6*c__4) = 0.

(18)

sin((1/4)*Pi*x)*((1/16)*c__1*Pi^2*cosh((1/4)*Pi*y)+(1/16)*c__3*Pi^2*cosh((1/4)*Pi/y)/y^3+(1/2)*c__4*Pi*cosh((1/4)*Pi*y)+(1/16)*c__4*y*Pi^2*sinh((1/4)*Pi*y)) = -sin((1/4)*pi*x);

sin((1/4)*Pi*x)*((1/16)*c__1*Pi^2*cosh((1/4)*Pi*y)+(1/16)*c__3*Pi^2*cosh((1/4)*Pi/y)/y^3+(1/2)*c__4*Pi*cosh((1/4)*Pi*y)+(1/16)*c__4*y*Pi^2*sinh((1/4)*Pi*y)) = -sin((1/4)*pi*x)

(19)

eval( (19), [y = -9]);

sin((1/4)*Pi*x)*((1/16)*c__1*Pi^2*cosh((9/4)*Pi)-(1/11664)*c__3*Pi^2*cosh((1/36)*Pi)+(1/2)*c__4*Pi*cosh((9/4)*Pi)+(9/16)*c__4*Pi^2*sinh((9/4)*Pi)) = -sin((1/4)*pi*x)

(20)

evalf[5]( (20) );

sin(.78540*x)*(362.25*c__1-0.84938e-3*c__3+4182.6*c__4) = -1.*sin(.25000*pi*x)

(21)

-(1/4)*cos((1/4)*Pi*x)*Pi*((1/4)*c__1*sinh((1/4)*Pi*y)*Pi+c__3*cosh((1/4)*Pi/y)-(1/4)*c__3*sinh((1/4)*Pi/y)*Pi/y+c__4*sinh((1/4)*Pi*y)+(1/4)*c__4*y*cosh((1/4)*Pi*y)*Pi) = 0

-(1/4)*cos((1/4)*Pi*x)*Pi*((1/4)*c__1*sinh((1/4)*Pi*y)*Pi+c__3*cosh((1/4)*Pi/y)-(1/4)*c__3*sinh((1/4)*Pi/y)*Pi/y+c__4*sinh((1/4)*Pi*y)+(1/4)*c__4*y*cosh((1/4)*Pi*y)*Pi) = 0

(22)

eval( (22), [y = 9]);

-(1/4)*cos((1/4)*Pi*x)*Pi*((1/4)*c__1*sinh((9/4)*Pi)*Pi+c__3*cosh((1/36)*Pi)-(1/36)*c__3*sinh((1/36)*Pi)*Pi+c__4*sinh((9/4)*Pi)+(9/4)*c__4*Pi*cosh((9/4)*Pi)) = 0

(23)

evalf[5]( (23) );

-.78540*cos(.78540*x)*(461.22*c__1+.99617*c__3+4738.2*c__4) = 0.

(24)

-(1/4)*cos((1/4)*Pi*x)*Pi*((1/4)*c__1*sinh((1/4)*Pi*y)*Pi+c__3*cosh((1/4)*Pi/y)-(1/4)*c__3*sinh((1/4)*Pi/y)*Pi/y+c__4*sinh((1/4)*Pi*y)+(1/4)*c__4*y*cosh((1/4)*Pi*y)*Pi) = 0;

-(1/4)*cos((1/4)*Pi*x)*Pi*((1/4)*c__1*sinh((1/4)*Pi*y)*Pi+c__3*cosh((1/4)*Pi/y)-(1/4)*c__3*sinh((1/4)*Pi/y)*Pi/y+c__4*sinh((1/4)*Pi*y)+(1/4)*c__4*y*cosh((1/4)*Pi*y)*Pi) = 0

(25)

eval( (25), [y = -9]);

-(1/4)*cos((1/4)*Pi*x)*Pi*(-(1/4)*c__1*sinh((9/4)*Pi)*Pi+c__3*cosh((1/36)*Pi)-(1/36)*c__3*sinh((1/36)*Pi)*Pi-c__4*sinh((9/4)*Pi)-(9/4)*c__4*Pi*cosh((9/4)*Pi)) = 0

(26)

evalf[5]( (26) );

-.78540*cos(.78540*x)*(-461.22*c__1+.99617*c__3-4738.2*c__4) = 0.

(27)

s:=solve({sin(.78540*x)*(362.25*c__1+0.84938e-3*c__3+4182.6*c__4) = 0,sin(.78540*x)*(362.25*c__1-0.84938e-3*c__3+4182.6*c__4) = -1.*sin(.25000*Pi*x),-.78540*cos(.78540*x)*(461.22*c__1+.99617*c__3+4738.2*c__4) = 0,-.78540*cos(.78540*x)*(-461.22*c__1+.99617*c__3-4738.2*c__4) = 0},{c1,c2,c3,c4});

{c__1 = 0., c__3 = 0., c__4 = 0., x = 0.}, {c__1 = -10.27318850*c__4, c__3 = 0., c__4 = c__4, x = 0.}, {c__1 = -11.54616977*c__4-0.1380262250e-2, c__3 = 588.6646731, c__4 = c__4, x = -1.999995323}, {c__1 = -11.54616977*c__4-0.1380262250e-2, c__3 = 588.6646731, c__4 = c__4, x = 1.999995323}

(28)

``

 

Download analytical_case_1.mw

Dear collegues

Hope you are fine

I wrote a code to solve a system of ODEs.

The code solve the problem for higher values of parameter NBT>=5. When I decrease it to NBT=0.2, the code didnt converge. I did my best but I couldnt get the results.

I would be most grateful if you help me at this problem

The code is attached

Thank you

Final_code.mw

 

Amir

Hello all! I've just learned about Maple. My English is not very good :( I write matrix A:=L*U program. If you know it, you will understand my mind. But I received "error" from Maple. Thanks for your viewing

A=LU.mw

My_Plot.mw

Hi all,

I want to plot This attached figure in Matlab. As we know the HeunT function is not defined in Matlab. Now I want to get all the three curves Data for plotting them in Matlab. I have asked this some days ago and I got it. But now I want to get data for three curves instead of one.

 

Please help me.

There have come unwanted lines and marks . I donot know how to remove them. Using doc.block, remove block seems to be little tough to incorporate! Please enlighten me. Modified doc. is most welcome. Thanks. Ramakrishnan V 

Gaussian Elimination Method

 

 

Given*the*equations

  restartreset:

with(Student[LinearAlgebra])``

(1)
Coefficient Tanle

Equation 1

Equation 2

Equation 3

Equations

`m__1,1` := 3:
`` 

`m__2,1` := 2:
``

`m__3,1` := 1:
``

`m__1,1`*x__1+`m__1,2`*y+`m__1,3`*z = `m__1,4`; = 3*x__1+y-z = 3

`m__2,1`*x__1+`m__2,2`*y+`m__2,3`*z = `m__2,4`; = 2*x__1-8*y+z = -5

```m__3,1`*x__1+`m__3,2`*y+`m__3,3`*z = `m__3,4`; = x__1-2*y+9*z = 8

The equations in matrix form is given by

Matrix([[3, 1, -1, 3], [2, -8, 1, -5], [1, -2, 9, 8]])

(2)

The Gaussian Elimination gives the simplified natrix equation as given below:

Matrix([[3, 1, -1, 3], [0, -26/3, 5/3, -7], [0, 0, 231/26, 231/26]])

(3)

``The equations in simplified form are:

3*x+y-z = 3

(4)

-(26/3)*y+(5/3)*z = -7

(5)

(231/26)*z = 231/26

(6)

``

The aolution ia obtained by solving the above equations in reverse order

{x = 1, y = 1, z = 1}

(7)

 

``

 

Download GausianFinal15Nov2015.mwGausianFinal15Nov2015.mw

hello eveyone! sorry, my English is not very good

I writed Neville algorithm

I want to creat a table(or a matrix) Q with

example:

f:=X->2^X;

with value of X: -2,1,0,1,2

-2   1/4

-1    1/2

0    1

1    2

2     4

I want to approximate f at x=0.5 by Neville

then:   for i:=2,...,n   (that case is 5)

             for j:=2,...i

 

                  Q[i,j]=(x-X[i-j])*Q[i,j-1]-(x-X[i])*Q[i-1,j-1])/(X[i]-X[i-j])

       output(Q)

this is:

-2  1/4     0       0            0          0

-1  1/2     0.875  0           0           0

0  1         1.25   1.3475    0           0

1  2         1.5    1.4375   1.421875  0

2  4         1      1.375      1.40625  1.412109375


do you understand my mind? sorry, my English is not very good

Regards

   sunflower

hi all

i have a complex numeric like s. 

how can i calculate s

There are the complexes (C), quaternions (H or Q), octionions (O), sedenions (S) and the pathions (P). I have found the multiplication tables of them, although according to signs (+ or -) there differents at pathions. The important question is that How can I multiply two bases, i_n and i_m of higher dimensions, like in the routions or in the voudions?

Should I xor the indexes of the bases? Like this way: i_1 * i_2 = i_(1^2) = i_3

What is about the signs?

First 1202 1203 1204 1205 1206 1207 1208 Last Page 1204 of 2428