Carl Love

Carl Love

28100 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@Kitonum Yes, surely I'd choose plots:-spacecurve over geom3d:-line and geom3d:-draw, unless I was already working within geom3d for some other reason. I may have misinterpretted the OP's title to mean that he was already working within geom3d.

@ 

If you were intending to receive a function of t as a result, what was your purpose in using evalf?

The two potential issues that you raised---the disappearence of sin and the disappearence of x---are unrelated. Regarding the sin: Maple's integration has a strong preference for re-expressing products of sines and cosines in terms of cosine alone. The forms are mathematically identical. We can do it for arbitrary m. The following two procedures are equivalent to your curva and fun except that I have removed the evalf.


curva:= proc(m::algebraic, t::algebraic)
local a:= 2*Pi*t;
     2*(cos(a), sin(a)*~(cos,sin)(a*m))
end proc:

fun:= proc(C::seq(algebraic))
local k, a:= k*Pi;
     int(sum(a*C[k]*cos(a*x), k= 1..nargs)^2, x= 0..1)
end proc:

fun(curva(m,t));

2*Pi^2+160*Pi^2*cos(Pi*t*m)^4*cos(Pi*t)^4-160*Pi^2*cos(Pi*t)^2*cos(Pi*t*m)^4-160*Pi^2*cos(Pi*t*m)^2*cos(Pi*t)^4+160*Pi^2*cos(Pi*t)^2*cos(Pi*t*m)^2-24*Pi^2*cos(Pi*t)^4+24*Pi^2*cos(Pi*t)^2

combine(%);

(15/2)*Pi^2+(5/4)*Pi^2*cos(4*Pi*m*t-4*Pi*t)+(5/4)*Pi^2*cos(4*Pi*m*t+4*Pi*t)-(11/2)*Pi^2*cos(4*Pi*t)-(5/2)*Pi^2*cos(4*Pi*t*m)

Regarding the disappearence of x: If you've integrated with respect to x, how can x possibly appear in the result? Thus I think that you intend for x to be a local variable of fun. Change fun to this:


fun:= proc(C::seq(algebraic))
local x, k, a:= k*Pi;
     int(sum(a*C[k]*cos(a*x), k= 1..nargs)^2, x= 0..1)
end proc:

fun(x,y,z);

(1/2)*Pi^2*x^2+2*Pi^2*y^2+(9/2)*Pi^2*z^2


Download sincos.mw

 

 

@Axel Vogt I doubt that. Maple's syntax is far more precise than mathematical notation! (And it's this syntax that promotes clarity of mathematical thinking---which is why I'm so opposed to the "syntax-free" "clickable" "solutions" that Maplesoft now promotes.)  I misinterpretted what the OP wanted: Since he used evalf, I assumed that he wanted a numerical result. But his followup makes it clear what his intention was.

@Kitonum  The warning means that it's safe to solve for names or functions; diff(a(t), t) is a function; x^2 isn't. Unfortunately, the English language is ambiguous between the expressions "(not A) or  B" and "not (A or B)". In this case, the latter is meant.

@Kitonum 

There's no need to use subssolve is happy to solve for derivatives or other functions:

Sys:= allvalues(solve({ode||(1..3)}, diff~({a,b,c}(t), t)))[1];

@tkeith022 

Sorry, but I need a complete executable worksheet to work with, not just a code fragment. In other words, I need a worksheet beginning with a restart command such that when you yourself click the !!! button in the toolbar, it executes.

@kippendorf 

Copy-and-paste of non-plaintext worksheet output into MaplePrimes doesn't work correctly in all web browsers. What browser are you using? I find that the best browser for MaplePrimes is Firefox, the worst is Internet Explorer, and Chrome is about midway between those two. Anyway, you can simply copy-and-paste the plaintext input that defines g. Like I said before, usually the (plaintext!) input is all that's required on MaplePrimes. (I don't mean to imply that you can't improve the quality of your posts by also including some properly formatted output.) You can also use the green up arrow on the toolbar to upload a worksheet.

@kippendorf 

Considering that g depends on omega, did you want a separate g curve for each of your three omegas? That'd be six curves on the plot. Isn't that a bit too much, visually? Nonetheless, if that's what you want, I can easily show you how to code it.

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

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