Carl Love

Carl Love

28110 Reputation

25 Badges

13 years, 121 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@adel-00 By "shorter form" I mean that it should be

P:= plot(Spec, -15..15, ...);

not

P:= plot(Spec(d), d= -15..15, ...);

The shorter form is also called the "procedure form" of the plot command.

Also note that this command will not actually show the plot. That will be done by the print command after the curve is normalized by the maximum.

@danlun So the question is to find the x that makes it true, if possible.

The factorization of a polynomial with rational coefficients into its irreducible (prime) factors is unique. Thus, just apply factor to the large polynomial, as yesterday, after correctly adding the multiplication signs. If your desired factors don't pop out, then it's not possible.

@adel-00 The commands above are meant to come after the plot command, which must be assigned to a variable. Like this:

P:= plot(Spec, -15..15, ...the rest of your plot options):

A:= op([1,1], P):  #The data matrix from the plot
Smax1:= max(A[..,2]):
A[..,2]:= A[..,2]/Smax1:
P:= subsop([1,1]= A, P):
print(P);

Note the form of the plot command! It is not plot(Spec(d), d= -15..15, ...). When I use the shorter form and the parameter values theta:= Pi/3; phi:= Pi; then it runs in 62 seconds---long, but not unreasonable.

Please let me know if you can make the above work.

@Bendesarts wrote:

The system is a ODE with 15 parameters and many trigonometric function for the coefficients. It's big but for a a mechanical system a bit complex is not huge.

One point which makes the system looks like very big comes from the fact that i have copy the matrix with copy/paste for my code where i have applied machanical theorem so as to obtain the equations. When you do like this, the copied matrix are good but they looks likes with a strange form which takes a lot of place.

My assessment of the size of the system is based purely on the length command and not on visual appearance of your matrices. The length of 2 Gig means that if your system were printed out, it would be more than 100,000 pages. I don't think that's what you meant by "big...but not huge". The huge size is the result of inverting 12x12 matrices with symbolic entries, and then multiplying those inverses by other symbolic matrices.

I have a feeling that you canuse numeric dsolve before doing the inverses and then invert numerically. But I don't know exactly how to do it.

@Deltafee Your commands are correct. Your final result is quite different than mine. However, it may fit the data just as well. Nonlinear fits can have many local minima, and yours just converged on a different point than mine.

@nm Very good. I vote up. You'll soon have enough points to edit your posts.

@nm Include the discont option in the plot.

@Bendesarts wrote:

The system is a ODE with 15 parameters and many trigonometric function for the coefficients. It's big but for a a mechanical system a bit complex is not huge.

One point which makes the system looks like very big comes from the fact that i have copy the matrix with copy/paste for my code where i have applied machanical theorem so as to obtain the equations. When you do like this, the copied matrix are good but they looks likes with a strange form which takes a lot of place.

My assessment of the size of the system is based purely on the length command and not on the visual appearance of your matrices. The length of 2 Gig means that if the system were printed out, it would be nearly 1,000,000 pages long. The complicated expressions are the result of the inversion of 12 x 12 symbolic matrices.

I have a feeling that there is some way to solve the differential system first and then invert numeric matrices. But I don't know exactly how to do it.

I notice that problem 2 is now fixed. I haven't checked #4.

I've discovered several more bugs:

  1. While editing a Reply, I clicked Preview. The Preview is shown, but then you're stuck---pressing Submit, Preview, or Cancel does nothing.
  2. Replies (not Answers) to a Question are not necessarily listed in chronological order. See the thread http://www.mapleprimes.com/questions/200004-Creating-A-Smooth-Curve-From-Data-Points
  3. Output from uploaded worksheets does not display correctly.
  4. Using a question mark in the editor to create a hyperlink to a help page does not work.
  5. When converting an Answer into a Comment, the Answer's Replies are deleted. They should be carried over as additional Comments.

@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.

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