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

@tkeith022 

There is an error at the very beginning of your worksheet such that I can't proceed until you correct it. Note that this error appears in the worksheet as you sent it; it's not the result of me executing the worksheet.

get_parameter := proc (text_id) parse(DocumentTools:-GetProperty(text_id, 'value')) end proc; with(DocumentTools);
with(Database[SQLite]):
connection := Open("test.xlsx");

Error, (in Database:-SQLite:-Open) file is encrypted or is not a database

Also, I don't see any SQL. If all you're doing is importing some Excel data to plot, use Maple package ExcelTools. (But perhaps you were intending to add the SQL later?)

@kippendorf 

Here's an example of using a piecewise g:

solnb:= unapply(
     eval(soln, g= (tau-> 3*piecewise(tau < 20*Pi, cos(omega*tau), sin(omega*tau)))),
     omega
);

@kippendorf 

You wrote:

solnb := unapply(eval(soln, g(tau) = 3*cos(omega*tau)), omega);

This is a fairly common error. The problem with that statement is that it only substitutes for subexpressions that are literally g(tau); whereas what you want (I presume) is to substitute for all occurences of g used as a function symbol, including the g(0). The solution is to substitute a procedure (an arrow -> expression) for g itself, like this:

solnb:= unapply(eval(soln, g= (tau-> 3*cos(omega*tau))), omega);

Note that a counter-intuitive extra pair of parentheses are required around the arrow expression (the right-hand side of the equals sign) because -> has lower syntactic operator precedence than = (thus allowing the definition of procedures that return equations without requiring extra parentheses, FWIW).

By the way, this produces a beautiful plot (looks much better in a worksheet than here):

@tomleslie 

There are no syntax errors in the originally posted code upto the final eval. What appeared to you as syntax errors were the result of the input and output being interlaced, with the output in a 1-D plaintext form. What did you think was my purpose in writing this, the first paragraph of my Answer?

It'd be better if you didn't include the output in your Questions until you learn how to properly format it. Just the input and error message are usually enough to get an Answer here on MaplePrimes.

Regarding the relative times shown on posts: There is a bug such that when a post is between one and two hours old, only the minutes into that second hour are shown.

 

@Les 

Your plots are nice. It had never occurred to me that one could use the actual axes and tickmarks from a 2-D plot to draw a 1-D number line (although I've done the analogous thing going from 3-D to 2-D many times). Here's an improvement to your coding style; this produces exactly the same plot. You can reduce the redundancy of your code by putting the values in a list outside the plot command and using seq for both the points and the tickmarks.

V:= [-sqrt(10), -(7^(1/3)), Pi/99, sqrt(2), exp(1), Pi]:
plots:-pointplot(
     [seq([x,0], x= V)], view= [-5..5.8, 0..1e-5],
     symbolsize= 20, symbol= solidcircle, colour= blue,
     xtickmarks= [seq(evalf(x)= typeset(x), x= V), 5.8= typeset("Irrational Nos.")],
     scaling= constrained
);

 

@Markiyan Hirnyk 


restart:

with(Student:-MultivariateCalculus): P:= Plane([A,B,C], <u,v,w>);

Student:-MultivariateCalculus:-Plane(Vector(3, {(1) = u, (2) = v, (3) = w}), [A, B, C], variables = [x, y, z], id = 1)

Distance([a,b,c], P);

abs(-(a-A)*u-(b-B)*v-(c-C)*w)/(abs(u)^2+abs(v)^2+abs(w)^2)^(1/2)

kernelopts(version);

`Maple 18.02, X86 64 WINDOWS, Oct 20 2014, Build ID 991181`

 


Download PtPlane.mw

Search "adomian" using the MaplePrimes search bar on this page. Look at the top two hits. That may cover "how to find the polynomials separately using Maple."

@maple2015 

You asked:

Is there a way to neglect redundant equations for minimizing FW?

Yes, I came up with something...two things really. Since the solutions from solve will be parametrized with b[2] as the parameter, we can set b[2]:= 1 from the start. Since the equations are all rational functions equated to 0, we can extract the numerators and just equate them to 0. These two efficiencies improve the solution time by roughly a factor of 10.

restart:
Digits:= 30:
m:= 5:  g:= 0.3:  nu:= 0.2:  a:= 1:
b[2]:= 1.:
w:= unapply(add(b[n]*cos(n*r), n= 1..m), r):
W:= simplify(eval(w(r), solve((D@@2)(w)(1) + nu*D(w)(1), {b[1]}))):
d1:= diff(W,r):  d2:= diff(d1,r):
F:= int(((d2+d1/r)^2-2*(1-nu)*d2*d1/r)*r*(1+g*r/a)^3, r= 0..a)/int(d1^2*r, r =0..a):
Eqns:= {seq(eval(diff(F,b[n]), r= n/m), n= 3..m)}:
Sol:= solve(numer~(Eqns), {b[n] $ n= 3..m}):
remove(has, map2(eval, F, {Sol}), I); #remove nonreal solutions



 

@maple2015 

You eliminate b[1] with your first solve. Is there something special about b[1], or could you have chosen to eliminate any of the bs at that point? And, if so, would you still use r=1 to do it?

How did you come up with the weird exponent 2+.262*n?

Nor are Replies indexed by Google. Just having the whole site indexed by Google would be enough to fix the problem; there'd be no real need for search within MaplePrimes.

@Markiyan Hirnyk You'll have to ask the OP for the full example. I don't know how to use the Database package (which has the SQL commands). Nor do I know how to send a plot to a static position, either in the worksheet or in a separate window. All that I knew about the matter was the one key detail that the OP needed for the project.

@Markiyan Hirnyk 

You'll notice that I asked the OP several followup questions before I Answered. That was so that I could find out, despite the OP's limited English, what their true issue was. That true issue has only a little to do with what you quoted. The OP is obviously happy with the Answer that I gave, so what's your point? Why are you criticizing?

Speaking of criticizing, I'd like to point out that your so-called "precedent" had nothing to do with what was asked.

@Markiyan Hirnyk All that was asked is how to produce the delay continuously, which is all that I Answered. The OP presumably knows the plot command for what they want to plot. That command wasn't provided in the Question.

@Markiyan Hirnyk 

Maple's random numbers are reproducible. For example, if you execute the code below, you should get exactly the same three random numbers as I have below.

restart:
'rand()' $ 3;

(As always, make sure to put restart in its own execution group.)

The same is true (or should be true) of all of Maple's "random" commands. Any random command that deviates from this is a bug.

@Markiyan Hirnyk 

The following very simple example generates a new plot every five seconds. Use the stop button when you want it to stop.

do
     print(plot(randpoly(x), x= -2..2));
     Threads:-Sleep(5)
end do;

 

First 463 464 465 466 467 468 469 Last Page 465 of 709