## Maple Questions and Posts

##### These are Posts and Questions associated with the product, Maple

Hello, I am just learning how to use Maple and only have Maple 9.5. I am attempting to read in a single column of data from a pre-made txt file into Maple but I am having difficulty. For some reason Maple states that it cannot find the file that I am pointing it to. This was what I wrote... >restart; >RD:=readdata("c:\temp\test.txt"); I tried using " instead of ' and it gave me an error message as well. Any ideas what the problem might be? Thanks.

## Seeking Optimization...

I've got two procedures set up that work, but I know there have to be better ways to accomplish the same goals. First, I've got a procedure that finds to how many digits two floats (`a` and `b`) agree. I had tried a few methods of examining the `SFloatMantissa` and `SFloatExponent` of the difference, but those methods would fail in unpredictable ways. My current method explodes the floats into lists and compares every entry in a `for` loop. The example below is basically the heart of my procedure (I do take into consideration things like the location of the decimal and trailing zeros):

## Plots of twisted ribbons

Maple

In order to get better acquainted with the plotting facilities of Maple I thought I would try to plot the Möbius strip. In the proces I generalized the task so that I would be able to plot a ribbon twisted an arbitrary number of times. From these efforts the following code resulted:

```with(plots):
ribbonVector := (phi) -> Vector([-sin(phi)*cos(phi),-sin(phi)*sin(phi),cos(phi)]):
p := (twist,theTitle,theOrientation) -> plot3d(
title=theTitle,orientation=theOrientation,grid=[100,10],scaling=constrained
):
```

Below follow two examples: 1. Ribbon with 1/2 twist: The Möbius strip:

```display(p(1/2,"Ribbon with 1/2 twist: The Möbius strip",[200,70]));
``` 2. Ribbon with 1/1 twist:

```display(p(1/1,"Ribbon with 1/1 twist",[40,60]));
``` ## 2-D plot with context menu...

I am trying to produce a 2-D plot of the function (sin(x))^2 using the context menu in document mode but Maple returns this error: sin(x)^2 -> Error, invalid input: smartplot uses a 1st argument, f (of type {algebraic, algebraic = algebraic, {set({algebraic, algebraic = algebraic}), list({algebraic, algebraic = algebraic})}}), which is missing It does the same when I change the function. What's wrong? Thanks Stéphane

## CriticalPoint Question...

All: I am trying to find the critical points for f(x):=((x-1)^2)^(1/3)-.5*x^2 over [-2, 2] It has two stationary points solve(diff(((x-1)^2)^(1/3)-.5*x^2,x)=0,x); -.5732093133, 1.180229770 and one singular point. 1 But CriticalPoints(((x-1)^2)^(1/3)-.5*x^2, x); only finds -.5732093133, 1 Can anyone explain why? Thanks

## Unevaluated region when plotting a procedure...

Hi -- I am trying to plot a (fairly basic) procedure, Q_plot, which defines a piecewise function (three pieces). Q_plot evaluates no problem at the command prompt for all three regions -- but only plots for two of the three regions. Resulting in a big hole in the middle of my graph! Hmm? I've uploaded a copy of the worksheet, with the plot (and the aformentioned hole in the middle). Thanks Here's the link to the worksheet: http://www.mapleprimes.com/files/5475_Diagnostic-proc-Q.mw

## Minimizing the maximum...

Hello all, I have a function, a(r,zeta). For a particular range of values of zeta and r, I'd like to find out which value of zeta will give me the smallest maximum point on the function. I've used the Optimization:-Maximum function to give me the maximum point at a specific value of zeta, but after that I was changing zeta using trial an error to find the smallest maximum, and was wondering if I could get Maple to compute that for me. Thanks --Amr

## make an (animated) plot of a complex function?...

Hello everyone! My question is a stated above... I am trying to find a solution to the wave equation for a standing wave in a rope, with damping. my trial function is : exp(-I*(omega*t+k*x)) * exp(-tau*x) I am still working on my expression for tau, but besides that I have no idea how to plot this. I started to plot exp(-I*(omega*t+k*x)) with omega = 2 and k = 4. I simply can't figure it out, its probebly because it is complex.... Somebody experience with this? already thanks.

