tomleslie

13876 Reputation

20 Badges

15 years, 163 days

MaplePrimes Activity


These are replies submitted by tomleslie

@EngM 

why do you need Matlab? My basix recommendations were,

So if all possible,

  1. whatever it is - do it all in Maple, or

  2. whatever it is - do it all in Matlab

fixes the problem. Your original code is a bit "overkill" - the same plot can be achieved with the attached (which is a lot shorter and simpler to understand!)

  restart;
  aList:=[cos, sin, cos + sin]:
  plots:-display([ seq( plot3d(aList[j](x), x=-Pi..Pi, y=j-1..j), j=1..3)]);

 

 

Download ribbon2.mw

if only you would provide a functional worksheet (using the big green up-arrow in the Mapleprimes toolbar) - try to imagine what might happen

  1. People would be able to replicate your problem
  2. People would be able to test possible solutions to your problem
  3. Given (1) and (2) above, you would probably get the best possible solution for your problem

But since you are incapable of providing a functional worksheet (together with any necessary datafiles), the best you can hopw for is speculation

the answer to your question is pretty simple.

Some Maple commands will handle quantities with units and some won't.

Since you cannot be bothered to provide an executable worksheet (using the big green up-arrow in the Mapleprimes toolbar), no-one here can reproduce yout problem. Thus, since no-one can reproduce your problem, no-one can provide a definitive solution.

It's a case of "ask a incomplete question" and "get an incomplete answer".

Since I have no way of replicating your problem and generating a definitve answer,  I can only suggest that you try fsolve(), which (generally?) does handle quantitites with units, rather than RootFinding:-Zero() which may(?) not.

Obviiously without a functional worksheet I cannot determine whether this suggestion is worthwhile or not

You should be aware of the following

  1. I'm assuming that your are using the LinearAlgebra:-EigenValues() command - which you find " not accurate enough" First question: how accurate was your input data?
  2. You cannot  generate accuracy - If your input is (say) six-digits accurate, then yor output will never EVER be more than six digits accurate and (depending on the complecity of calculation), it will be less than that
  3. Most commands in the LinearAlgebra package will use hardware floats for calculation - which means they will produce (roughly) 16-digit output.. But if your input input data is say 6-digit accurate, then the last 10 digits in your output are pretty much crap
  4. You can increase the setting of Digits to any value you want  - and produce say 50-diigit answers - no problem: then read bullet 2 above
  5. IIf you think anyone here can produce code which will miraculously improve the "accuracy" of Maple's inbuilt routinres, you are in fantasy-land
  6. Maple (like Matlab, Mathematica and every other math software package you have ever heard of) uses something called LAPACK for all Linear ALgebra calculations - simply because no-one has been able to come uo with anything better. The odds that anyone her can do better are nil

@JAMET 

what you are trying to achieve -  but it looks like you are doing it the hard way. If I wanted to draw a simple "Maltese Cross", then I would probably do something like the attached

  restart;
  with(plots):
  with(plottools):
  display
  ( [ seq
      ( rotate
        ( polygon
          ( [ [0,0], [-2,3], [0,2], [2,3]],
            color=red
          ),
          j*Pi/2,
          [0,0]
        ),
        j=0..3
      ),
      rectangle
      ( [-3, -3], [3, 3],
        color=white
      )
    ],
    axes =none
  );
 
  

 

 

 

Download malt2.mw

if you post a worksheet which explicitly demonstrates the problem using the big green up-arrow in the Mapleprimes toolbar, maybe someone will be able to help.

If you just want to rant with no prospect of an answer - feel free to do so

@ogunmiloro 

Come up with  better fitting function

You have supplied

  1. some data
  2. a fitting function

and you object to the fact that your fitting funbction does not fit your data very well? Two suggestions

  1. change the data
  2. change the fitting function

This is "display-only" - no conversion from floats to rationals is actually taking place - see the atttached.

I'm still somewhat "bothered" by this display-only "choice"

  restart:
  interface(version);
  op([0..-1], sqrt(a));
  op([0..-1], a^0.5);
  op([0..-1], a^(-0.5));

`Standard Worksheet Interface, Maple 2021.2, Windows 7, November 23 2021 Build ID 1576349`

 

`^`, a, 1/2

 

`^`, a, .5

 

`^`, a, -.5

(1)

 

Download stillOdd.mw

@acer 

I tend to work with the code supplied - all I did was cut+paste - and the code works

That is why I asked for an actual worksheet

in Maple 2021 - so what exactly is the problem? See  the attached!

Please upload the complete worksheet which "crashes", using the big green up-arrow in the Mapleprimes toolbar

  restart:
  interface(version);
  HN := (n, y) -> exp(-1/2*y^2)*simplify(HermiteH(n, y))/sqrt(sqrt(Pi)*2^n*n!):

  u7 := a0*HN(0, y) + a1*HN(1, y) + a2*HN(2, y) + a3*HN(3, y) + a4*HN(4, y) + a5*HN(5, y) + a6*HN(6, y):

  resid := diff(u7, y $ 2) + 4*y*diff(u7, y)*u7 + 2*u7^2:

  r := evalf(allvalues(RootOf(HermiteH(7, x), x))):
  equations := {evalf(eval(u7, y = 0) - 1)}:
  for root_r in r do
      if root_r != 0 then
          equations := {op(equations), evalf(eval(resid, y = root_r))};
      end if:
  end do:

  solutions := solve(equations, {a0, a1, a2, a3, a4, a5, a6});

