acer

32348 Reputation

29 Badges

19 years, 330 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@vv I've formed a habit. I haven't thought of a case whether it matters for the parameter name (as opposed to the rhs of a keyword option, say).

If your final goal is just to be able to evaluate the symbolic inverse equations (for Vector x) at arbitrary numeric values of parameter kappa then I suggest that your approach is likely misguided.

For considerations of performance speed as well as numeric stability I would consider instead creating a procedure/function which took float values for kappa as argument and returned the purely float results for x from purely floating-point linear solving.

If your final goal is just to obtain float x (for arbitrary float kappa) then what is the system in which you want to do that? Is it Maple, or some language like C/python/etc? Is there no good float linear solver in your final program?

@David1 

If I substitute the values of special into eq4 then I get this:

eq4;

                r11 r12 + r21 r22 + r31 r32 = 0

special;

    [r13 = 0, r23 = 0, r31 = 0, r32 = 0, r33 = 1, s1 = 0,
     s2 = 0, s3 = 0, t1 = 0, t2 = 0, t3 = 0]

eval(eq4, special);

                     r11 r12 + r21 r22 = 0

I don't see how you could possibly obtain 2*r22*sqrt(1-r22^2)=0 from that substitution (as you now claim to obtain), since there is no sqrt in the original eq4. Your original question had eq4 as, literally:

eq4:=r11*r12+r21*r22+r31*r32 = 0;

Here is an attachment with some random values of r22 in -1..1, where the substitutions from utilizing each of manysols then leads to various roots. polysys2a.mw

You don't need to edit the equations in your original Question. Just add a Reply (comment) to the original Question. You don't need to include all the equations as text. Simply put them in a Maple worksheet and attach it to your Reply using the big green arrow in the Mapleprimes editor.

@Carl Love The RootFinding:-Isolate command seemed to indicate that the polymomial system had infinitely many solutions. But I suspect that confidence in that is undermined by the possibility of numerical inaccuracy in the supplied float coefficients.

@David1 If there are infinitely many solutions with particular fixed values set for only some strict subset of the variables (ie. a partially restricted problem) then there are infinitely many solutions for the system. So, yes, the system of equations you supplied has infinitely many solutions, it seems.

For the actual question you asked it doesn't matter whether some strict subset of the variables have fixed values -- what matters is whether any of the remaining variables can take on infinitely many values. I showed a restricted problem in which r22 can take any value between -1 and 1.

The last line of zeros in my attachment are the residuals when the solutions I showed are substituted into the equations.

If you have some additional constraints on the variables (eg. fobidding the partially restricted equations I formed) then you really should show them.

 

If by "next line" you mean entering multi-line statements in 2D Input by using Shift-Enter to drop to the line below then I don't think that there's a way to avoid getting the extra, inserted space.

@claus christensen Sorry, I don't really understand how your last comment relates to my suggestion because I don't have any idea how your intended application is going to function.

There is an undocumented Hide export of the Layout subpackage, which you can use to clobber off the display of Execution Group Boundaries. Note that it will affect all Execution Groups in your sheet. Also, since its not a package export it has to be called with its full command name. And as far as I know there's no programmatic way to turn it back on in the same sheet. I don't really recommend this and, again, I'm not sure how it solves your "problem" properly because I don't understand the problem.   display-problems_Hide.mw

Another way to insert content without a border is to use a Table (whose borders you can suppress from display). I prefer this to the above. display-problems_Table.mw

This might be an appropriate time to mention that in general I've found that it often works out better for interactive applications to use elements from the Components subpackage, rather than only Layout elements. For one thing, that allows you to insert say a PlotComponent just once and then have some Button/Textarea/MathContainer/etc be used to update it with a new plot as the math example is switched/changed in-place. display-problems_PlotComponent.mw

You don't have to build your application with these programmatic commands (and I apologize if you know this already). You can use the palette and menubar to insert embedded-components and GUI Tables, and adjust the code that runs below them using the mouse. This is often convenient to prototype interactive applications, and indeed many people only do this. I personally find that even when I prototype in this way I often still want to write fully programmatic code that generates the same whole application -- because I prefer to have my applications as plaintext source code against which I can do version control.

[edit] The Input/Output Layout elements (within Group/Document elements) can be useful for constructing purely expository material, while the Component elements provide an interactive facility. It may be that you want to reconstruct such expository material when the particular math example is changed, and then re-insert the whole application in-place within the same Task Region. That's a bit advanced, but could be quite slick. A way to do that would be to write re-usable procedures for full reconstruction, based on the new example as argument. A master procedure which utilizes the reusable content functionality of the InsertContent command (its replaceid option) could then re-insert the wholly new example including new expository material as well as the same Button/etc that triggers the rewrite.

