Christopher2222

MaplePrimes Activity


These are replies submitted by Christopher2222

@tazatel 

f:=unapply(f,x);

F:=map(F,X)

@Markiyan Hirnyk  thanks for the upvote

The addition of the sine waves I was going to add is simpler than I thought at the time. 

p4 := plot(h+f, x = 800 .. 2000, color = black, view = [800 .. 2000, 60 .. 75]):
display(p1,p4)

@lemelinm You could do something like what I've done here http://mapleprimes.com/questions/207815-Fit-Data-To-Sine-Function-Off

Sorry I don't have time to organize I'm late for work.  I'll post quickly what I have.

 

f := Fit(a1*sin(b1*x+c1)+d1, X, Y, x, initialvalues = [b1 = 0.1e-1])

#X and Y being your data values

I used initalvalues b1=[.01] (that was just trial and error to see what fits best) and i got

f := -1.27901961747989*sin(0.704053529899334e-2*x-.805563273536467)+68.9713260764563

plotting with your data looks something like this.

I can fill in the holes later, but others might chime in before then.  Hope this helps :)

 

@Markiyan Hirnyk 

Using your reference link and part of Preben's answer increasing the number of contours does not produce the L4 and L5 points which I am guessing now have to be produced by introducing more equations?

Curiously from a cited reference, can maple draw the potentials as shown below?

 

 

ok, I just wanted to see if relatively simple formulation approximation of sine could be found to match the given data.  Outside of the given years the data is most likely not periodic so fitting the data to a function of just sine would be a terrible thing to do. 

Yes. setting boundary conditions on the values makes DirectSearch gives us a reasonable solution.

@Markiyan Hirnyk firstly,  "find a fourth-degree polynomial approximation" .. I'm not following the example just using the data.  As for the rounding, I have no idea why the author rounded it off.  I transcribed the rounded off data. 

 

@Markiyan Hirnyk sorry, you are confusing the graph and table on the same page, the graph corresponding to that table 4.2 is Figure 4-20 not 4-18. 

Thanks to everyone for all the replies.  Mac Dude your suggestion about starting values pushed me towards the right direction.

@Markiyan Hirnyk re: reference - Table 4.2 in the book Maple by example.  Source of the information unknown. 

@Axel - second pass?  I see what you mean about the outliers, I suppose those could be removed or I could add in a weight option and weight the other points more heavily then just run again.  I think that's what you mean by second pass.  

@steve44 not everyone knows how to post properly and the forum itself has nothing to do with it.  Please extrapolate your comment if you wish to get any constructive action out of it.

Be careful though, you having only contributed 1 question to this forum your response above might ironically get yourself moderated.

 

@Markiyan Hirnyk

I didn't think the phase shift of the sin function, c, would matter too much, maple would figure that out quite easily, as well the amplitude, a, and the offset d.  The frequency, b, I could understand Maple having some uncertainties and would need to have some direction in that respect.  After that it was only a matter of deciding what to choose and just based on observation a low value seemed about right as tested higher ones didn't seem quite right but without visually seeing a graph I wouldn't know if it was a proper choice. 

re:reliable fitting for 19 points. 

Since we only have 19 points to deal with I work as best I can with what I have wether it's reliable or not.  We will have a close enough approximation.  For interest sakes, the data is the percentage of petroleum products imported into the U.S. I chose to represent the given snapshot datapoints by a sine function.

Thanks for the replies much appreciated.

It turns out determining the initial value of b is the most important variable to help nudge Maple in finding an answer.

As it turns out my adhoc estimation was fairly close to what Maple gave me.

 

f := Fit(a*sin(b*x+c)+d, X, Y, x, initialvalues = [b = .5]);
         f := 7.52415509047394 sin(0.485293180840164 x + 1.76994325375001)  + 35.3885238224729

display(a1,a2)



Most likely you would notice smoother display animations after the completed animate command, but not a speed up executing the animate command while waiting for the plot window to open.

Basically the CPU calculates all the animations.  The graphics card handles displaying all those calculations.

You'll end up with a smoother animated display and a quicker response but I don't think the animate command will finish the calculations sooner.

Curiously, what is your laptop configuration ... Model, RAM, CPU and operating system.

It allows me to remove or add tags but when I press Save Tags, nothing happens.

First 64 65 66 67 68 69 70 Last Page 66 of 162