acer

32817 Reputation

29 Badges

20 years, 131 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

You could try using fsolve's 'avoid' option. See the last example in the help-page ?fsolve,details for an illustration. You could have it loop until it either failed to find more solutions or obtained the finite number of solutions that you expect. (Unlike that example in that help-page, you could start with an empty set of solutions S:={} and then augment S with each new found solution.)

Alternatively, you might try using RootFinding:-NextZero instead of fsolve, for a univariate expression or procedure like in your example. Start it searching from the left endpoint of your range, and then repeat with it searching from the previous root (or a small amount more than that) until you obtain as many as you expect or it fails to find any more.

acer

I didn't see it mentioned in the original post that A was invertible. If A is symmetric but not invertible, then symmetric solution X need not be unique.

acer

I didn't see it mentioned in the original post that A was invertible. If A is symmetric but not invertible, then symmetric solution X need not be unique.

acer

The plot of 'f' shows a flat region, or problems except for the restricted domain from about 0.7 to 0.9 or so. It looks as if fsolve may be having difficulty "finding" that section, if the supplied domain is not tight enough.

> f := proc(t)
>    local x, y;
>          maximize((1.3-x)*x+0.3*(1-y)*(y-x), x=t..0.9, y=t..0.9);
> end proc:

> fsolve('f(t)-0.4', t=0.5..0.9);
                                 0.8088533865
 
> fsolve(t->f(t)-0.4, 0.5..0.9);

                                 0.8088533865

acer

The plot of 'f' shows a flat region, or problems except for the restricted domain from about 0.7 to 0.9 or so. It looks as if fsolve may be having difficulty "finding" that section, if the supplied domain is not tight enough.

> f := proc(t)
>    local x, y;
>          maximize((1.3-x)*x+0.3*(1-y)*(y-x), x=t..0.9, y=t..0.9);
> end proc:

> fsolve('f(t)-0.4', t=0.5..0.9);
                                 0.8088533865
 
> fsolve(t->f(t)-0.4, 0.5..0.9);

                                 0.8088533865

acer

Rerunning the whole sheet, which begins with a "restart", might not illustrate the problem. I suspect that in order to see the problem one would have to execute the whole sheet, and then repeat only the command that appears (3 times) right at the bottom. I interpreted it as that repeated execution of that particular command leads to the memory usage increase.

acer

Rerunning the whole sheet, which begins with a "restart", might not illustrate the problem. I suspect that in order to see the problem one would have to execute the whole sheet, and then repeat only the command that appears (3 times) right at the bottom. I interpreted it as that repeated execution of that particular command leads to the memory usage increase.

acer

Yes, that's what the example is supposed to illustrate.

I named the new unit the "roung", and placed it in a new units system ChrisSI which is a modification of the usual SI system. It has an abbreviation of rg. One roung equals one [[m/s^2]]. That new system should work under Units:-Standard with the roung as the default output for the dimension mass/length^2.  And the new units symbol rg accepts SI style prefixes, so that 1000*Unit(roung)=1*krg = 1000*Unit(m/s^2).

acer

Yes, that's what the example is supposed to illustrate.

I named the new unit the "roung", and placed it in a new units system ChrisSI which is a modification of the usual SI system. It has an abbreviation of rg. One roung equals one [[m/s^2]]. That new system should work under Units:-Standard with the roung as the default output for the dimension mass/length^2.  And the new units symbol rg accepts SI style prefixes, so that 1000*Unit(roung)=1*krg = 1000*Unit(m/s^2).

acer

> restart:

> Units:-AddSystem(WayneFPS,Units:-GetSystem(FPS),inch,inch^2,inch^3);

> with(Units[Standard]):

> Units[UseSystem]('FPS');
> 35*Unit(erg)/Unit(s^2);
                                          [  2   ]
                               78125000   [ft  lb]
                             ------------ [------]
                             940627457451 [   4  ]
                                          [  s   ]
 
> Units:-UseSystem(WayneFPS);
> 35*Unit(erg)/Unit(s^2);
                                          [  2   ]
                              1250000000  [in  lb]
                             ------------ [------]
                             104514161939 [   4  ]
                                          [  s   ]

acer

> restart:

> Units:-AddSystem(WayneFPS,Units:-GetSystem(FPS),inch,inch^2,inch^3);

> with(Units[Standard]):

> Units[UseSystem]('FPS');
> 35*Unit(erg)/Unit(s^2);
                                          [  2   ]
                               78125000   [ft  lb]
                             ------------ [------]
                             940627457451 [   4  ]
                                          [  s   ]
 
> Units:-UseSystem(WayneFPS);
> 35*Unit(erg)/Unit(s^2);
                                          [  2   ]
                              1250000000  [in  lb]
                             ------------ [------]
                             104514161939 [   4  ]
                                          [  s   ]

acer

I believe that "minus signs" was a reference to the original poster's problem when solving for m, of the -M term being at the fore of the sum.

And in case anyone is interested, according to the session history, the same type of issue might occur when using `isolate`.

> restart:
> -M+a^3/P^2:
> eq:=(m+M)=a^3/P^2:
> isolate( eq, m );
                                            3
                                           a
                                 m = -M + ----
                                            2
                                           P

> restart:
> eq:=(m+M)=a^3/P^2:
> isolate( eq, m );
                                       3
                                      a
                                 m = ---- - M
                                       2
                                      P

acer

I believe that "minus signs" was a reference to the original poster's problem when solving for m, of the -M term being at the fore of the sum.

And in case anyone is interested, according to the session history, the same type of issue might occur when using `isolate`.

> restart:
> -M+a^3/P^2:
> eq:=(m+M)=a^3/P^2:
> isolate( eq, m );
                                            3
                                           a
                                 m = -M + ----
                                            2
                                           P

> restart:
> eq:=(m+M)=a^3/P^2:
> isolate( eq, m );
                                       3
                                      a
                                 m = ---- - M
                                       2
                                      P

acer

Thanks. I am not seeing any memory use increase yet, after about 50 repeats of the final command in the worksheet. It sits at about 12MB as reported by the Maple GUI and about 22MB as reported by my OS's `top` utility. I am using 32bit Linux, though. Maybe others may confirm the behaviour on WinXP.

acer

Thanks. I am not seeing any memory use increase yet, after about 50 repeats of the final command in the worksheet. It sits at about 12MB as reported by the Maple GUI and about 22MB as reported by my OS's `top` utility. I am using 32bit Linux, though. Maybe others may confirm the behaviour on WinXP.

acer

First 540 541 542 543 544 545 546 Last Page 542 of 601