Carl Love

Carl Love

28070 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

For what it's worth, I can find nothing wrong with your code. It looks like you've run into a bug in dsolve. Even if your dsolve call is simplified to

dsolve(eval(sys, `ε`= L[0]), numeric)

the same error message appears. I haven't been able to figure out a workaround.

Your command is correct. To diagnose further, I need to see this "bunch of dashed lines". Can you upload a picture?

One way to upload a picture would be to right click on the graph and select Export-> PNG. Then use the green uparrow in the toolbar of the MaplePrimes editor to upload it.

@MTata94 

1-D Math Input means that the characters that you type are exactly what occurs in the expression, and they occur from left to right at your cursor. Most (not all) of the oldtimers here at MaplePrimes use 1-D Math Input in one of the three User Interfaces (UIs) offered by Maplesoft: Standard, Classic, or Command Line. I use 1-D with Standard. To select this, go to the Tools-> Options menu. Select the Display tab. In the first pull-down "Input Display", select "Maple Notation". Go to the Interface tab. In the fourth pul-down "Default format for new worksheets", select "Worksheet". The click Apply Globally. Then open a new worksheet.

@85951971 

If you want to select the model based on the lowest residuals, it is possible to do that automatically, but not necesarily advisable. It is very tricky with nonlinear models: There are often parameter choices that give a local minimum for the residuals which are far from being a global minimum. Maple's Statistics:-NonlinearFit (and all nonlinear parameter fitting software that I am aware of) very often returns one of these local minima.

Take a close look at Markiyan's answer. The program that he used is called DirectSearch:-DataFit (the DirectSearch package must be downloaded from the Maple Applications Center). His correct piecewise interpretation of the spherical model gives a good fit. Notice the first number in the output of DataFit. That is the total residual. From all the fitmethod choices offered by DataFit, Markiyan hand selected the one with the smallest first number. It would be easy to automate that.

Markiyan (who is from Ukraine) has an excellent knowledge of English. If you write in correct English with correct spelling and punctuation and without hipster slang he will understand you.

@Rouben Rostamian  

Thanks Rouben. It's very impressive.

@Preben Alsholm 

If I simply differentiate eq2 and use a DAE method, then I get the same solution as your "Alternative solution". It would seem like the loss of information caused by differentiating the constant would make this method not work, and yet the differences between the two numerical solutions are insignificant (on the order of 10^(-8)).

I simply used

solution2:= dsolve([diff(eq1, t), eq2, CI], numeric, method= rkf45_dae);

Do you have any idea why this works?

@MDD In other words, the list of monomials needs to be generated automatically, and needs to be in the correct order.

@acer I updated the Answer. I can find no significant difference in the times when hits are unlikely, and, yes, there are other factors to consider that my timing test does not address. I understand and appreciate your argument based on clear coding style.

In the more likely case that hits are likely, I found that the assigned method is significantly faster.

@Markiyan Hirnyk 

Yes, it is not necessary to assign the plot to a variable and then display it. Simply using the odeplot command, without assignment, is enough.

@Wolff 

The dialog box can be manually moved to reveal the whole plot. But that's a pain to do every time.

Here's a completely different idea: Put the plots in an animation, and step through them in single-frame mode, like a slideshow:

Test:= proc(j)
local x;
     plot(x^j, x= -2..2)
end proc:

plots:-display([seq(Test(k), k= 1..3)], insequence);

@digerdiga If you want to apply D to the identity function, use D(x->x)(x) or D(x->x). Both will return simply 1.

Consider the analogy: If D(f)(x) = diff(f(x),x) then D(x)(x) = diff(x(x), x). The subexpression x(x) doesn't have any mathematical meaning that I am aware of.

@Glowing 

Stopping Maple is a complicated topic which probably deserves its own thread. Always try the red stop button first. It does work in many/most cases. If that doesn't work, then you'll need to use a task manager (such as Windows Task Manager or "top" on Linux) to find out what process is actively running and explicitly kill it. Killing a kernel (mserver) is relatively painless---you can still save your worksheet and make a full recovery. Killing the GUI is painful. All your worksheets will be killed and they can only be recovered up to their last autosave. 

@Wolff 

What do you mean by "there is no simple possibility to have a break in a loop"? Isn't that what my first code provides?

@acer The dialog box pops up near the center of the main window. If the last output was a plot, it will likely be obscured by the dialog box. A workaround is to send the plots to plot windows:

Test:= proc(j)
local x;
     plot(x^j, x= -2..2)
end proc:

plotsetup(window);
for j to 3 do
     print(Test(j));
     print(`Press RETURN to continue.`);
     readline(-1);
end do:
plotsetup(default);

@Alejandro Jakubi 

In Standard, I find no way to read from the keyboard without a dialog box, which I hate. For one thing, the box often obscures the output. Do you know a way to do it? It may be iolib(n, ...for some integer n.

First 485 486 487 488 489 490 491 Last Page 487 of 709