MaplePrimes Questions

Hi there,

 

I'm currently trying to work with combinations where I need to be able to retrieve a list of possible combinations, although i do not actually need to see the output but use it for a later part of programming.

Unfortunately, I get an error message such as the one in the title of this question. 

It seems to me that maple is unable to allocate enough memory to evaluate the problem. I'm not familiar with any way to refine the programming.

are there any possible workarounds for this issue?

 

 

Hello,

I was trying to simplify an expression using assume. However, I ended up with very long evaluation time and got an error: "Error, (in type/complex) too many levels of recursion". Here is the case:

Consider the following code:

restart:with(Physics):
simplify(csgn(a-b),assume=[a::real,b::real, a>0,b>0,a>b])

this gives 1 as expected.

However, if I run the following code:

restart:with(Physics):
simplify(csgn(a-b[2]),assume=[a::real,b[2]::real, a>0,b[2]>0,a>b[2]])

I get an error ""Error, (in type/complex) too many levels of recursion" after along evaluation. The last condition a>b[2] is causing the along evaluation time. Without it I get, of course, signum(a-b[2]), which is fine. 

If I do these tests without Physics package loaded, I get the result 1 immediately in both cases without any problem. So, something in Physics package is causing this problem. 

What is the problem? and how can I resolve this issue?

Thank you in advance.

 

Hello everyone, I wondered if there is a way to plot the solution for a DE using the DEplot command but at the same time show the graph of another function (explicit or implicit) that is not a solution of the DE itself. Is that possible?

I have this two expresions

e1 := (1/2)*P[psi]^2/(cos(`ϑ`)^2*Ix)

e2 := (1/2)*P[psi]^2/(cos(`ϑ`)^2*Ix)

simplify(e1-e2)=-(1/2)*(-P[psi]^2+P[psi]^2)/(cos(`ϑ`)^2*Ix)

but 

simplify(-P[psi]^2+P[psi]^2)

is zero 

why i dont obtain zero if i use simplify(e1-e2) ??

Download MHD1.mw

 

 

System of equations with boundary conditions are moving?

Also, find the values of unknown variables?

I know that, tetrahedron with vertices (0, 0, 0), (3, 0, 0), (0, 5, 0), (0, 0, 14) has center of insphere is  (1, 1, 1) and radius R = 1. How to create a tetrahedron whose coordinates of all vertices are integers, the inscribed spherical center and the inscribed spherical radius are integers?

Dear maple users 

Greetings.

In this code, I am solving the PDEs via perturbation method.

There is some mistake in the boundary condition and pdsolve.

Kindly help me that to get the solution for this PDE via perturbation method.

Wating for your replay.

BC: 

Code: JVB.mw

Hello,

I wanted to substitute exp(a) with p in an expression of the form exp(-a).

subs(exp(a)=p,exp(-a))

This threw back exp(-a) to me. I was expecting 

exp(-a)->1/exp(a)->1/p

Is there a way to do that with subs? (a some mystical option perhaps?)

Thanks in advance.

This integral 

for n integer and n>=0

Maple finds it if I tell it this in the assumptions.  But if I remove the assumption that n>=0 and just keep the assumption that n is integer, it hangs. (at least I waited 5 minutes and gave up).

Is this something to be expected?  If I try the same thing in Mathematica, i.e. telling it n is an integer, but not that it is n>=0, it returns result  immediately, with condition that the result is valid for n>=0.

restart;
int(x^n*exp(-x),x=0..infinity) assuming n::integer

seems to hang.

In Mathematica:

My question is  if this behaviour of int hanging is to be expected, since it was not told than n>=0? Should it have returned result of n!  like Mathematica, with the assumption given in the result as well?

Since for n<0 the integral does not converge, and maple knows this

restart;
int(x^(-2)*exp(-x),x=0..infinity)

            infinity

May be this is just a design issue in int and it was stuck trying to evaluate the integral for negative integers, and could not determine if it converges or not?

Any thoughts?

Maple 2020.2

Hello everyone,

My question might be trivial for you but I really could not find any solution online. In an academic assignment, the load function acting on top of a beam contains dirac function and its derivatives. What I want is that the dirac function, Dirac(x-a1), is equal to 1 when x=a1, but all I get is Dirac(0.). 

I solved the same problem with Heaviside function with the NumericEventHandler but did not find anything about Dirac delta function.

My goal is to also plot this load function ("q" in my case) along a beam of 5 meters length. When I tried it looks like the dirac delta function are not considered at all.

