MaplePrimes Questions

restart;
PDEtools[declare](f(x), prime = x);
N := 4;
f(x) :=  sum(p^i*f[i](x), i = 0..N):
HPMEq := (1 - p)*diff(f(x), x $ 3) + p*(diff(f(x), x $ 3) + 1/2*diff(f(x), x, x)*f(x));
for i from 0 to N do
    equ[1][i] := coeff(HPMEq, p, i) = 0;
end do;
cond[1][0] := f[0](0) = 0, D(f[0])(0) = 0, D(f[0])(5) = 1

for j to N do
    cond[1][j] := f[j](0) = 0, D(f[j])(0) = 0, D(f[j])(5) = 0;
end do

for i from 0 to N do
    dsolve({cond[1][i], equ[1][i]}, f[i](x));
    f[i](x) := rhs(%);
end do;
f(x) := evalf(simplify(sum(f[n](x), n = 0 .. N)))

convert(f(x), 'rational')

subs(x = 2.4, diff(f(x), x))

How to sort a matrix based on one particular column in that matrix

 

Matrix ([[21,30],[8,4]]).  Has to sorted on column one only and output. Matrix ([[8,4],[21,30]]). In this I have given only 2×2  it could be a n×n

Without too much code

 

 

Is it  possible to draw an ellipse inscribled in a given triangle and we know its orthoptist circle ? Thank you very much.

Prime_Derivative_Notation_for_Explicit_X_Values.mwPrime_Derivative_Notation_for_Explicit_X_Values.mw

## I hope this works. I can't seem to paste my MW file in this window in a readable format.

 

This is the Maple code

restart;
result:=int(1/tanh(u),u)

simplify(result,size) ;
simplify(result,symbolic);
simplify(result,ln);
simplify(result,trig);

Any suggestions?

 

 

How to find a rational function with give horizontal asymptotes: y=0.7, y=-0.7 and vertical asymptotes: x=0.001, x=-0.001?

Hello

I have a list with a large number of elements and I need to partition it in chunks of a specific size.  Here is my attempt

listpart := proc(cond::list,nchunk::nonnegint:=1000)
if numelems(cond) < nchunk then
	newcond:=[cond]:
else
	ss:=[`$`(1..numelems(cond))]:
	sss:=map(`mod`,ss,nchunk):
	ind:=[ListTools:-SearchAll(0,sss)]:
	ind:=[0,op(ind),ifelse(ss[numelems(ss)]=ind[numelems(ind)],[],ss[numelems(ss)])]:
	newcond:=[Threads:-Seq(cond[(ind[j]+1)..ind[j+1]],j=1..(numelems(ind)-1))];
end if:
return(newcond):
end proc:

It does not run as fast as I thought.  I am not even sure if Threads:-Seq could be used in this case.  Please tell me what I am doing wrong and how I can modify the code to get a faster response.  

Many thanks

Ed

 

Hello all

could anyone tell how to solve following nonliner equations numerically.

f '''' - c1(g'') + R(f ' f '' - f f ''' )=0

g'' + c2(f '' -2g) -c3(f g' - f ' g)=0

f ' (-1)=0,   f ' (1)=0,   f(-1)=1-A, F(1) =1, g(-1)=0, g(1)=0

c1=3.2, c2=3.3, c3=3.4, R= -10 and A=1.6 are constants.   

please help to find solution  numerically and how to plot. 

Thanks in advence

 

Hello,

I am trying to calculate an integral involving dirac delta as given below

int(Dirac(sin(x)),x=-3/2*Pi..3/2*Pi)

However, Maple returns the integral unevaluated as

int(Dirac(sin(x)),x=-3/2*Pi..3/2*Pi)

How can I get it evaluated? the result should be 3 here.

Thanks in advance.

I try to make a procedure for this 

Was it by a example of Riemann sum that  x-values in a array are stored for  numerical value, but in this task it seems that the array must be filled with the symbol x1,x2 , etc 

Should this be needed ?

 

blz64.pdf

blz_65.pdf

excset  3  task4

 

Was it first for a partition about a interval ( example Riemannn sum) that i got  a list of numeric values

 a:= 0: b:= 5: N:= 30: i= 0..N :

