tomleslie

13876 Reputation

20 Badges

15 years, 175 days

MaplePrimes Activity


These are replies submitted by tomleslie

Please post the code showing your attempt at solving your own problem -

because I'm getting tired of doing it for you!

Attached plots f(eta) versus eta and theta(eta) versus eta for n=1.2.3.4

odeplots.mw

The f(eta) plot varies a little as 'n' is varied, but the theta(eta) plot doesn't - maybe because with your choice of parameters, you have R2 identically zero. Is this deliberate?

One thing I advise is for the OP to try the possibiliities and read the error messages *very* carefully - ie note what the error is and at which stage it occurs

restart;
g:=unapply('fsolve(a*y^2-sin(y),y=2)',a);
evalf(Int(g(x),x=1..2)); #Stage 1
evalf(Int('g(x)',x=1..2));#Stage 2
evalf(Int(''g(x)'',x=1..2));#Stage3

The reported errors are

Stage1: Error, (in fsolve) x is in the equation, and is not solved for
Stage2: Error, (in evalf/int) when calling 'fsolve'. Received: 'x is in the equation, and is not solved for'
Stage3: 0.6419321516

Or the 'short' version which works

restart;
g:=unapply('fsolve(a*y^2-sin(y),y=2)',a);
evalf(Int(g, 1..2));

So far as I can tell the 'Programmer indexing method (first solution above) always works

Check the help page at ?Indexing Arrays, Matrices, and Vectors

Alternatively, tell me what you don't like about the output of

#
# Same definition now extended
#
  restart;
  A := Array([[1], [2], [3]]);
  op(A);
  A(4..5,1):=Array([[4],[5]]);
  op(A);

If you want to uses ArrayTools:-Extend(), then

restart;
A := Array([[1], [2], [3]]);
ArrayTools:-Extend(A(..,1), [4,5]);

will work

I have just double-checked - this code runs with no errors on Win7, 64-bit, Maple2016.1,

User Interface: 1133417
           Kernel: 1133417
          Library: 1133417

Since the code runs for me (and Acer) but not you, on what seems to be an identical platform, I can only guess that there must be something wrong with your installation :-(

solve() works with either lists or sets for both arguments

fsolve() allows either a list or set for the first argument (the equations) but the second argument (variables) has to be a set.

I have no idea why Maple imposes this distinction - seems perverse to me???.

I only used fsolve() in this specific poblem because solve() returned nothing

On Win 7 64-bit the worksheet you uploaded (ie TestExplore_1.mw) works in Maple 2016, detailed version below

User Interface: 1133417
           Kernel: 1133417
          Library: 1133417

I can't break it!

On the other hand your second post (no code upload, just a picture) contains a reference to Maple 18.02. The worksheet TestExplore_1.m, contains no such reference. So there are two different worksheets and you have only supplied one. Infuriating and impossible to debug

I can inform you that the worksheet TestExplore_1.m will not function in Maple 18.02. I get all sorts of "interesting" error messages which I am not prepared to debug until you specify very, very clearly:

which worksheet do you want to run in which Maple version

Stucture of ODEs implies 5 boundary conditions

However you also have five "unknowns"  [Pr, n, p, lambda, sigma] which implies a further 5 equations for these to be determined: or if these are parameters, then five assignments (or some combination of equations and assignments)

I think that any significant Maple update is going to cost $$$  which I'm guessing you don't want.

I have to pat serious amounts of $$$ for Maple updates, so I don't know how you can update Maple without money. Maybe if you have some kind of "teaching" license - eg you are running on a "University" installation, Maple updates might(??) be free. But I still have no idea how you could update without spending money!

One thing you could try. The worksheet I sent you, used 'numelems(L)' to determine the end-value of the do-loop. I have been able to determine that the command 'numelems()' only became available in Maple15. Since you seem to be running Maple13, in the worksheet I previously posted try replacing the line

for k from 1 by 1 to numelems(L) do

with

for k from 1 by 1 to nops(L) do

and see if that works.

I have attached the "executed" version of my original worksheet, so that you can see it executes with no errors and seems to produce most of the required information

odeProb_exec.mw

You are using a fairly old version of Maple (ie Maple13), and I have no access to versions this old - so I guess it could be a version issue????

but I suspect that OP's problem has more to do with the fact that the NLPSolve() command seems to be within a for/while loop - and possibly a simple error is being made- such as each loop iteration overwriting the previous solution???

Which is why I suggested posting the worksheet - cos, otherwise I'd be guessing

Using the big green up-arrow in the MaplePrimes editor toolbar to upload the problem worksheet

(with a bit of an offset in the index),

Consider

seq([j, combinat:-fibonacci(j+2)], j=1..25);


[1, 2], [2, 3], [3, 5], [4, 8], [5, 13], [6, 21], [7, 34],

  [8, 55], [9, 89], [10, 144], [11, 233], [12, 377], [13, 610],

  [14, 987], [15, 1597], [16, 2584], [17, 4181], [18, 6765],

  [19, 10946], [20, 17711], [21, 28657], [22, 46368],

  [23, 75025], [24, 121393], [25, 196418]

You can check Wikipedia for the derivation of closed-form expression for this sequence (and why the golden ratio (1+sqrt(5))/2) crops up

 

Seriously!

Using Maple 2015.2, User Interface: 1097895, Kernel: 1097895, Library: 1097895 with OP's code, then (more or less instantaneously), this code crashes fast and hard. No output from the final 'for' loop, so I'm assuming it crashes on the first iteration.

I get a Windows message stating that mserver.exe has stopped working, togther with a Maple message stating that "kernel connection has been lost".

In Maple 2016.1, User Interface: 1133417, Kernel: 1133417, Library: 1133417 this code works for the first 4 iterations of the final for loop - and then crashes with the same error messages - ie Windows stating that mserver.exe has stopped working, togther with a Maple message stating that "kernel connection has been lost".

I agree with most of the comments previosly about code inefficiency relating to evalf/int/Int issues - not arguing about any of that at al l- but have to disagree on "crashing" issues. Something in this code just seriously breaks Maple - and I can't 'see' what that might be

First 139 140 141 142 143 144 145 Last Page 141 of 207