MaplePrimes Questions

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]

Hello there, 

The equations described below are third-order equations. Therefore, the number of solutions would be 3. 

However, when I tried to solve them using the 'solve' command, only two solutions came out. 

Is there any chance to find the last one?



Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/Q20210201.mw .
 

Download Q20210201.mw

Hey there,

After updating from Maple 15 to 18 and installing Maple Add-In to my Office 2016 version I still have some problems:

I'm trying to catch the data from the Excel. It is so simple at this stage. Import a number from an excel file, just this.

If I do:

Import();

Then a dialog opens and lets me select the Excel file and then the cell range. Everything works well.

But if I do:

Import("Libro1", "Hoja1", "A1");

Then it can't open the document.

Dear Users!
Hope everyone fine here. I tried (as given bellow) to find the solution of nonlinear system of PDEs via FDM. To solve system of nonlinear equations I used newton raphson method and for higher value of like Mx > 8 the matrix G and G1 (mentioned as red) take alot of time. Can anyone help me to reduce the computational time? Becuase I have to evealuate the solution for Mx = 50.


restart; Digits := 30; with(LinearAlgebra);
T := 1; L := 3; N := 30; Mx := 5; `&Delta;x` := L/(1.*Mx); `&Delta;t` := T/(1.*N);
for i from 0 while i <= Mx do
u[i, 0] := 0.; u[i, -1] := u[i, 1]; tau[i, 0] := 0.; theta[i, 0] := 0.; theta[i, -1] := theta[i, 1]
end do;
for n from 0 while n <= N do u[0, n] := 0.; u[Mx, n] := 0.; theta[0, n] := 1.; theta[Mx, n] := 0.
end do;
for n from 0 while n <= N-1 do
print("Simulation in proccess at time-level n", n+1);
for i while i <= Mx-1 do
Ru[i, n] := simplify((u[i+1, n+1]-u[i+1, n])/`&Delta;t`+(u[i+1, n+1]-2*u[i+1, n]+u[i+1, n-1])/`&Delta;t`^2-(u[i+1, n+1]-2*u[i, n+1]+u[i-1, n+1])/`&Delta;x`^2+25.*(u[i+1, n+1]+(u[i+1, n+1]-u[i+1, n])/`&Delta;t`)-1.5*(theta[i, n]+(theta[i, n+1]-theta[i, n])/`&Delta;t`));
`R&theta;`[i, n] := simplify((theta[i+1, n+1]-theta[i+1, n])/`&Delta;t`+(theta[i+1, n+1]-2*theta[i+1, n]+theta[i+1, n-1])/`&Delta;t`^2-(theta[i+1, n+1]-2*theta[i, n+1]+theta[i-1, n+1])/((15.)*`&Delta;x`^2)-((u[i, n+1]-u[i-1, n+1])/`&Delta;x`)^2/(3.)) end do;
for i while i <= Mx-1 do
`R&tau;`[i, n] := simplify(tau[i+1, n+1]+(tau[i+1, n+1]-tau[i+1, n])/`&Delta;t`-1.5^(-1/4)*(u[i+1, n+1]-u[i, n+1])/`&Delta;x`)
end do;
Sys := `<,>`(seq(Ru[i, n], i = 1 .. Mx-1), seq(`R&tau;`[i, n], i = 1 .. Mx-1), seq(`R&theta;`[i, n], i = 1 .. Mx-1));
V := `<,>`(seq(u[i, n+1], i = 1 .. Mx-1), seq(theta[i, n+1], i = 1 .. Mx-1), seq(tau[i, n+1], i = 2 .. Mx));
G := Matrix(3*(Mx-1), proc (i, j) options operator, arrow; diff(Sys[i], V[j]) end proc); G1 := MatrixInverse(G);
X[n, 0] := Vector(1 .. 3*(Mx-1), 1);
for k1 from 0 to r do
X[n, k1+1] := eval(V-G1 . Sys, Equate(V, X[n, k1]))
end do;
Sol[n] := Equate(V, X[n, r+1]); assign(op(Sol[n]));
if n > 0 then
U := eval(`<,>`(seq(u[i1, n+1], i1 = 1 .. Mx)-seq(u[i1, n], i1 = 1 .. Mx))); Noru[n+1] := Norm(%, 2); print("L[&infin;] norm of &tau;(x,y,t) at time level = ", %);
Theta := eval(`<,>`(seq(theta[i1, n+1], i1 = 0 .. Mx)-seq(theta[i1, n], i1 = 0 .. Mx))); `Nor&theta;`[n+1] := Norm(%, 2); print("L[&infin;] norm of &theta;(x,y,t) at time level = ", %) else print("n < 0")
end if end do