X:= Array(0..N, [seq(j, j=a..b, (b-a)/N)]);

Array(%id = 18446745862042054398)

(1)

Now i want  to get a list  of  x-values in Array X ,  starting from  0  to N  :

example: array X =[x0= 0, x1=1/6, ...]

x[i]:= a+(b-a)*i/N; # for i = 0..N # endpoints subintervals

Error, invalid terms in product: 0 .. 30

 

# generate X-values for interval [a,b]

X:= Array(0..N, [seq(j, j=a..b, x[i])]);

Error, invalid input: seq expects its 3rd argument, step, to be of type numeric, but received x[i]

 

 

the values  x1,x2....stored  in Array X are used in further calulations
If there is a need for naming x1= 0 , x2= ..  in the Array A ? , probably not .

 


 

Download vraag_excset3_task_4.mw

  

I can't figure out how Maple obtained this solution and looking for some ideas to try.

It is first order non-linear ode in y(x), which is separable.

ode:=diff(y(x),x)=x*ln(y(x));
dsolve([ode,y(1)=1],y(x))

But the general solution is

sol:=dsolve(ode)

Setting up manually an equation using the given condition in order to solve for _C1, produces no solution. 

eq:=subs([y(x)=1,x=1],sol);
solve(eq,_C1)

Warning, solutions may have been lost
 

Also 

coulditbe(exp(RootOf(1 + 2*Ei(1, -_Z) + 2*_C1))=1)

   FAIL

So how did Maple solve for the constant of integration which results in particular solution y(x)=1 that is supposed to satisfy the condition y(1)=1?  

It is clear that y(x)=1 satisfies the ODE itself. But I am asking about how it also satisfies y(1)=1

(odetst says it does satisfy the ODE and condition as well. So Maple must have done something very smart under the cover)

Next I tried

ode:=diff(y(x),x)=x*ln(y(x));
sol:=dsolve(ode,y(x));
sol:=DEtools:-remove_RootOf(sol);
sol:=subs([y(x)=1,x=1],sol)

And now

solve(sol,_C1)

Error, (in Ei) numeric exception: division by zero
 

Just wondering how did Maple decide that y(x)=1 satisfies y(1)=1? I do not see it.

Using Maple 2020.1. But same result on Maple 2019

Hi,

How to display only trigonometric values ( like 0,Pi/6,Pi/3..)  of the parameter alpha in the Explore Command?

Thanks

 

ROTATIONConiquesEllipseAnimation.mw

Hi , 

i want to find simple equation of rotate Ellipse  ( El1,EL2,El3 in the  worksheet), with calssic formula 

Ideas? Thanks

QuestionConiqueRotation.mw