`Standard Worksheet Interface, Maple 2021.2, Windows 7, November 23 2021 Build ID 1576349`

 

{a0 = a0, a1 = a1, a2 = a2, a3 = a3, a4 = a4, a5 = a5, a6 = 1.788854382*a0-1.264911064*a2+1.095445115*a4-2.381565100}

(1)

 

Download solveProb.mw

because I have jusr tried the last eight Maple versions and all give the same (non-)answer - so when you refer to a previous Maple version where it did work, which version?

  restart:
  interface(version);
  eq2:=x^(-2)/((x)-x^(a));
  Int(f,x):+ int(eq2, x=1..x1);

`Standard Worksheet Interface, Maple 2021.2, Windows 7, November 23 2021 Build ID 1576349`

 

1/(x^2*(x-x^a))

 

int(1/(x^2*(x-x^a)), x = 1 .. x1)

(1)

 

Download quest2021.mw

  restart:
  interface(version);
  eq2:=x^(-2)/((x)-x^(a));
  Int(f,x):+ int(eq2, x=1..x1);

`Standard Worksheet Interface, Maple 2020.2, Windows 7, November 11 2020 Build ID 1502365`

 

1/(x^2*(x-x^a))

 

int(1/(x^2*(x-x^a)), x = 1 .. x1)

(1)

 

Download quest2020.mw

  restart:
  interface(version);
  eq2:=x^(-2)/((x)-x^(a));
  Int(f,x):+ int(eq2, x=1..x1);

`Standard Worksheet Interface, Maple 2019.2, Windows 7, November 26 2019 Build ID 1435526`

 

1/(x^2*(x-x^a))

 

int(1/(x^2*(x-x^a)), x = 1 .. x1)

(1)

 

Download quest2019.mw

  restart:
  interface(version);
  eq2:=x^(-2)/((x)-x^(a));
  Int(f,x):+ int(eq2, x=1..x1);

`Standard Worksheet Interface, Maple 2018.2, Windows 7, November 16 2018 Build ID 1362973`

 

1/(x^2*(x-x^a))

 

int(1/(x^2*(x-x^a)), x = 1 .. x1)

(1)

 

Download quest2018.mw

  restart:
  interface(version);
  eq2:=x^(-2)/((x)-x^(a));
  Int(f,x):+ int(eq2, x=1..x1);

`Standard Worksheet Interface, Maple 2017.3, Windows 7, September 13 2017 Build ID 1262472`

 

1/(x^2*(x-x^a))

 

int(1/(x^2*(x-x^a)), x = 1 .. x1)

(1)

 

Download quest2017.mw

  restart:
  interface(version);
  eq2:=x^(-2)/((x)-x^(a));
  Int(f,x):+ int(eq2, x=1..x1);

`Standard Worksheet Interface, Maple 2016.2, Windows 7, January 13 2017 Build ID 1194701`

 

1/(x^2*(x-x^a))

 

int(1/(x^2*(x-x^a)), x = 1 .. x1)

(1)

 

Download quest2016.mw

  restart:
  interface(version);
  eq2:=x^(-2)/((x)-x^(a));
  Int(f,x):+ int(eq2, x=1..x1);

`Standard Worksheet Interface, Maple 2015.2, Windows 7, December 21 2015 Build ID 1097895`

 

1/(x^2*(x-x^a))

 

int(1/(x^2*(x-x^a)), x = 1 .. x1)

(1)

 

Download quest2015.mw

  restart:
  interface(version);
  eq2:=x^(-2)/((x)-x^(a));
  Int(f,x):+ int(eq2, x=1..x1);

`Standard Worksheet Interface, Maple 18.02, Windows 7, October 20 2014 Build ID 991181`

 

1/(x^2*(x-x^a))

 

int(1/(x^2*(x-x^a)), x = 1 .. x1)

(1)

 

Download quest18.mw

@Jaime_mc2 

gives the result

0.0006276720059034701903530876163549165693383

Suggest you read the help page evalf/int to appreciate what problems might occur when using "extreme" values of Digits

@Jaime_mc2 

I have checked it in Maple 2020.2 - it works. Unlikely that it would work in this version, then not work in Maple 2021.1, then start working again in Maple 2021.2. Suggest you either

  1. Upgrade to 2021.2 and try again. If you have 2021.1 then the upgrade to 2021.2 is free - or
  2. Upload the complete worksheet here using the big green up-arrow in the Mapleprimes toolbar in case we are missing something "subtle"
First 24 25 26 27 28 29 30 Last Page 26 of 207