MaplePrimes Questions

Please write a Maple procedure called Position which retures the position i of an element x in a list L

That is, Position should return an integer i>0 such that L[i]=x. If x is not in list L,0 is returned..

 

i found command i may need to use 

proc(), do end do ,member(e, a,'p'), if then elif, end proc, 

 

can anyone help with this?  it may be a too elementary question to ask here .....and i know

 beginner 

I tried to get the maximum and minimum values of the following function. From the plot I get them but its not accurate. Please advise me to get them accurate.

 

F:=0.85:B:=0.5:

K:=N->(N*(1+F*N/(N^2+B^2-F*N)));

 

implicitplot(((N^2+B^2-F*N)*K=N*(N^2+B^2-F*N+F*N),K=0..10,N=0..10,view=[0..5,0..4],numpoints=90000,axes=boxed,thickness=2,color=black,font=[1,1,20],tickmarks=[3, 3],linestyle=1));

 

This is just a question on terminology. The name "combine" implies pulling terms together. Yet, when applied to something like sin(x)^2 it has the effect of expanding it:

r:=sin(x)^2;
combine(r);

 

Which seems counter-intutive to me. I tried first expand(r) but that did not expand it.

Fyi, in Mathematica the function to do the above is called

Sin[x]^2;
TrigReduce[%]

    1/2 (1 - Cos[2 x])

As Mathematica does not have a Combine[] function.

So, I am just wondering about the naming, that is all. I would never have thought first that a command called combine() will expand sin(x)^2.

 

 

How can i sort like below? i want to sort x dependent y is fixed 

 

Original case          sorted case

x   y                         x(i)   y[]

2   1                         1      4

3   2                         2      1

5   3                         3      2

1   4                         4      5

4   5                         5      3

i want to plot the region D={(x,y)|0<=x<=1,0<=y<=1-x} in a 2d plot. how to i do this in the most possible way?

 

i know im supposed to use with(plots) and then implicitplot() but i cant seem to get it right...

 

 

any help is appreciated :)

diff(sin(x)^2,x$n); # Maple fails

# then I tried:

combine(sin(x)^2);diff(%,x$n);

# this works, but Maple should drop the pochhammer term (derivation of a constant)

 

What is the reasoning behind the output?

Hello everyone, I am trying to solve  a differential equation with one extra boundary condition.

restart:with(plots):

Eq:= diff(f(y),y$3)+f(y)*diff(f(y),y$2)-diff(f(y),y$1)^2-(diff(f(y),y$1)+y/2*diff(f(y),y$2))=0;

bc:=D(f)(0)=1,f(0)=0,(D@@2)(f)(b)=0, f(b)=b/2;

With the arbitrary trial values, the integrated solutions will generally not satisfy the outer boundary conditions.

(D@@2)(f)(b)=0, f(b)=b/2. 

I need find a way to adjust the two trial values such that the numerical solution eventually matched

the required boundary conditions.

 

Thanks

 

Good afternoon sir.

 

I request your kind suggestion to the above cited question.

 

 

With thanks & Regards

 

M.Anand

Assistant Professor in Mathematics

SR International Institute of Technology,

Hyderabad, Andhra Pradesh, INDIA.

Hello, Suppose I have two sinusoids with the same amplitude and frequency. By changing the phase of one of them it is possible to 'align' them. When the phases are exactly the same the difference between the two sinusoids becomes zero. Now lets define a variable (U[int]) that gives a measure of the difference between the two sinusoids and change the phase phi to generate an animation and 3D plot and see if it is possible to mathematically determine that the difference becomes zero when the phases of the waveforms are equal. Chosing a time t>0 and solving for the derivative does the job.

My question is, can (and how can) Maple determine for which phase phi we have the minimum function without chosing a time t.
 

restart

with(plots):

u[G] := sin(omega*t)

u[L] := sin(omega*t+phi)

U[int] := int((u[G]-u[L])^2, t)+C

C := solve(subs(t = 0, U[int]) = 0, C)

omega := 9:

animate(plot, [[u[G], u[L], (1/10)*U[int]], t = 0 .. 2, legend = ["Public grid voltage", "Local grid voltage (control goal)", "Cum. Actuator voltage (scaled)"]], phi = -Pi .. Pi, gridlines = true, labels = ["Time [s]","Voltage [V]"], labeldirections = ["horizontal", "vertical"], labelfont = ["ARIAL", "bold", 12])

plot3d(U[int], t = 0 .. 2, phi = -Pi .. Pi, shading = zhue, orientation = [-150, 70, 15])

t := 1:

phi = fsolve(diff(U[int], phi))


Download 20131114_Finding_min.mw

 

Thanks a lot!

Hi there,

i want to generate some plots in files in this example:


this code doesn't work. but without restart; it works fine. i passed 2 days to figure out that "restart;" was the problem.

my questions are :

1. why i have to eliminate the first line of restart;

2. how can i save my files in a directory that is in the current directory. For example i have a directory in current directory named "plotFILES".

thanks in advance for your help

Hi,

I have a Matrix whose entries are polynomials in several formal parameters (the matrix is sparse and the polynomials are rather simple, though inverses of the parameters may also arise).
Then, when I compute the kernel with LinearAlgebra-NullSpace, maple naturally gives a basis of solutions over the same ring of polynomials.

Now for some reason there are some parameters that I don't want to see in the solutions (all but two of them, actually).

How can I compute the part of the kernel that lives in $\mathbb{Z}[a,a^{-1}, b,b^{-1}]$, i.e. that involves only the first two parameters?

Thank you,

NoThik

Edit : the coefficients of the polynomials are integers, and I expect the kernel elements to have integer coefficients as well.

Find the Fourier Series for the function f(x) defined as follows, and compare the graphs of some truncated Fourier series (try 1,2,3,5,6,30, terms) with the graph of f(x).

 

f(x)= min(|x|, pi/2), -pi less than or equal to x less than or equal to pi.

 

Also, let f(x) be periodic with a period of 2*pi. Thanks.

Hey, I have some data points:

 

I than entered:

X := Data[() .. (), 1];
Y := Data[() .. (), 2];
f := a+b*x^c+d*x^e;
Statistics:-NonlinearFit(f, X, Y, x);
 and when I entered Statistics:-NonlinearFit(f, X, Y, x);, It wouldn't output anything.

I am using maple 17 and I was trying to run a nested loop as shown below. I expected to get all combinations of i and j (9 components). But i and j always remain 3. What is the problem here? Can anyone suggest alternate solutions? I dont understand in which order maple increments i,j or k in each loop.

 

for k to 9 do

      for i to 3 do

          for j to 3 do

          a[k] := i, j

          end do

      end do

end do;

 

table([1=(3,3),2=(3,3),3=(3,3),4=(3,3),5=(3,3),6=(3,3),7=(3,3),9=(3,3),9=(3,3)

 

Thanks in advance

Hello,

I would like to make the operator L (factorization)

in the form

Thank you for your answer.

 

First 1511 1512 1513 1514 1515 1516 1517 Last Page 1513 of 2434