Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 361 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Deltafee Please upload your worksheet so that I can diagnose the problem. Here's my doing of it:

 

Data:= [[.158, 0.2e-1], [.159, 0.2e-1], [.161, 0.3e-1], [.164, 0.3e-1], [.166, 0.3e-1], [.169, 0.4e-1], [.173, 0.6e-1], [.178, 0.8e-1], [.185, .1], [.187, .11], [.193, .14], [.2, .19], [.21, .28], [.223, .38], [.233, .44], [.244, .58], [.256, .82], [.278, 1.4], [.281, 1.71], [.282, 1.78], [.282, 1.78], [.282, 1.81]]:

X:= Data[..,1]:

Y:= Data[..,2]:

f:= a+b*x^c+d*x^e:

Statistics:-NonlinearFit(f,X,Y,x);

 

 

Download NonlinearFit.mw

Your system is so large that I don't think that there's much hope for dsolve being able to handle it. The size of sys as measured by length({sys}) is over 2 Gig. That's so large that the length command itself takes several seconds to finish.

@acer How much of the computation of evalf(3/Pi, 1) is done in evalhf? Is it just the numeric evaluation of Pi?

@ecterrab My opinion is that it is an improvement---above and beyond the call of duty.

@Deltafee It should be

sol[1]:= Statistics:-NonlinearFit(f, xlist, ylist, x);

This is only a partial explanation: Since Digits is less than 16, the computation evalf(3/Pi, 1) is done in hardware double precision (evalhf mode). This makes it harder to see what's going on, because the debugger shows nothing. That being said, I consider the 0.9 result a bug.

@danlun I was not suggesting that my code

(expand@@2)~(expr1);

was a means to simplify your expression. It was a side-comment only relevant to Markiyan's code.

@Christopher2222 "...powers of cos(x)...."

@nm Perhaps one can get a numeric solution from dsolve after converting to a differential equation (if the conversion is possible). Even for symbolic solution, dsolve can solve many nonlinear equations, and is much more powerful than intsolve.

@Markiyan Hirnyk wrote:

map(proc (c) options operator, arrow; expand(c) end proc, op(expr1)):
map(proc (c) options operator, arrow; expand(c) end proc, op(map(proc (c) options operator, arrow; expand(c) end proc, op(expr1))));

These steps are not valid transformations! The op causes a drop of all factors or terms other than the first. Indeed, your final answer is just the first term of the expansion of a subpart of the original expression. If you take out the ops, it is valid, and it is equivalent to simply

(expand@@2)~(expr1);

or

map(expand@@2, expr1);

I notice that problems 1 & 3 have been fixed today. I haven't had a chance to verify 2 & 4.

@Markiyan Hirnyk The source of the error is competely different in this question.

@Markiyan Hirnyk It is often easier to simply answer a Question than to look up a reference.

@litun 

restart:
Bstar := 3.60/(12.0+s)+14.00/(20.0+s):
Nrot := [-23.8279785337007-4.37234259951331*I,
      -23.8279785337007+4.37234259951331*I,
      -13.8480664440518,
      -12.2635728941426-2.65264168833545*I,
      -12.2635728941426+2.65264168833545*I,
      -4.24998018723859]:
rfw := unapply(mul(-Bstar*gm[i]+1, i = 1 .. 6), s);
for i to 6 do b[i] := rfw(Nrot[i]) end do;

Introduce an extra variable G as the sum of the others:
Sol:= {solve({seq(b[k], k= 1..6), G= add(gm[k], k= 1..6)},
 {seq(gm[k], k= 1..6), G})}:
map(x-> eval(G, x), Sol);


I can't think of a way to limit the number of solutions.

@stasya I think that you should use the definitions provided by Markiyan. Note that function has a very precise definition within the Maple language itself (which you can see at ?function ), and that this definition is somewhat counterintuitive. A procedure or routine is definitely not a function under this definition.

First 595 596 597 598 599 600 601 Last Page 597 of 709