MaplePrimes Questions

How can I convert sinh(x)/cosh(x) to tanh(x) ?

One of the most difficult/nice tasks from my collection of old problems:
Calculate Int(from 0 to 1)Int(from 0 to 1)[1/(1-x*y)]dxdy .

Hi,

I am looking to design a learning sequence on the applications of integral calculus (arc length, area under the curve, solid of revolution). The animation of the solid is not optimal because I want to display the revolution over [1,2] while maintaining a global view of the curve over [-3,3]. Thank you for your insights.

 

S7_Arc_Intégrale_Animation.mw

i try find some part of solution of this kind of pde but i can't get results my openion is maybe this pde is wronge when i defined 

pde.mw

Let eps be a real number greater than zero. Calculate the limit lim(x-->oo)[x^(1-eps)*Integral(from x to x+1) sin(t^2)dt] .

 Why you delete my question  most of my equation are same but demand of the questions are different, i can make a 100 account and each time i asked by one of them, and right now most of my question taged like they dublicated but they are don't ، i am not jobles and sick to post a dublicate question, You started a riot.

my solution is a little bit long which when i click on pdetest command i wait at least more than a hour but still is runing and i don't get any result and not give me error , which i don't know my result is true or not so How i can find that my pde by this solution it will be zero or not ?

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

declare(u(x, y, t))

u(x, y, t)*`will now be displayed as`*u

(2)

declare(f(x, y, t))

f(x, y, t)*`will now be displayed as`*f

(3)

pde := diff(u(x, y, t), t)-(diff(diff(u(x, y, t), `$`(x, 4))+5*u(x, y, t)*(diff(u(x, y, t), `$`(x, 2)))+(5/3)*u(x, y, t)^3+5*(diff(u(x, y, t), x, y)), x))-5*u(x, y, t)*(diff(u(x, y, t), y))+5*(int(diff(u(x, y, t), `$`(y, 2)), x))-5*(diff(u(x, y, t), x))*(int(diff(u(x, y, t), y), x))

diff(u(x, y, t), t)-(diff(diff(diff(diff(diff(u(x, y, t), x), x), x), x), x))-5*(diff(u(x, y, t), x))*(diff(diff(u(x, y, t), x), x))-5*u(x, y, t)*(diff(diff(diff(u(x, y, t), x), x), x))-5*u(x, y, t)^2*(diff(u(x, y, t), x))-5*(diff(diff(diff(u(x, y, t), x), x), y))-5*u(x, y, t)*(diff(u(x, y, t), y))+5*(int(diff(diff(u(x, y, t), y), y), x))-5*(diff(u(x, y, t), x))*(int(diff(u(x, y, t), y), x))

(4)

pde_nonlinear, pde_linear := selectremove(proc (term) options operator, arrow; has((eval(term, u(x, y, t) = a*u(x, y, t)))/a, a) end proc, pde)

-5*(diff(u(x, y, t), x))*(diff(diff(u(x, y, t), x), x))-5*u(x, y, t)*(diff(diff(diff(u(x, y, t), x), x), x))-5*u(x, y, t)^2*(diff(u(x, y, t), x))-5*u(x, y, t)*(diff(u(x, y, t), y))-5*(diff(u(x, y, t), x))*(int(diff(u(x, y, t), y), x)), diff(u(x, y, t), t)-(diff(diff(diff(diff(diff(u(x, y, t), x), x), x), x), x))-5*(diff(diff(diff(u(x, y, t), x), x), y))+5*(int(diff(diff(u(x, y, t), y), y), x))

(5)

thetai := t*w[i]+y*p[i]+x

t*w[i]+y*p[i]+x

(6)

eqw := w[i] = -5*p[i]^2

w[i] = -5*p[i]^2

(7)

Bij := proc (i, j) options operator, arrow; (-6*p[i]-6*p[j])/(p[i]-p[j])^2 end proc

proc (i, j) options operator, arrow; (-6*p[i]-6*p[j])/(p[i]-p[j])^2 end proc

(8)

NULL

theta1 := normal(eval(eval(thetai, eqw), i = 1)); theta2 := normal(eval(eval(thetai, eqw), i = 2))

-5*t*p[1]^2+y*p[1]+x

 

-5*t*p[2]^2+y*p[2]+x

(9)

eqf := f(x, y, t) = (-5*t*p[1]^2+y*p[1]+x)*(-5*t*p[2]^2+y*p[2]+x)-(6*(p[1]+p[2]))/(p[1]-p[2])^2

f(x, y, t) = (-5*t*p[1]^2+y*p[1]+x)*(-5*t*p[2]^2+y*p[2]+x)-6*(p[1]+p[2])/(p[1]-p[2])^2

(10)

eq17 := u(x, y, t) = 6*(diff(diff(f(x, y, t), x), x))/f(x, y, t)-6*(diff(f(x, y, t), x))^2/f(x, y, t)^2

u(x, y, t) = 6*(diff(diff(f(x, y, t), x), x))/f(x, y, t)-6*(diff(f(x, y, t), x))^2/f(x, y, t)^2

(11)

eqt := eval(eq17, eqf)