## Analytic derivatives of numerical solutions of an ...

Hello!

I have a system of ODEs which I can solve numericaly with Maple. What I try to do (still without success) is to compute the i-th derivatives of the solutions at a certain point of the interval. For example (a mini-version):

eq_0 := D(x)(t)=(-2*x(t))/(1-x(t));
eq_1 := D(x)(t)=(2*x(t))/(1-x(t));
sys := {eq_0, eq_1, x(0)=1, x(0)=0};
fcns := {x(t), x(t)};
p:=dsolve( sys, fcns, numeric, method=classical[rk2], output=listprocedure );

(OK, this is very easy, but it is only an example.)

Now I want to compute the 6-th derivative of x(t) at t=1/2. The analytic form can be obtained if D(x) is differentiated 5 times and x and x are substituted by their numerical solution. I have read about differantiating in Maple, but I still cannot get this work.

## Sign of a polynomial...

Hi -- I want to check the sign of a polynomial. Here's the polynomial expression (1/16)*(9*s^5-3*s^4*m-34*s^4*pa+12*s^3*m*pa+46*s^3*pa^2-18*s^2*m*pa^2-24*s^2*pa^3 +12*s*m*pa^3+s*pa^4-3*m*pa^4+2*pa^5-16*s^4+64*s^3*pa -96*s^2*pa^2+64*s*pa^3-16*pa^4+16*p^2*s+48*p^2*m-64*p^2*pa)/(s-pa)^4 and here's the parameterization: pa>s and pa>m. Generally checking the sign of the polynomial involves checking the signs of the factors...so, I'd like to factor the above expression. I haven't worked with "factor" much in Maple. Applying it as just factor(expr) with expr equal to the above expression does nothing. So not sure the best approach.

## obtaining distributions...

Hello again Maple experts, I have four nonstochastic variables s11, s12,s21,s22.. from there I have 2 random variables X1 and X2 (to begin, it may be a uniform distribution U[-1,1]) . I generate the random variables y1 and y2: y1 = min(s11+X1, s21+X2) y2 = min(s12+X1, s22+X2) 1. How could I obtain with MAPLE the distribution of Z= (y1)^(1/2)+log((40-y2)*(80+2*y2-3y1))? 2. And how could I obtain the expected value of Z? Thanks in advance for any help. Regards, Jean

## can't use map on nested lists...

I have a nested list, say test:=[[1,2,3,4],[5,6],[7,8,9]]: and I want to use something like map(x->1/x,test); to get [[1, 1/2, 1/3, 1/4], [1/5, 1/6], [1/7, 1/8, 1/9]] but it won't work... map doesn't go in nested lists and it rather returns [1/[1, 2, 3, 4], 1/[5, 6], 1/[7, 8, 9]] I can't find an example about this simple problem, I'm sure it must be easy though but I'm losing my mind on this one.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9001238,"math_prob":0.94792664,"size":7427,"snap":"2020-24-2020-29","text_gpt3_token_len":2220,"char_repetition_ratio":0.08985585,"word_repetition_ratio":0.003319502,"special_character_ratio":0.3121045,"punctuation_ratio":0.15852273,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9961656,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-07-04T03:36:53Z\",\"WARC-Record-ID\":\"<urn:uuid:5ef9ea59-0e4f-4132-a3a7-97671df28367>\",\"Content-Length\":\"139964\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:5bd473fa-3121-4368-afa8-9db2d5cc7ac7>\",\"WARC-Concurrent-To\":\"<urn:uuid:0a8d7eb4-a161-4b66-941c-a3b9c6e8dd0a>\",\"WARC-IP-Address\":\"199.71.183.11\",\"WARC-Target-URI\":\"https://mapleprimes.com/products/Maple?page=1572\",\"WARC-Payload-Digest\":\"sha1:4QPUXWWJZGHD2OMNXKJMUB3EICOT6ZRE\",\"WARC-Block-Digest\":\"sha1:N6JDJY4KROX4SAZMCEHVPAVPLRLEQE24\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-29/CC-MAIN-2020-29_segments_1593655883961.50_warc_CC-MAIN-20200704011041-20200704041041-00219.warc.gz\"}"}