5219 Reputation

15 Badges

9 years, 248 days

MaplePrimes Activity

These are answers submitted by tomleslie

Don't have Mathematica so can't really check, but as far as I can tell

  1. Maple imports .mma, but does not export it
  2. Mathematica does not import or export .mw(s)
  3. So only option would seem to be: pick a format both support - eg mathML(?). Maple exports it and Mathematica imports it. I suspect that success/failure of this approach depends on the "complexity" of the info to be exported/imported

From maple MathML:-Export

appears to work (no messgaes/complaints) for both of the expressions you quote.

Like I said earlier, I can't check whether Mathematica's mathML import, will import/convert correctly

The attached runs in about 0.25secs on my machine and produces plausible-looking plots


I think there may be a few problems with the code you posted

  1. if you want 3.14159... you have to use Pi everywhere, not pi
  2. there seems to be a missing operator in the expression

#funzione desiderata
Yd(q) := arctan(tan(q),(1 - b*tan(q)/2/p));
arctan(tan(q), 1 - 0.3055555556 tan(q))      <--  6 tan ?????

If I use Pi for pi throughout, and replace the above snippet with

#funzione desiderata
Yd(q) := arctan(tan(q),(1 - b*tan(q)/2/p));
arctan(tan(q), 1 - 0.3055555556 * tan(q))

Then NLPsolve still returns the error message

Error, (in Optimization:-NLPSolve) abs is not differentiable at non-real arguments



DirectSearch[Search](rms, [z = -0.4..0,
                                         alpha0 = 0..Pi/3,
                                         alpha1 = Pi/2..5*Pi/4,
                                         l1 = 0.3..1,
                                         l2 = 0.001..0.3,
                                         l3 = 0.01..0.3


1.20098330185160, [alpha0 = 9.10801161719342*10^(-8), alpha1 = 1.57079638010262, l1 = .496239599198213, l2 = .260891601089832, l3 = 0.100000115197816e-1, z = -0.841913363553979e-2], 84]

If I understand your requirement correctly, then the attached performs the relevant calculation. Results aren't very exciting though!

  1. Why use partial derivative symbols when you seem to have functions (u and v) of only one variable?
  2. You have to make the function dependencies obvious - easiest way is to write u(x), v(x)

See the execution groups I have added to your worksheet

Since it seems(?) that you want to plot *real* values (which Maple won't assume), then you could use

plot(x^(1/3), x=-1..1);
plot(x^(4/3)*sin(1/x), x=-1..1)

  1. Don't understand why you have defined your own atan2() function because Maple already has always had an inbuilt 2-element arctan() function, although you will have to multiply by 180/Pi if you want it in degrees
  2. The builtin functions min[index](A) and max[index](A) wil return the index values of minimum (maximum) elements for pretty much any indexable structure A- list, array, matrix whatever. I believe that this functionality was added for Maple 2015, so if you have an earlier version.......
  1. I commented out the forget(evalf) and Digits() commands because I don't think you need them. Uncomment them if you want to
  2. I added some plot options (color, symbol) so that I/you could easily tell which plot was being generated by which command

So just run the attached

  1. The function ge() is not doing what you think! ge(x,y) returns 1 if x>=y and 0 otherwise. You should be using >=.
  2. However making the above change does not solve your problem. As the manual says "The isolve command has some limited ability to deal with inequalities"
  3. You can however use solve() with assumptions, as in

n := 2;
solve(sum(a[k], k = 1 .. n)-1 = 1, useassumptions) assuming a[1]::nonnegint, a[2]::nonnegint;

Counterexample: since 5*15 = 75 mod 90 and 75 is not a member of {5, 15, 25, 45, 55, 65}, the set does not exhibit closure under the defined operation and hence cannot be a group

Based on your response last time, best thing I can do is make absolutely no comment on the code whcih you posted.

Assuming I haven't made any typos, I think  the graphs you want are shown below

ode := diff(y(x), x, x) = x*y(x)+x^(17/12);
ics := y(1000) = 0, y(1001) = 1;
sol:=dsolve({ode,ics}, numeric);
odeplot( sol,[x, y(x)], x=1000..1001);

You cannot write


in your procedure because X is a passed parameter. You cannot assign to passed parameters

Also there is some very doubtful logic in the opening statement of the inner 'do' loop.

See attached

Lots of logical and a few syntax errors. See the comments in the attached for explanations

What benefit do you gain by getting someone else to do your homework for you?

You may be able to fool your tutors, but trust me the first time you ever go for a job interview, you will either know what you are talking about or you will be thrown out in about 2 minutes?

Having got that off my chest, and sticking to the conditions of the homework problem, the following will work

km:= proc( n::posint, m::nonnegint)
                 local k,
                 for k from 1 by 1 to n do
                 return mySum;
        end proc:

Of course no-one would actually code it this way: the following is much shorter/more efficient etc etc

km:= proc( n::posint, m::nonnegint)
                  add( k^m, k=1..n):
         end proc:

First 101 102 103 104 105 106 107 Last Page 103 of 116