Special request to:
@acer @Carl Love @Kitonum @Preben Alsholm

Hey, im new to maple and have a few questions.

1. Sometimes, when i type e.g. a:=10 the blue evaluate line shows "a = 10" and sometimes it just shows "10"

is there a way to get that straight?

Hello,

I am little confused about the help file regarding the VectorCalculus:-PositionVector function. 

In the help file the first argument "comps" is defined as 
"list(algebraic); specify the components of the position Vector"

In spherical coordinates, the position vector is

r e_r

So, if the position vector to be entered is given in terms of the components (in spherical coordinates), the VectorCalculus:-PositionVector function should be called as

VectorCalculus:-PositionVector([r,0,0],spherical)

But this returns

[0,0,r]

(in the cartesian frame). This would make sense if r coordinates is r, theta coordinate is 0 and phi coordinate is 0. 

However, if I call it as

VectorCalculus:-PositionVector([a,b,c],spherical)

Then I end up with

[a*sin(b)*cos(c),a*sin(b)*sin(c),a*cos(b)]

Thus, the "components" given in PositionVector are not the components but the coordinates r=a, theta=b, and phi=c.

Am I missing something here or the help file is misleading? 

I appriciate your help. 

Thanks a lot.

 

Hi erverybody:
How can I get the Laurent serie for function f(x)=1/(1-x^2) about x=1 with condition: abs(x-1)<2
tnx...

I have a problem with evaluation. The eval(s, eqns) does not evaluate s before evaluation with eqns.

How do I do this?

vars := indets(eqns);

lprint(vars)

{exp(-2*t), exp(1/4*(-11+73^(1/2))*t), exp(-1/4*(11+73^(1/2))*t), i[C1](t), i[R1](t), i[R2](t), i[R3](t), i[V1](t), v[1](t), v[2](t), v[3](t),    v[4](t), v[L1](t), v[R1](t), v[R2](t), v[R3](t), v[V1](t)}

for s in indets(others) do
    if has(s, i) or has(s, v) then print(s);eval(s, eqns); end if;
end do:

Hi!

 

I am trying to construct multiple math plots within one procedure, however, only one is displayed at a time, and it is always at the end of the outputs. I searched for that peculiar behaviour and eventually found on

https://de.maplesoft.com/support/help/Maple/view.aspx?path=DataFrame/Tabulate

the line

This command inserts the assembly of Tables and Embedded Components into the worksheet using the InsertContent facility. The inserted content is placed after any usual output of the Execution Group in which this command is called. Each Execution Group allows for only one inserted result to exist at any given time. Multiple calls to commands which utilize the InsertContent facility made within the same Execution Group will result in each successive inserted assembly replacing any assembly inserted earlier for that Execution Group.

 

Is there a workaround for this issue? I cannot find one, e.g. on

https://de.maplesoft.com/support/help/Maple/view.aspx?path=DocumentTools%2fInsertContent

Thank you in advance. :)

Hi!

I have trouble using ArrayTools, specifically Extend, to create a DataFrame. DF1 and DF2 are, even though awkwardly, created correctly, DF 3 does not work. My code is this:

with(ArrayTools):

with(DocumentTools):

nOben:=10;

nUnten:=3;

InitialisierungDF:=Vector(nOben-nUnten+1); #Initialisierung des Dataframes für die Tabelle
InitialisierungSpalte:=Vector[row](nOben-nUnten+1);
for i from 1 to nOben-nUnten+1 do
 InitialisierungDF(i):=oE;
 InitialisierungSpalte(i):=n=i;
