Pseudomodo

260 Reputation

8 Badges

14 years, 70 days

 

Istra balagina kish kish karia.

MaplePrimes Activity


These are answers submitted by Pseudomodo

You have called NLPSolve with an optimality tolerance of 10^(-35). You may need to either increase that tolerance or increase the working precision so that the given tolerance can be satisfied.

How high you have to set the working precision in order to attain your reduced tolerance may depend upon the conditioning of the particular problem. The NLPSolve command appears to set that tolerance according to Digits, if that tolerance is not specified as an optional argument. But even that deduced pairing might not always work by default, so you might have to control each separately.

It worked for me with no warning and using option optimizalitytolerance=1e-35 and objective expression f, if I first raised the working precision by assigning Digits to at least 42 in Maple 15.

Suggesting raising of Digits might better than mention of the Hessian values, in that warning message.

Have you tried using evalf(Sum(....,k=1..infinity)) instead of sum(....,k=1..infinity) ?

In both examples below, Q is a Matrix of the individual plots. You can show them separately, of call plottools:-getdata on them individually, or in a sequence.

restart: # A 1x2 example

T := plots:-display(Array([plot(sin),plot(cos)])):
Q := map(op,indets(T,specfunc(anything,_PLOTARRAY)))[1];
Q[1,1];
plottools:-getdata(Q[1,1]);
plottools:-getdata(Q[1,2]);
seq(plottools:-getdata(p), p in Q);

restart: # A 2x2 example

A := Array(1..2):
A[1] := plot(sin(x), x=-Pi..Pi, axes=framed, labels=[x, sin(x)]):
A[2] := plot(cos(x), x=-Pi..Pi, axes=boxed, style=point):
B := Array(1..2, 1..1):
B[1,1] := plot3d((1.5)^x*sin(y), x=-3..3, y=-3..3):
B[2,1] := plot3d((1.3)^x*sin(y), x=-1..2*Pi, y=0..Pi, coords=spherical, style=patch):
T:=plots:-display(Array(1..2, 1..2, [[A[1], B[1,1]], [A[2], B[2,1]]])):
Q:=map(op,indets(T,specfunc(anything,_PLOTARRAY)))[1];
Q[2,2];
seq(plottools:-getdata(p), p in Q);

Use procedures to control the flow of your worksheet.

My guess is that when you ran it the first time you had previously issued the command with(plots) to load the plots package.

Your calls to display and pointplot work without loading the package. But your call to the textplot command is different. You could call it as plots[textplot], or plots:-textplot, or as just textplot after loading the package by with(plots).

But if you call it just as textplot, without first loading the package, then it is merely an unevaluated function call and doesn't produce a plot structure.

See Using Packages.

store:=Matrix([[a1, 4.28*x+2.3],
               [CX3, 6.5*x^2 +3*x],
               [S1, a1*CX3+3.1*x-x^3]]);

                              [a1      4.28 x + 2.3    ]
                              [                        ]
                              [             2          ]
                     store := [CX3     6.5 x  + 3 x    ]
                              [                        ]
                              [                       3]
                              [S1   a1 CX3 + 3.1 x - x ]

# You could create it this way in the first place, instead of in Matrix store.
eqlist:= [seq(store[i,1]=store[i,2],i=op([1,1],store)..1,-1)];

           [                       3             2                         ]
 eqlist := [S1 = a1 CX3 + 3.1 x - x , CX3 = 6.5 x  + 3 x, a1 = 4.28 x + 2.3]

# You don't need to assign to the names in order to use the values.
subs( op(eqlist), S1 + a1 );

                             /     2      \             3      
              (4.28 x + 2.3) \6.5 x  + 3 x/ + 7.38 x - x  + 2.3

assign(eqlist);

S1 + a1;

                             /     2      \             3      
              (4.28 x + 2.3) \6.5 x  + 3 x/ + 7.38 x - x  + 2.3

I'm surprised that assign(store[1,1],store[1,2]) didn't work for you. It worked for me (although if using matrix instead of Matrix then success is shown afterwards by examining a1 and not store).