Etude d'un cas particulier a := 5: b := 7: k := 9: A := [a, 0]: B := [0, b]: #A et B fixes P := [t, 0]: Q := [0, k/t]:#P et Q 2 points mobiles cir := -a*x-b*y+x^2+y^2 = 0: sol := solve(subs(y = 5, cir), x): cen := [solve(diff(cir, x)), solve(diff(cir, y))]: x0 := sol[1]: y0 := 5: M := [x0, y0]: R := sqrt(cen[1]^2+cen[2]^2): beta := arctan(diff(solve(EQ(M, cen), y), x)): Recherche des valeurs de t pour que les 2 droites soient perpendiculaires eq := t^2*(y0-b)+t*(a*b-a*y0+b*x0-k)-x0*(a*b-k) = 0; sol := solve(eq, t); t := sol[1]; tp := sol[2]; P1 := [t, 0]; Q1 := [0, k/t]; PQ1 := simplify(x*(-a*b+b*t+k)+y*t*(t-a)-t*(-a*b+b*t+k)) = 0:#1ere tangente PQ2 := simplify(x*(-a*b+b*tp+k)+y*tp*(tp-a)-tp*(-a*b+b*tp+k)) = 0:#2ième tangente P2 := [tp, 0]; Q2 := [0, k/tp]; CIR := implicitplot(cir, x = -4 .. 8, y = -4 .. 12, color = red); Fig := proc (alpha) local Dr1, DR1, Dr2, DR2, N, u0, v0, Po, t, tp, sol; global a, b, k, cen, R; u0 := cen[1]+R*cos(alpha); v0 := cen[2]+R*sin(alpha); N := [u0, v0]; sol := solve(t^2*(v0-b)+t*(b*u0-a*v0+a*b-k)-u0*(a*b-k) = 0, t); t := sol[1]; tp := sol[2]; Dr1 := simplify(x*(-a*b+b*t+k)+y*t*(t-a)-t*(-a*b+b*t+k)) = 0; DR1 := implicitplot(Dr1, x = -4 .. 8, y = -4 .. 12, color = brown); Dr2 := simplify(x*(-a*b+b*tp+k)+y*tp*(tp-a)-tp*(-a*b+b*tp+k)) = 0; DR2 := implicitplot(Dr2, x = -4 .. 8, y = -4 .. 12, color = pink); Po := pointplot([N[]], symbol = solidcircle, color = [black], symbolsize = 8); display([Po, DR1, DR2]) end proc; DrPQ1 := implicitplot(PQ1, x = -4 .. 22, y = -4 .. 12, color = blue); DrPQ2 := implicitplot(PQ2, x = -4 .. 22, y = -4 .. 12, color = blue); Points := pointplot([A[], B[], M[], P1[], P2[], Q1[], Q2[], cen[]], symbol = solidcircle, color = [green], symbolsize = 10); T := plots:-textplot([[A[], "A"], [B[], "B"], [M[], "M"], [P1[], "P1"], [P2[], "P2"], [Q1[], "Q1"], [Q2[], "Q2"], [cen[], "cen"]], font = [times, 10], align = {below, left}); n := 19; display([seq(Fig(2*i*Pi/n), i = 0 .. n), Fig(beta), CIR, DrPQ1, DrPQ2, Points, T], scaling = constrained, size = [500, 500]); I would find out the focus of the ellipse. Thank you.

How I can change this solution or remove the RootOf, because i have to show variables and params in this solutions.
 

restart

with(linalg)

f1 := alpha*x*(1-x/N)-beta[1]*sqrt(x)*y1/(1+h[1]*beta[1]*sqrt(x))-beta[2]*sqrt(x)*y2/(1+h[2]*beta[2]*sqrt(x))-d*E*x

f2 := -omega[1]*y1+Mu[1]*beta[1]*sqrt(x)*y1*(1-y1/(beta[1]*sqrt(x)))/(1+h[1]*beta[1]*sqrt(x))

f3 := -omega[2]*y2+Mu[2]*beta[2]*sqrt(x)*y2*(1-y2/(beta[2]*sqrt(x)))/(1+h[2]*beta[2]*sqrt(x))

T := solve({f1, f2, f3}, [x, y1, y2])