end do;
print(InitialisierungDF);
print(InitialisierungSpalte);
DF1:= DataFrame( < InitialisierungDF | InitialisierungDF | InitialisierungDF | InitialisierungDF>,
            columns = [ GK, PZP, PZM, PY],
            rows = InitialisierungSpalte);  
DF2:= DataFrame( < InitialisierungDF | InitialisierungDF | InitialisierungDF | InitialisierungDF>,
            columns = [ GK, PZP, PZM, PY],
            rows = InitialisierungSpalte);
Tabulate(DF1);

print(InitialisierungSpalte);
print(Extend(InitialisierungDF,[oE]));
print(Extend(InitialisierungSpalte,[RMSE]));
InitialisierungDF:=Extend(InitialisierungDF,[oE]);
InitialisierungSpalte:=Extend(InitialisierungSpalte,[RMSE]);  
DF3:= DataFrame( < InitialisierungDF | InitialisierungDF | InitialisierungDF | InitialisierungDF>,
            columns = [ GK, PZP, PZM, PY],
            rows = InitialisierungSpalte);

 

The result is supposed to be a math table of the form

           GK   PZP    PZM   PY

n=1     oE     oE       oE     oE

n=2     oE     oE       oE     oE

...

RMSE  oE    oE      oE       oE

 

I have run into multiple problems, potentially bugs. First, I have to initialize awkwardly with

 

InitialisierungDF:=Vector(nOben-nUnten+1); #Initialisierung des Dataframes für die Tabelle
InitialisierungSpalte:=Vector[row](nOben-nUnten+1);
for i from 1 to nOben-nUnten+1 do
 InitialisierungDF(i):=oE;
 InitialisierungSpalte(i):=n=i;
end do;

 

because InitialisierungDF:=Vector(1..nOben-nUnten+1,oE) doesn't work and produces entries like oE(1) for whatever reason.

Then, creating the data frame DF3 does not work at all with the above mentioned code.

 

InitialisierungDF:=Vector(nOben-nUnten+1); #Initialisierung des Dataframes für die Tabelle
InitialisierungSpalte:=Vector[row](nOben-nUnten+1);
for i from 1 to nOben-nUnten+1 do
 InitialisierungDF(i):=oE;
 InitialisierungSpalte(i):=n=i;
end do;
print(InitialisierungDF);
print(InitialisierungSpalte);
DF1:= DataFrame( < InitialisierungDF | InitialisierungDF | InitialisierungDF | InitialisierungDF>,
            columns = [ GK, PZP, PZM, PY],
            rows = InitialisierungSpalte);  
DF2:= DataFrame( < InitialisierungDF | InitialisierungDF | InitialisierungDF | InitialisierungDF>,
            columns = [ GK, PZP, PZM, PY],
            rows = InitialisierungSpalte);

print(InitialisierungSpalte);
print(Extend(InitialisierungDF,[oE]));
print(Extend(InitialisierungSpalte,[RMSE]));
 
DF3:= DataFrame(<Extend(InitialisierungDF,[oE])|Extend(InitialisierungDF,[oE])|Extend(InitialisierungDF),[oE]|Extend(InitialisierungDF,[oE])>,
            columns = [ GK, PZP, PZM, PY],
            rows = Extend(InitialisierungSpalte,[RMSE]));  


doesn't work either, however, this time a different error occurs. Looking at the vectors the dimensions seem to be correct in each case, though. Any suggestions on how to fix these things?

Hello everyone

Please help me about IntegrationTools:-Change does not transform x to u

IntegrationTools:-Change(int(3*x*sqrt(x+8), x)) 

I want to convert that primitive to a primitive like this: (2/3)*(Int(u^2*(u^2-8), u)) and Error, (in IntegrationTools:-Change) invalid boolean expression: 1
 

Please help me

Help_integrationTools.mw

Hello there, 

When I tried to solve an equation using the 'solve' command in Maple, I got an answer. 

However, I could not understand how Maple got to the answer. Would you tell me what steps Maple might have gone through in order to come to the answer?

Here is my worksheet:

q20210130.mw

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/q20210130.mw .
 

Download q20210130.mw

PS) Perhaps this editbox began to dislike Google Chrome.

 

 

First 426 427 428 429 430 431 432 Last Page 428 of 2409