Axel Vogt

5821 Reputation

20 Badges

20 years, 229 days
Munich, Bavaria, Germany

MaplePrimes Activity


These are answers submitted by Axel Vogt

I was just playing with it again, for P = 0 there are various solutions.

  eval(eqs,q=0); fsolve(%, indets(%,symbol)); 
  fnormal(%): simplify(%,zero); # this cleans up the numerical results
  R:=identify(%);               # and gives a nice appearance

     {C19 = 0, C4 = C4, C5 = -C8, C8 = C8, C13 = -C16, C12 = C12,
      C16 = C16, C20 = C20, C24 = C24, C28 = C28, C32 = C32, C7 = 0,
      C31 = 0, C29 = -C32, C15 = 0, C23 = 0, C17 = -C20, C25 = -C28,
      C11 = 0, C3 = 0, C27 = 0, C1 = -C4, C9 = -C12, C21 = -C24}

  eqs: eval(%,q=0); eval(%, R); # shows the system is satisfied

  equations: eval(%,P=0); eval(%, R); # dito, for original problem

The solution show some stuff like "C4=C4". This usually means, that those
variables can be choosen independently.

Let us try that through 2 examples:

Set C4=2 in R, feed it into your system and use P=0. Then all except the
C4 is replaced. Now solve for that (and see it gives C4=2 as desired):

  eval(R, C4=2): eval(equations, %): eval(%, P=0); 

     {-2. + C4 = 0, -0. = -0., 0 = 0., 0 = -0., 0. = 10. - 5 C4,
      -2. + C4 = 0., -0. = 0, 0. = 0, 0. = 0., 0 = 0}

  solve(%, C4);
                              {C4 = 2.}

  # just for fun ...
  eval(R, [C4=Pi, C8=sqrt(2)]): eval(equations, %): eval(%, P=0);  
                      1/2            1/2
     {-1. Pi + C4 = -1. 2    + C8, -1. 2    + C8 = 0., 0. = 5. Pi - 5 C4,

      -0. = -0., 0 = 0., -1. Pi + C4 = 0, 0 = -0.,
                1/2
       0. = 5. 2    - 5 C8, 0. = 0, 0. = 0., -0. = 0, 0 = 0}


  solve(%, {C4,C8}); identify(%);

      {C4 = 3.1415926535898, C8 = 1.4142135623731}

                                1/2
                         {C8 = 2   , C4 = Pi}

A check shows that this is (of course?) correct, using

  eval(R, [C4=Pi, C8=sqrt(2)]): eval(equations, %): eval(%,tmp): eval(%, P=0);

     {-0. = -0., 0 = 0., 0 = -0., 0. = 0, 0. = 0., -0. = 0, 0 = 0}



Now ... I think that especially menas, that you will have problems to judge
the situation for P = sqrt(q) close to zero, at least numerical it is odd:
Choose some q (=dummy) of small size, insert it into eqs, call it tmp:

  dummy:=1/Float(1, floor(Digits*0.4) + 1);
  'eval(eqs,q=dummy)'; 
  tmp:=%;  
  #indets(tmp,symbol); nops(%); nops(tmp);

Now we lost 1 indeterminate, but fsolve wants #equations = #indeterminates.
Staring at the system lets me try to remove the first one and to solve for
the rest - which are the C's, the solution set is named M:

  tmp: convert(%,list): {seq( %[i], i=2 .. nops(%))}: 
  M:=fsolve(%, indets(%,symbol),fulldigits); lprint(%);

Then I feed it into the equations, set q = dummy to see it is satisfied
(writing the equations as lhs - rhs = 0), at least numerical (as allays here):

  'eval(equations, M)'; 'eval(%,P=dummy^2)'; evalf(%): 
  map( t -> lhs(t)-rhs(t),%); 
  fnormal(%);
  
                    eval(equations, M)|
                                      |         2
                                      |P = dummy

                              {0., -0.}

Doing the same with P=dummy^2/2 this is *not* seen as solution. Which says
that it is not simply satisfied, because P is small.

However using 0 .. 1e-4 as range for q in fsolve for a direct result did not
terminate within a time I was willing to wait.

So I think you need an additional reason, why the above practical does not
apply, if you want to use P ~ 1.66 as appropriate value.
Using the differential operator 'D' (may be using convert(expr,D) first)
it is simply D(u*v).

Explanation: Maple seems to 'understand' how basic operations have to be
applied to functions.

  t:='t':

  someConstants:=[0,1,2,evalf(Pi), Pi];
  for b in someConstants do
    p:=b;
    print('p'=p, 'p(t)'=p(t));
  end do:

                           p = 0, p(t) = 0

                           p = 1, p(t) = 1

                           p = 2, p(t) = 2

                 p = 3.141592654, p(t) = 3.141592654

                         p = Pi, p(t) = Pi(t)

So if the constant is not a symbol like Pi an assignment like p:=2 is 
understood as a function taking that constant as value. And no, it would
not work for the Natural for example:

  assume(n::integer): getassumptions(n);
  p:=n;
  p(t);

                                p := n

                                 n(t)

The identity one has to define extra by (id: x -> x works very reliable):

  id:=unapply(x,x);

                             id := x -> x

  'id( t )': '%'=%;
  'id( exp(sin(tau)) )': '%'=%;

                              id(t) = t

                  id(exp(sin(tau))) = exp(sin(tau))


This also works (formally) for the basic arithmetic operators:

  ArithmeticOperators:=[`+`, `-`, `*`, `/`, `^`];
  for b in ArithmeticOperators do
    p:=b(u,v);
    print('p'=p, 'p(t)'=p(t));
  end do:

                    p = u + v, p(t) = u(t) + v(t)

                    p = u - v, p(t) = u(t) - v(t)

                      p = u v, p(t) = u(t) v(t)

                                         u(t)
                         p = u/v, p(t) = ----
                                         v(t)

                            v             v(t)
                       p = u , p(t) = u(t)