u(x, y, t) = 12/((-5*t*p[1]^2+y*p[1]+x)*(-5*t*p[2]^2+y*p[2]+x)-6*(p[1]+p[2])/(p[1]-p[2])^2)-6*(-5*t*p[1]^2-5*t*p[2]^2+y*p[1]+y*p[2]+2*x)^2/((-5*t*p[1]^2+y*p[1]+x)*(-5*t*p[2]^2+y*p[2]+x)-6*(p[1]+p[2])/(p[1]-p[2])^2)^2

(12)

``

pdetest(eqt, pde)

NULL

Download test.mw

Hi,

I'm looking to animate the Riemann sum only on the interval [0,2], while keeping a global view of the curve (G). I tried the background option, but without success. Any ideas? Thanks!

S7_Riemann_Animation_Aire.mw

Hi. How to plot the 2d output like this? I don't know how to declare "a" and "b" random constant?
The pair of equations x = a and y = b graphically represents lines which  are, a. parallel , b. intersecting at (b, a), c. coincident, d.  intersecting at (a, b)

a := (rand(3 .. 4))(); b := (rand(0 .. 3))(); plot(x = a); plot(y = b)

3

 

2

 

Error, (in plot) unexpected option: x = 3

 

Error, (in plot) unexpected option: y = 2

 
 

``

Download x=a_y=b_plot.mw

In a procedure what is the way to only allow specific values in a variable?

ie/

change:=proc(a::integer, b={10,20,30})#only values 10, 20 and 30 allowed for variable b
  a*b;
end proc:

Trying to find a formula such that when n is negative the value is +1 and when n is positive the value is 0, without using an if statement. 

The square grid is given in the Euclidean plane. All grid points therefore have integer coordinates. Investigate whether there are three points in this grid plane that form an equilateral triangle.

Consider the following:

MyTableElement1 := proc(L::list(nonnegint))
  ## L will have only two elements
  local M, x, y;
  M:=L;
  x:=convert(M[1],string);
  y:=convert(M[2],string);

  return cat("\\begin{tabular}{c} ",x," \\\\ ",y," \\end{tabular}")

end;

MyTableElement1([2,3]);

will output

"\begin{tabular}{c} 2 \\ 3 \end{tabular}"

as desired. However, if one inserts an \hline into the table,

MyTableElement2 := proc(L::list(nonnegint))
  ## L will have only two elements
  local M, x, y;
  M:=L;
  x:=convert(M[1],string);
  y:=convert(M[2],string);

  return cat("\\begin{tabular}{c} ",x," \\\\ \\hline ",y," \\end{tabular}")

end;

will output

"\begin{tabular}{c} 2 \\ \hline 3 \end{tabular}"

again as desired. However, if I copy and paste this int a document, I get

"\begin{tabular}{c} 2 \\ hline 3 \end{tabular}".

Note that \hline is now just hline. Putting "\\\\" in front of the hline outputs

"\begin{tabular}{c} 2 \\ \\hline 3 \end{tabular}",

but this does not compile properly. How can I get a proper \hline command to appear in the table? Thank uou for your consideration.

 Can I solve the Tolman-Oppenheimer-Volkoff equation with Maple ?  I'm having trouble with Einstein's equation with the energy tensor as the second member


Let's suppose I define a procedure P which uses a Maple built-in procedure BP.
BP is a procedure which uses optional parameters, let's say a and b.

I would like to call P with the same optional parameter names than BP, that is to write something like this

P := proc(....., {a::a_type:=a:-default, b::b-type:=b_default)
       ....
       BP(...., 'a'=a, 'b'=b)
     end proc.

The execution of P(..., a=1) leads to the error unexpected option: 1=1
 

A workaround is to define P this way

P := proc(....., {P_a::a_type:=a_default, P_b::b-type:=b_default)
       ....
       BP(...., a = P_a, b = P_b)
     end proc.

# example

P(..., P_a=1, P_b="yes")

This works but it would be easier for the users to use the same option names in the definition of P than in the definition of BP.

Question: Is that possible?

Here is an illustrative example where I would prefer to write

ecdf(S, color="red", thickness=3)

instead of

ecdf(S, ecdf_color="red", ecdf_thickness=3)


 

restart

ecdf := proc(S, {ecdf_color::string:="blue", ecdf_thickness::posint:=1})
  local N   := numelems(S):
  local M   := sort(S):
  local opt := [color=ecdf_color, thickness=ecdf_thickness]:
  plots:-display(
    plot([ seq(op([[M[i], (i-1)/N], [M[i], i/N], [M[i+1], i/N]]), i=1..N-1) ], opt[])
    , plot([ [M[N], (N-1)/N], [M[N], 1] ], opt[])
    , plot([ [M[N], 1], [(max+(max-min)*0.2)(S), 1] ], opt[], linestyle=3)
    , plot([ [M[1], 0], [(min-(max-min)*0.2)(S), 0] ], opt[], linestyle=3)
  )
end proc:

S := Statistics:-Sample(Uniform(0, 1), 10):
ecdf(S)

 

ecdf(S, ecdf_color="red", ecdf_thickness=3)

 

 


 

Download ecdf.mw


Thanks in advance

 

First 29 30 31 32 33 34 35 Last Page 31 of 2425