Try

       C1:=subs(SOL, C1);

without the trailing tilde. The tilde is just part of the printing mechanism for the assumed name. You still refer to it as C1.

You don't need all these intermediate steps -- they are just to show you what it's doing.

E1 := y=x*b+z*a+c*i;

                      y = x b + z a + c i

(rhs-lhs)(E1);

                      x b + z a + c i - y

subs(y=R*i, (rhs-lhs)(E1)); # so that R=y/i

                     x b + z a + c i - R i

solve(subs(y=R*i, (rhs-lhs)(E1)), {R});

                     /    x b + z a + c i\ 
                    { R = --------------- }
                     \           i       / 

expand(solve(subs(y=R*i, (rhs-lhs)(E1)), {R}));

                      /    x b   z a    \ 
                     { R = --- + --- + c }
                      \     i     i     / 

subs(R=y/i, expand(solve(subs(y=R*i, (rhs-lhs)(E1)), {R})));

                      /y   x b   z a    \ 
                     { - = --- + --- + c }
                      \i    i     i     / 

expand(E1/i); # of course, this particular example has the following shortcut

                       y   x b   z a    
                       - = --- + --- + c
                       i    i     i     

Like this?

                               
> solve(exp(x)=I,x,AllSolutions);
          
                            1/2 I Pi + 2 I Pi _Z1~

> map(about,indets(%,name) minus {constants}):
Originally _Z1, renamed _Z1~:
  is assumed to be: integer

Or, perhaps, pretending that we do not know of exp()

solve(solve(x=ln(b),b)=I,x,AllSolutions);

Also

> allvalues(RootOf(exp(_Z)=I,_Z));

                            1/2 I Pi + 2 I Pi _Z1~
plot3d(y+2*x^(2),x=0..1,y=0..1+sin(x), axes=boxed);

plots:-display( Array( [a, b] ) );

It would be an improvement if the interior and exterior borders of the inserted GUI layout table could be controlled with the plotting command, instead of being controlled by preferences or after-the-fact mouse action.

That's an unusual definition of Matrix multiplication. Are you sure that you're asking the right question? A few others have been asking about the common linear algebra definition, which is different from the scheme you've described.

You can get what you asked for, like so

a := <<1|2|3>,<4| 5| 6>>;

                                 [1  2  3]
                                 [       ]
                                 [4  5  6]

a * (ArrayTools:-AddAlongDimension@@2)(a);

                               [21   42   63]
                               [            ]
                               [84  105  126]

These might possibly help (taken from a previous question),

restart:

f := x^2: g := exp(-x): d :=unapply(f-g,x):
plots:-display(plottools:-transform(unapply([x,y+g],x,y))(plot(d,
                  0 .. RootFinding:-NextZero(d,0),
                  filled=true)),
               axes=boxed, labels=["x","y"],view=[0..1, 0..1]);

restart:

f := x^2: g := exp(-x): d :=unapply(f-g,x):
inter := RootFinding:-NextZero(d,0):
plots:-display(
   plots:-implicitplot( x^2 >= y, x=0..inter, y=0..1,
                        filledregions=true, gridrefine=2,
                        coloring=["white","white"] ),
   plots:-implicitplot( exp(-x) >= y, x=0..inter, y=0..1,
                        filledregions=true, gridrefine=4,
                        coloring=["red","white"] ),
                  axes=boxed, labels=["x","y"], view=[0..1, 0..1]);

restart:

f := x^2: g := exp(-x): d :=unapply(f-g,x):
inter := RootFinding:-NextZero(d,0):
plots:-implicitplot( (y - f)*(y - g),
                     x=0..inter, y=0..1,
                     filledregions=true, gridrefine=4,
                     coloring=["red","white"],
                     axes=boxed, labels=["x","y"],
                     view=[0..1,0..1] );
