Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 357 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

@Dira I doubt that your instructor meant/said that you should literally replace f''(x) with a limit. My guess is that s/he meant/said that you should replace f''(x) with the expression used in the limit definition of the derivative (but without actually taking the limit). That expression is the slope of the secant line. So, replace f''(x) with

(subs(x= guess1, fp) - subs(x= guess0, fp)) / (guess1 - guess0)

Note that the secant method requires two intial guesses: you need initial values for both guess0 and guess1. This is a significant difference from Newton's method---the user interface must be different.

f:= piecewise(x <= 1, x^2+1, x <= 2, x^2-1, x+1);

plot(f, x= 0..3);

The issue (which can be determined by reading the OP's worksheet) is that Maple incorrectly translates a four-argument MeijerG expression from Mathematica. Maple's MeijerG takes strictly three arguments. MmaToMaple translates "MeijerG[{{0, 1/2}, {}}, {{0, 1}, {-1, -1}}, 10, 1/2]" as MeijerG([[0, 1/2], []], [[0,1], [-1,-1]], 10, 1/2), but the last argument, 1/2, is ignored by Maple's MeijerG. This extra argument is meaningful to Mathematica, changing the numeric evaluation from 0.810281 to 0.320375.

Your worksheet's directory is not necessarily the same as your current directory. If you're using Maple 18, try

M:= ExcelTools:-Import(cat(interface(worksheetdir),"Book1.xlsx"));

If you're not using Maple 18, use a fully specified filename. Also note the use of := instead of =.

If you use assume thus:

assume(a::real, b::imaginary);

then the conjugate operations will proceed as you said in the Question, when pushed along by expand.

expand(conjugate( k1*a + k2*conjugate(b)) ) ;



 

The rules for changing the index in a sum are the same as the rules for changing a variable of integration. Likewise, the rule for expanding a sum is the same as that for integration.  There is a SumTools package, but it doesn't have simple manipulations like IntegrationTools's Expand and Change. So we change the inert sum to an inert integral, perform the manipulations, then change it back to a sum.

with(IntegrationTools):
A:= Sum(a[n]*phi(n)+b[n+1]*phi(n+2),n=0..N);

Expand(subs(Sum= Int, %));


The applyop is used below because we only want to apply the Change to the second operand.

 

subs([m= n, Int= Sum], applyop(Change, 2, %, m= n+2));

The change-of-variables step can also be done with PDEtools:-dchange, but that doesn't handle the Expand step.

 

You will get some minimal information about the steps by setting

infolevel[solve]:= 5:

before the call to solve.

In the first line, change with (plots) to with(plots). That is, get rid of the space between the words.

In the last line, change odeplots to plot, and end the line with a semicolon rather than a colon.

From your keywords, I see that maybe you think unapply has something to do with this problem. Indeed, that is true. In your current code, Maple is treating the function/procedure parameters omega and F as different from the omega and F that appear in A and B. Function/procedure parameters are always local to their procedure. The command unapply constructs the function/procedure body so that this is so.

A:= < < omega^2-5, 4 > | < 4, omega^2-5 > >:
B:= < -F, 0 >:
amp:= unapply(LinearAlgebra:-Norm(A^(-1).B, 2), omega, F);

amp(0,4);

plot(amp(omega,4), omega= 0..5, discont);

You'll need to rescale each frame so that its axes are the same as the first/largest frame. Using animate/animate3d will not help.

You need to replace each occurence of e^anything with exp(anything).


ex:= exp(I*theta);

exp(I*theta)

(1)

evalc(ex);

cos(theta)+I*sin(theta)

(2)

evalc(Re(ex));

cos(theta)

(3)

evalc(Im(ex));

sin(theta)

(4)

ex:= 1/(I+sqrt(3));

1/(I+3^(1/2))

(5)

rationalize(ex, ratdenom);

(1/4)*3^(1/2)-(1/4)*I

(6)

 


Download evalc.mw

Dena,

I see the source of your error. You have R:= dsolve*(eval.... That * should not be there.

You wrote:

But, In Fredholm_stencil   I have sum(  "int ( f(x), x=n*h..(n+1)*h), n=-N..N-1).

No, you don't have x= n*h... Three times in the worksheet you wrote nh when it should've been n*h.

To combine two integrals on the same limits, use combine.

 

The differences between a Matrix and a two-dimensional Array whose indices begin at 1 are miniscule. I doubt that you would ever notice an efficiency difference.

To use multicore processing, do this: First, check if your procedure myfunc is eligible for multithreading by checking ?index,threadsafe . If myfunc qualifies, do

M:= Matrix(4,5, (i,j)-> (i,j));
Threads:-Map[inplace](myfunc, M);

If myfunc does not qualify for multithreading, then do

M:= Matrix(4,5, (i,j)-> (i,j));
M:= Grid:-Map(myfunc, M);

First 309 310 311 312 313 314 315 Last Page 311 of 395