Thus u*v is understood as the function t -> u(t)*v(t) and since Maple
expand automatically (otherwise: enforce it) one can simply write:

  D(u*v);
  %(t);
  convert(%,Diff);
                           D(u) v + u D(v)

                     D(u)(t) v(t) + u(t) D(v)(t)

                   /d      \             /d      \
                   |-- u(t)| v(t) + u(t) |-- v(t)|
                   \dt     /             \dt     /


The last command is onlyto show it in more common notation.

I think it does not, since it picks just one ...

Here is what I did (within your sheet using Digits:=14 [which has
no extra cost usually])):

  # the equations are in sqrt(P), eliminate that
  equations:
  convert(%,rational):
  eval(%,P=q^2): simplify(%) assuming 0 < q: evalf(%):
  
  eqs:=%; # now sqrt(P) is just q, we want to know q


  eqs:
  fsolve( %, indets(%,symbol), q=0..sqrt(10));
  select(has,%,q);
  rhs(op(%))^2; # P = q^2

                        {q = 1.2893925628043}

                           1.6625331810150

This seems to be returned quite quickly (which is your P).


For iterations (may be not needed here) I would try something like

  eqs:
  fsolve( %, indets(%,symbol), q=0..sqrt(10));
  select(has,%,q);
  rhs(op(%)):
  P=%^2;
  qNew:=%%;
  
  # use it as new starting value and a limit for
  # computational time
  sols:=timelimit(10,
    fsolve( eqs, indets(eqs,symbol), q=0..qNew));
  
  select(has,sols,q);
  rhs(op(%)):
  P=%^2;
  qNew:=%%;


Can not see, whether your system has a (constant?) periodics in P.


I think the general problem is (even for your case over the Reals):

If #equations = #variables, then the generic solution constists of
isolated points. One can neither expect that these are finite in
number (say: you have periodics). Nor does one know a priori that
all are catched even for the compact (=finite) case.

And an additional condition may easily mean: you have to search the
space of solutions (=closest to zero and positive, real).

If your system is algebraic (=given by polynomial equations) then
you might try the Gröbner basis methods in Maple, to describe the
zero dimansional variety (no, I never seriously worked with it).

Since your system is analytical for that you either would transform
it to an algebraic one (if ever possible) or approximate it (not so
claer what has to be done, except you know some location for your
desired solution), do not know of Maple has s.th. for analytical
given zero-dimensional varieties (=discrete points as intersection
of analytical functions) - even if that is mathematical equivalent
to an algebraic situation (locally).


For short without pseudo-smart blabla: seems you have to search the
solutions for the appropriate one, no guarantee for completeness.

in general indexed variables may give troubles ...

for the other point take care: similar to Math there is a difference between a polynomial and a polynomial function,
and you want to use 'unapply' as suggested

edited to add: i think you can not do (easily) it for indeterminate values of m and n and work with it

i said 10 - P, not -P ... sometimes a starting value (and not a range) is better ... may be you upload & link to your file and somebody has a suggestion

If I understand you correctly ... how about changing variables?
Say your range is 0 ... 10 and P is your then I would try to look for Q:=10 - P.

it is of type of a sum of 2 integrals, where each becomes infinite but together they give a finte value

indexed variables actually are functions in a mathematical sense (but defined for example on the Naturals):

a: IN -> IR just stands for a real sequence ...

As a procedure you may try:

A:= proc(n)
 option remember;
 if n=1 then return 1 end if;
 if 1 < n then
 procname(n-1) + 1/2^(n-1); # = A(n-1) + 1/2^(n-1) 
 end if;
end proc;

A(3);
                                 7/4
and for solving the recursion (note that a function notation is used):

rsolve({a(n) = a(n-1) - 1/2^(n-1), a(1)=1}, {a});
                                         n
                          {a(n) = 2 (1/2) }

To read more about 'rsolve' check the help (for example in a classical sheet
just highlight that using the mouse and press the F1 key)

As far as I know there is none. And hopefully there never will be one. Get used to it.

I know that some parts are hard to read (too stylish and sometimes complicated
grammar, long sentences or rare vocabulary).

But the following may help: dict.tu-chemnitz.de/

After playing with it (without taking books at hand) the last idea for something like that
was a CauchyPrincipalValue, but give up to leave it to adults ...

Here is a lame way to find the value to be proved:

Int((1/(exp(x)-1)-1/x+1/2*exp(-x))/x,x=0..infinity): 
evalf(%); 
exp(%): identify(%): ln(%): simplify(%): combine(%,ln);
                          -0.91893853320467

                            -1/2 ln(2 Pi)

Doug Meade is right in guessing my mood :-) And as long as you do not write down your results ...
you are supposed to do both, the Math and Maple.

Well:

a) Take paper and pencil. Yes, take it.

b) For (2) write down in *words* what must be satisfied for each component and what that means for 'a'.

c) Write it down as formulae (including the logic).

d) Now translate to Maple: if you are familiar with it - fine. Otherwise try to look it up searching for keywords
and the Intro

e) Start over for (3)

 

well, just try to type it in Maple and use that to look up the help (or the manual) like solve( 0 <= 1 - 4*x, x) ... and care for all operations to result in Reals, not only square roots

what is your paper solution? it has "just" to be translated into Maple's language

why not using an array?

may be the following example helps a bit:

 

Download 102_some_pdf_fitting.mws
View file details

(sorry, not quite clear how the new editor handles attachments)

First 80 81 82 83 84 85 86 Last Page 82 of 92