Carl Love

Carl Love

28025 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

Here's an example using fsolve and dsolve's option output= listprocedure:

Sol:= dsolve(
     {
          diff(a[1](t),t$2) = -a[1](t), diff(a[2](t),t$2) = -a[2](t),
          a[1](0)=1, a[2](0)=0, D(a[1])(0)=0, D(a[2])(0)=1
     }, numeric, output= listprocedure
):
A[1]:= eval(a[1](t), Sol): #extract procedure for a[1]
A[2]:= eval(a[2](t), Sol):
fsolve(A[1], 1..infinity);
                       
10.9955744378927
fsolve(A[2], 1..infinity);
                       
3.14159269513977

It is also possible to locate the zeros with the events option to dsolve. I'll leave it to someone else to give an example of that.

Edit: Square brackets after D changed to parentheses.

Is this what you're looking for?

solve({0<x, x<1, x^2+y^2 - 1 > 0}, x, parametric);

If that's not what you want, could you give a specific solved example of what you want?

Your whole procedure could be replaced by the following:

ff:= (N::posint)-> Matrix([[-2 $ 2*N+1], [0 $ 2*N+1] $ 2*N-1, [-3 $ 2*N+1]]);

I don't know if correcting this will solve your problem, but you have an error in your second boundary condition. You have u(y,0) = 0, but it should be u(0,y) = 0.

You need to do

restart;

to clear the previous values of the variables. After that, Maple still will not be able to complete the definite integration (even with assumptions n::posint, h > 0); I don't know why. But you can do this:

restart:
eta:= 1000:  B:= 5/2:  #Convert 2.5 to an exact value.
F:= int(B*eta^(-B)*t^(B-1)*exp(-(t/eta)^B)*(t-n*h), t);
eval(F, t= (n+1)*h) - eval(F, t= n*h); #Apply Fund Thm of Calc.

Note that I assumed that you meant for the lower limit of integration to be n*h rather than n.

 

The command plots:-display is used to combine multiple plots into a single plot. Plots can be assigned to variables, as in

P1:= plot([Y||(1..3)], 0..10):
P2:= plot([YP||(1..3)], 0..10):

plots:-display([P1,P2]);

The command plottools:-arrow can be used to make a plot of an arrow, which can then be combined with other plots using display.

See ?plottools,arrow and ?plots,display .

Add option method= modifiednewton. Note that the Optimization commands only find local extrema.The Pi has nothing to do with your problem.

Assuming that your count of boundary conditions is correct, a common cause for this error is having a parameter whose numerical value has not been specified. I can't diagnose it further unless you post the code.

restart:
f:= 3-x+2*x^2:  g:= 4+k*x-x^2:
solve(int(f*g, x= -1..1), k);

If you want to get fancy with the inner product notation, you could do

restart:
f:= x-> 3-x+2*x^2:  g:= x-> 4+k*x-x^2:
local `<,>`:= (f,g)-> int(f*g, -1..1):
sqrt(<f,f>);

solve(<f,g>, k);

 

The following does not prove the divergence, but the wildly changing values makes convergence highly suspect:

restart:
Digits:= 15:
f:= z-> exp(-z^2*sin(z)^2):
F:= d-> int(f(z), z= 0..infinity, numeric, epsilon= 10.^(-d)):
'F(d)' $ d= 6..9;



These wildly changing values also make convergence highly suspect:

restart:
Digits:= 10:
f:= z-> exp(-z^2*sin(z)^2):
int(f(z), z= 0..infinity, numeric);

2.835068335

Digits:= 15:
int(f(z), z= 0..infinity, numeric);

2.68030993194038

@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)) ) ;



 

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