[[x = -N*(E*d-alpha)/alpha, y1 = 0, y2 = 0], [x = RootOf(alpha*beta[2]*Mu[2]*h[2]*_Z^4+alpha*Mu[2]*_Z^3+(E*N*d*Mu[2]*beta[2]*h[2]-N*alpha*Mu[2]*beta[2]*h[2])*_Z^2+(-N*beta[2]^2*h[2]*omega[2]+E*N*d*Mu[2]+N*Mu[2]*beta[2]^2-N*alpha*Mu[2])*_Z-N*omega[2]*beta[2])^2, y1 = 0, y2 = -(RootOf(alpha*beta[2]*Mu[2]*h[2]*_Z^4+alpha*Mu[2]*_Z^3+(E*N*d*Mu[2]*beta[2]*h[2]-N*alpha*Mu[2]*beta[2]*h[2])*_Z^2+(-N*beta[2]^2*h[2]*omega[2]+E*N*d*Mu[2]+N*Mu[2]*beta[2]^2-N*alpha*Mu[2])*_Z-N*omega[2]*beta[2])*omega[2]*beta[2]*h[2]-RootOf(alpha*beta[2]*Mu[2]*h[2]*_Z^4+alpha*Mu[2]*_Z^3+(E*N*d*Mu[2]*beta[2]*h[2]-N*alpha*Mu[2]*beta[2]*h[2])*_Z^2+(-N*beta[2]^2*h[2]*omega[2]+E*N*d*Mu[2]+N*Mu[2]*beta[2]^2-N*alpha*Mu[2])*_Z-N*omega[2]*beta[2])*beta[2]*Mu[2]+omega[2])/Mu[2]], [x = RootOf(alpha*beta[1]*Mu[1]*h[1]*_Z^4+alpha*Mu[1]*_Z^3+(E*N*d*Mu[1]*beta[1]*h[1]-N*alpha*Mu[1]*beta[1]*h[1])*_Z^2+(-N*beta[1]^2*h[1]*omega[1]+E*N*d*Mu[1]+N*Mu[1]*beta[1]^2-N*alpha*Mu[1])*_Z-N*omega[1]*beta[1])^2, y1 = -(RootOf(alpha*beta[1]*Mu[1]*h[1]*_Z^4+alpha*Mu[1]*_Z^3+(E*N*d*Mu[1]*beta[1]*h[1]-N*alpha*Mu[1]*beta[1]*h[1])*_Z^2+(-N*beta[1]^2*h[1]*omega[1]+E*N*d*Mu[1]+N*Mu[1]*beta[1]^2-N*alpha*Mu[1])*_Z-N*omega[1]*beta[1])*omega[1]*beta[1]*h[1]-RootOf(alpha*beta[1]*Mu[1]*h[1]*_Z^4+alpha*Mu[1]*_Z^3+(E*N*d*Mu[1]*beta[1]*h[1]-N*alpha*Mu[1]*beta[1]*h[1])*_Z^2+(-N*beta[1]^2*h[1]*omega[1]+E*N*d*Mu[1]+N*Mu[1]*beta[1]^2-N*alpha*Mu[1])*_Z-N*omega[1]*beta[1])*beta[1]*Mu[1]+omega[1])/Mu[1], y2 = 0], [x = RootOf(alpha*beta[2]*beta[1]*Mu[2]*Mu[1]*h[2]*h[1]*_Z^5+(alpha*Mu[1]*Mu[2]*beta[1]*h[1]+alpha*Mu[1]*Mu[2]*beta[2]*h[2])*_Z^4+(E*N*d*Mu[1]*Mu[2]*beta[1]*beta[2]*h[1]*h[2]-N*alpha*Mu[1]*Mu[2]*beta[1]*beta[2]*h[1]*h[2]+alpha*Mu[1]*Mu[2])*_Z^3+(-N*Mu[1]*beta[1]*beta[2]^2*h[1]*h[2]*omega[2]-N*Mu[2]*beta[1]^2*beta[2]*h[1]*h[2]*omega[1]+E*N*d*Mu[1]*Mu[2]*beta[1]*h[1]+E*N*d*Mu[1]*Mu[2]*beta[2]*h[2]+N*Mu[1]*Mu[2]*beta[1]^2*beta[2]*h[2]+N*Mu[1]*Mu[2]*beta[1]*beta[2]^2*h[1]-N*alpha*Mu[1]*Mu[2]*beta[1]*h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ta[1]*beta[2]^2*h[1]-N*alpha*Mu[1]*Mu[2]*beta[1]*h[1]-N*alpha*Mu[1]*Mu[2]*beta[2]*h[2])*_Z^2+(-N*Mu[1]*beta[1]*beta[2]*h[1]*omega[2]-N*Mu[1]*beta[2]^2*h[2]*omega[2]-N*Mu[2]*beta[1]^2*h[1]*omega[1]-N*Mu[2]*beta[1]*beta[2]*h[2]*omega[1]+E*N*d*Mu[1]*Mu[2]+N*Mu[1]*Mu[2]*beta[1]^2+N*Mu[1]*Mu[2]*beta[2]^2-N*alpha*Mu[1]*Mu[2])*_Z-N*omega[2]*beta[2]*Mu[1]-N*omega[1]*beta[1]*Mu[2])*beta[2]*Mu[2]-omega[2])/Mu[2]]]

(1)

NULL

NULL


 

Download titikkesetimbangan.mw

First 536 537 538 539 540 541 542 Last Page 538 of 2428