@wndrslope This thread is 8 years old, and the issues/causes in that Maple release may be different from those of your problem.

So post your example as a distinct new Question.

And upload your document, using the big green arrow. Don't try and mimic your 2D Input as pasted plaintext or an Image.

@tomleslie This behavior is new to Maple 2017, I believe. (Bug reports submitted.)

restart;

kernelopts(version);

`Maple 2017.2, X86 64 WINDOWS, Jul 19 2017, Build ID 1247392`

0.65/0.65; # by automatic simplification

1.000000000

`/`(0.65, 0.65); # by correct division

1.000000000

 

Entering those two examples above in 2D Input leads to numercal error in
excess of 1 ulp.

 

.65/(.65)

.9999999997

.65/(.65)

.9999999997

 

It happens because the fraction is converted to a mix of infix and prefix form,
where the denominator appears in a unary call to the prefix `/` operator. That
leads to computing the product of 0.65 with its multiplicative inverse, wherein
the numerical round-off error accrues.

 

restart;

sprintf("%a", '0.65/0.65');

"1.000000000"

sprintf("%a", '.65/(.65)')

".65*`/`(.65)"

sprintf("%a", '.65/(.65)')

".65*`/`(.65)"

1/0.65;
0.65 * %;

1.538461538

.9999999997

0.65 * ( 1 / 0.65 );

.9999999997

 

 

Download 2017_roundoff_2D.mw

If you wish to test a name like _Z1 for assumptions (or otherwise manipulate or utilize same in some computation) then you can use the command getassumptions. For Carl's example,

getassumptions(_Z1);

               {_Z1~::integer}

I have submitted a bug report.

Last week I was having problems getting the output of uploaded worksheets to display inlined on Mapleprimes. Now it seems to work, but no longer properly respecting the width of the exported .mw file (a GUI preference).

@tomleslie I am no longer surprised by coincidences.

Just yesterday I found out that in Maple 2017 the parsing of 2D Input had changed, to the effect that certain infix arithmetic statements would no longer automatically simplify as the had in prior releases.

The upshot is that several of your Answer's claims are not true of 2D Input in Maple 2017.

I consider this a significant compatibility issue, and I was thinking of making a Post about it. Interesting examples include addition of identical function calls, where the procedure call's evaluation induces side-effects  (e.g. assignment to globals, in place updating of Array arguments, etc).

Here are basic examples, which one can do in both 1D and 2D Input modes in Maple 2017:

  sprintf( "%a", 'f() + f()' );

  lprint( 'f() + f()' );

  'f() + f()':

In 2D Input in Maple 2017 those become calls to the prefix `+`, containing two calls to `f()`, instead of automatically simplifying to `2*f()`.

Of course there have long been other ways to prevent some relevant automatic simplification of such expressions, including overloading arithmetic operators like `+` and `*`. (Even merely loading the Units[Standard] has had similar effects on automatic simplification.) It's usually awkward to set up but, depending on the precise details of the OP's goals, it may be possible to come up with a solution.

@mschneider You write as if that bolded collection of characters is a thing.

Is it merely what you would intend as typed into a Maple interface?

Or do you expect it to be an expression or string or compound name (perhaps even the assigned value of some variable/name in Maple)?

The difference between those can make a big difference to the answer.

How do you expect that structure to exist in Maple without the like terms combining?

What version of Maple are you using? Which interface? (eg. Standard GUI, Maple Cloud, Classic GUI , command-line shell?) Which input mode? (eg. 1D plaintext,  2D Math) It might well make a difference to the answers.

@arianbig The suggestion is that res1 mistakenly contains the function call

 cf[-1](-1.833333334)

instead of, say, the product,

 cf[-1]*(-1.833333334) .

It doesn't make sense to add terms like cf[-1](-1.833333334) and 68.25827819*cf[1] , where cf[-1] is an unassigned name, and expect fsolve to do something useful.

You likely omitted a multiplication sign (or a space if you are using 2D Input and replying on that to denote multiplication implicitly) somewhere earlier in your code that contributes to the construction of res1.

If you upload your full worksheet which constructs res1 then we might be able to point you to the location of such a syntax mistake. But if you don't then we can't.

First 272 273 274 275 276 277 278 Last Page 274 of 592