restart:
with(plots):
NumericEventHandler(invalid_operation=`Heaviside/EventHandler`(value_at_zero=1/2)):
alias(delta=Dirac):
q:=3-0.2*x+varV1*delta(x-a1)+varV3*delta(x-a3)+EI2*varPhi2*delta(2,(x-a2))+EI2*varW2*delta(3,(x-a3));
            q := 3 - 0.2 x + varV1 delta(-x + a1) + varV3 delta(-x + a3)

   + EI2 varPhi2 delta(2, -x + a2) - EI2 varW2 delta(3, -x + a3)

a1:=1:a2:=3:a3:=2:
x:=a2:q;
                 2.4 + EI2 varPhi2 delta(2, 0)

x:='x':plot(q,x=0..5);
 

Thank you in advance.

restart; _local(D); A := [-L, 0]; B := [L, 0]; C := [x, y]; D := [-x, y]; Dist := proc (X, Y) options operator, arrow; sqrt((X[1]-Y[1])^2+(X[2]-Y[2])^2) end proc; Eq := (Dist(C, D) = Dist(C, B))^2; centre := [solve(diff(Eq, x), x), solve(diff(Eq, y), y)]; with(geometry); `assuming`([conic(p, Eq, [x, y])], [L > 0]); detail(p); asymptotes(p); y_acymp := `~`[solve](`~`[Equation](asymptotes(p)), y); y := solve(Eq, y)[1] P := proc (X, L0) local Curve, Asymptote, Trapezoid, T, pt, Ip; Curve := plot(eval([y, -y], L = L0), x = -(1/3)*L0 .. 15, color = red, thickness = 3); Asymptote := plot(eval([-sqrt(3)*x-(1/3)*sqrt(3)*L, sqrt(3)*x+(1/3)*sqrt(3)*L], L = L0), x = -(1/3)*L0 .. 15, linestyle = 3, color = black, thickness = 0); Trapezoid := plottools:-polygon(eval([A, B, C, D], [L = L0, x = X]), color = "LightGreen"); Ip := (1/3)*(eval(C, [x = X-(1/3)*L0, L = L0])); #centre of gravity of ABC T := plots:-textplot([[(eval(A, [x = X, L = L0]))[], "A"], [(eval(B, [x = X, L = L0]))[], "B"], [(eval(C, [x = X, L = L0]))[], "C"], [(eval(D, [x = X, L = L0]))[], "D"], [Ip[], "I"]], align = {above, left}, font = [TIMES, 16]); pt := plot([A, B, C, Ip], style = plottools:-point, color = blue, symbolsize = 15); plots:-display(Curve, Asymptote, Trapezoid, T, pt, scaling = constrained, size = [400, 800]) end proc; a := 7; P((1/2)*a, 6) I would like of location of centre of gravity of ABC. Thank you.

Hi

I am trying to implement normally distributed noise into a maplesim simulation. I thought this would be done most easily thru adding a modelica custom component. There are some examples to go on on the web however Modelica are not really good at explaining there implementation. 

The code for my implemented block can be seen below. 

 

model Noise2
    import MBI = Modelica.Blocks.Interfaces;
    import MBN = Modelica.Blocks.Noise;
    import MMD = Modelica.Math.Distributions.Uniform;
    
    output MBI.RealOutput out annotation (Placement(transformation(extent={{100,-10},{120,10}}))); 

    inner Modelica.Blocks.Noise.GlobalSeed globalSeed(fixedSeed=42);
    
    MBN.NormalNoise generator(samplePeriod=0.1,distribution=MMD.density(0, -1, 1));

    
    Real y(useGlobalSeed=true, useAutomaticLocalSeed = false, fixedLocalSeed=false, startTime = 0);
    
equation
    out = generator.y;
end Noise2;

 

However this results in the following error

Argument 1 must have integer[4] data type

 

Due to my inexperience with Modelica, I don't even know were to start searching for the error. So I turn to this wonderful community in my hour of need, How do I implement normal distributed noise in maplesim?

Mvh

Eric Ragnarsson

This  is a question from https://mathematica.stackexchange.com/questions/239055/how-to-reduce-the-time-to-solve-this-system-of-equations. How to reduce the time in Maple?
 

  {x, y, z, a, b, m, n} /. Solve[{1/x + 1/y == 1/z, a/x  + b/y == m/n, 2 <= x <= 30, 2 <= y <= 30, 1 <= z <= 30, 2 <= a <= 10, 2 <= b <= 10, a > b, 2 <= m <= 10, 2 <= n <= 10, x > y, GCD[m, n] == 1, GCD[a, b, m] == 1, m <= n}, {x, y, z, a, b, m, n}, Integers]
First 324 325 326 327 328 329 330 Last Page 326 of 2308