MaplePrimes Questions

Hi! Do you know how to compute this point of intersection? I thought that would be points given from

solve(f(t)=g(t),t)

but it's not true. I don't want to calculate this numerically because I think it should be seen from formula but ofc I can be wrong.

I'll give the code below:

restart;
with(plots);
f := t -> exp(t) + exp(-t^2 - 2*t);
g := t -> exp(-t^2) + exp(-t^2 - 2*t);
display(plot([f(t), g(t), t = -3 .. 3], discont = true, color = red), pointplot([[2, 2], [exp(-1) + exp(1), exp(-1) + exp(1)]], color = blue, symbol = solidcircle), view = [0 .. 6, 0 .. 4], plot([2, t, t = 0 .. 4]));

 

 


Hi,

I am currently working on structural dynamics problem where I'am trying to obtain the dynamic response of a high-rise building.

To do so I am working in the frequency domain where I was able to find my solution and now I want to obtain the solution in the real time domain by using the inverse fourier function. 

Now the problem comes when applying the inverse fourier transform. The expression which I am trying to tarnsform is extremely long and so Maple requires a lot of time. I tried to run it but after half a day it would still be evaluating. Would there be a way to speed up this process? I attached the worksheet if you're interested.

Thanks in advance :)

nieuw.mw

I have a system of PDEs from Mathematica as a list of equations stored in a text file. I would like to bring it to Maple to solve it. I know how to use , however, I want to import or read the file without displaying its content (being too big), and assign it to a Maple variable. Is there a way of doing it on Maple.

It seems that DrawGraph cannot display the weights of more than 45 arcs of a directed graphs (the arcs themselves are keeping to be displayed correctly).

Maybe a version issue?

WeightedGraphs.mw

Hi
I would like to matrixplot consecutive powers of a matrix. As the name of the matrix is not always the same I wrote a simple "embedded" procedure WM to do this.
This produre works well when called directly, but I don't understand how to make it work when called from animate
 

WM := P -> n -> plots:-matrixplot(P^n, heights=histogram):

U := Matrix(2$2, [0.8, 0.2, 0.4, 0.6]);
WM(U)(1);  #ok whatever the value of the argument of W(U)

plots:-animate(WM(U), [n], n=1..2);  # produces an error

# even this simpler command doesn't work
plots:-animate(plots:-matrixplot, [U^n], n=1..2)  # same error as above

Can you help me to fix this?

TIA

PS: I firstly defined WM this way

WM := proc(P, n)  plots:-matrixplot(P^n, heights=histogram) end proc:

but I met difficulties to tell animate that only n was the parameter to change

Hi,

I am using Maple in Document mode and I want to print my worksheet. Is there a possibility to show the page margins as an overlay so that I can adjust the lines of my worksheet in order to avoid automatic breaks making the print difficult to read?

This worksheet produces a very strange error.

I have examined every assignment and cannot find one which relates to the error message.

Can anyone help here?

Strange_Error.mw 

Good Morning,

    Can anyone explain how the Statistics:-nonlinearfit(Time Vector data points, weight at time t) can be used with a real time based (with units) set of vectors?

    To get the fit for an equation to data of the form A*(1+B)^t   with t being time and the growth in kg/sec  the solver needed to be unitless and I get the coefficents.  Reapplying unit of time blows up the eqn.

   P.S., I think I'm being math obtuse this morning on the units.  Maple_Primes_Question-worksheet_Units.mw

Thanks,

Bill

How to compute and simulate State transition diagram in markov matrix, long run behavior, statistical test analysis?

MArkov.mw

restart;
with(LinearAlgebra):
with(GraphTheory):

with(ListTools);
with(MTM);

g:=Graph(Matrix([[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 1, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]]));

Eg := sum(evalf(abs(Eigenvalues(AdjacencyMatrix(g)))));
print(Eg);

DEg := sum(evalf(abs(Eigenvalues(AllPairsDistance(g)))));

print(DEg);

 

The evalf is taking too much it is running infinetly

Now for such matricies what to do 

Python can run it fast but i require it in maplesoft only 
Kind help if someone can help they will be acknowledged.

Hi friends, I have a problem. From a given number 'k' I want to generate a string 's' with the first naturals before the number k. Like this:

k := 5;

s := "01234";

I want to use the above in the following command:

(parse~@Vector[row]@StringTools:-Explode)~(StringTools:-Generate(k,s));

Thank you.

 

Hi friends, I have a set of polynomials, 'a', and I want to calculate the product of all possible combinations by taking 3 elements at a time. Like this:


a := {x+1,x+2,x^2+1,x^2+x+2}
a[1]*a[2]*a[3]
a[1]*a[2]*a[4]
a[1]*a[3]*a[4]
a[2]*a[3]*a[4]

I have a larger 'a' set so I was looking for a simple method to perform these operations.
Thank you.

How can I use fdiff within Optimization:-NLPSolve and get rid of this error?

Here is an example

restart:
with(Optimization):

# with exact gradient
obj := proc(v)
         10*v[1]^2 - 2*v[1]*v[2]^2 + v[2]^4 + 1 - 2*v[2] + v[2]^2
       end proc:

objgrad := proc(v, w)
        w[1] := 20*v[1] - 2*v[2]^2:
        w[2] := -4*v[1]*v[2] + 4*v[2]^3 - 2 + 2*v[2]
end proc:

NLPSolve(2, obj, objectivegradient=objgrad);
[0.276597509679878506, [0.0364560120817733,0.603788442821000]]


# with approximated gradient estimated "by hand"
objgrad := proc(v, w)
        local eps  := 1e-8:
        w[1] := ( obj(v+~[eps, 0]) - obj(v-~[eps, 0]) )/(2*eps):
        w[2] := ( obj(v+~[0, eps]) - obj(v-~[0, eps]) )/(2*eps):
end proc:

NLPSolve(2, obj, objectivegradient=objgrad);
[0.276597509679878562, [[0.0364560121188285,0.603788442801479]]


# with approximated gradient computed with diff
objgrad := proc(v, w)
        w[1] := fdiff(obj, [1], v);
        w[2] := fdiff(obj, [2], v);
end proc:

NLPSolve(2, obj, objectivegradient=objgrad);
Error, (in Optimization:-NLPSolve) invalid input: fdiff expects its 3rd argument, X, to be of type {algebraic, equation, list(algebraic), list(equation), set(equation)}, but received Vector[row](2, {(1) = 1.0, (2) = 1.0}, datatype = float[8])


Thanks in advance

Hi,

I have a function of 3 variables (PiM) which I can use in plot3d given the first argument while the other two arguments are functions of the two variables I use in plot3d.

In the code I attached below, I am plotting 2 planes using plot3d, but I cannot implicitplot where these two planes intersect. COuld you please take a look at my code?

Thanks.

maple_primes_question.mw

 

 

Hi
I have a huge trigonometric expression in Maple with an approximate length of length(.)=397593353.

When I compute this expression in Matlab, I receive another expression with a much smaller length, and the reason is that Matlab is using subexpressions to calculate the main expression. However, I need to do this in Maple.

I have already tried to simplify, but it didn't work.
The maple worksheet & a screenshot of the Matlab subexpression is attached.

See below file for expression in maple (Please run the "Main.mpl" in the attached file.):

Ldiff.zip

And part of the expression in Matlab is shown in the below picture

Where the subexpressions (again in Matlab) are shown below:

First 375 376 377 378 379 380 381 Last Page 377 of 2415