> sys:={-(diff(y[1](t), t, t))*sqrt(y[1](t)^2+y[2](t)^2)^3/y[1](t) = 0,
>       -(diff(y[2](t), t, t))*sqrt(y[1](t)^2+y[2](t)^2)^3/y[1](t) = 0}:

> ics:={y[1](0) = 1, y[2](0) = 0, (D(y[1]))(0) = 0, (D(y[2]))(0) = 1}:

> dsolve(sys union ics); # no result, ie. NULL

> cand:=dsolve({-(diff(y[1](t), t, t)) = 0, -(diff(y[2](t), t, t)) = 0,
>              y[1](0) = 1, y[2](0) = 0, (D(y[1]))(0) = 0, (D(y[2]))(0) = 1});

                           {y[1](t) = 1, y[2](t) = t}

> odetest(cand,sys union ics);

                              {0}

Another example,

> restart:

> sys:={-(diff(y[1](t), t, t))*(y[1](t)^2+y[2](t)^2)^3/y[1](t) = 0,
      -(diff(y[2](t), t, t))*(y[1](t)^2+y[2](t)^2)^3/y[1](t) = 0}:

> ics:={y[1](0) = 1, y[2](0) = 0, (D(y[1]))(0) = 0, (D(y[2]))(0) = 1}:

> dsolve(sys union ics);
                   {y[1](t) = 1, y[2](t) = t}

> restart:

> sys:={-(diff(y[1](t), t, t))*sqrt(y[1](t)^2+y[2](t)^2)/y[1](t) = 0,
>       -(diff(y[2](t), t, t))*sqrt(y[1](t)^2+y[2](t)^2)/y[1](t) = 0}:

> ics:={y[1](0) = 1, y[2](0) = 0, (D(y[1]))(0) = 0, (D(y[2]))(0) = 1}:

> dsolve(sys union ics); # NULL result

Why does the taking the sqrt() or a sum of squares cause a problem, when all that is needed is the implication that the other factors of the numerators (2nd derivs) must be identically zero?

Some ideas. (note: includes examples like 9/7 -> 1 + 2/7 and 4/8 -> 1/2)

a := rand(1 .. 15):
b := [`+`, `-`, `x`, `/`]:
c := rand(1..4):
f:=proc() local i,A,B,S,oper;
   oper := b[c()];
   if oper = `/` then
      do
         A:=a(); B:=a();
         if A<>1 and B<>1 and (A>B or gcd(A,B)>1) then
            break;
         end if;
      end do;
   else
      A:=a(); B:=a();
   end if;
   S := sprintf("%a%s%a = _____      ",A,oper,B);
   printf("%s%s",S,cat(seq(" ",i=1..20-length(S))));
end proc:

for i to 15 do
  seq(f(),j=1..4);
  printf("\n\n"):
end do;


8-1 = _____         3/6 = _____         8+12 = _____        6+9 = _____         

13+4 = _____        4/2 = _____         3+14 = _____        14/3 = _____        

5x9 = _____         15-5 = _____        2x4 = _____         6+6 = _____         

6x15 = _____        9/7 = _____         7-8 = _____         3+5 = _____         

7-9 = _____         1-11 = _____        15x10 = _____       15-2 = _____        

4/8 = _____         2+11 = _____        14+15 = _____       8x1 = _____         

8-11 = _____        2/6 = _____         4-3 = _____         7x3 = _____         

6+14 = _____        13+5 = _____        7-3 = _____         2-14 = _____        

4+1 = _____         2-2 = _____         9x9 = _____         5-11 = _____        

15+2 = _____        11-9 = _____        5+10 = _____        6-15 = _____        

9/9 = _____         10+1 = _____        6+6 = _____         8-5 = _____         

7-4 = _____         1+7 = _____         6/3 = _____         10-12 = _____       

14x6 = _____        6-2 = _____         2-15 = _____        15/10 = _____       

9/5 = _____         7+6 = _____         7-8 = _____         13-15 = _____       

15x7 = _____        14-3 = _____        14/9 = _____        2x13 = _____        

1 2 3 Page 1 of 3