Alex Smith

630 Reputation

11 Badges

20 years, 175 days

MaplePrimes Activity


These are answers submitted by Alex Smith

You have probably not yet precisely stated your problem.

Take g(x)=b1. Then Int(f-g, 0..1) is 1/4-b1. As b1 goes to infinity, the integral goes to -infinity, so there is no minimum.

My guess is that you are trying to minimize either

abs(Int(f-g, 0..1)) or Int(abs(f-g), 0..1).

I imagine the solution will be a function g whose graph is a segment from [0,0] to [c,c^3] followed by a segment from [c,c^3] to [1,1],.

But Joe is right, first you need to precisely state your problem. 

It goes like this:

with(group):

alpha:=[[1,2,3,4],[5,6]];

  beta:=[[1,2,5],[3,6]];

 mulperms(alpha,beta);
 

I do not think it is this easy. The mere assumption that g is continuous forces the condition

c = -(b1-b2)/(m1-m2)

You can think of the integral as a function of four independent variables b1, b2, m1, m2. By changing these values, you can alter the value of the integral.

 

 Don't you suppose that the point [c,g(c)] where is on the graph of y=f(x)? In other words, probably g(c)=c^3.

 

I would approach the problem this way:

 

eqn:=proc(x,y)
  diff(y(t),t)=x(t)+y(t)*(1-x(t)^2-y(t)^2);
end proc;

eqn(x,y);

X:=t->r(t)*cos(theta(t));
Y:=t->r(t)*sin(theta(t));

 eqn(X,Y);
 

Set up the diffeq as a proc that takes general functions x and y. Then pass specific functions X and Y.

In this case, you can use cylindrical coordinates, so the equation z=sqrt(x^2+y^2) becomes z=r:

a:=plot3d([r*cos(theta),r*sin(theta),r],r=2..4,theta=0..2*Pi);

b:=plot3d([r*cos(theta),r*sin(theta),2],r=0..2,theta=0..2*Pi,style=patchnogrid);

c:= plot3d([r*cos(theta),r*sin(theta),4],r=0..4,theta=0..2*Pi,style=patchnogrid);


display([a, b, c]);

 

So maybe a general answer to your question is to "parameterize the components of the boundary surface" and use the parametric construction

plot3d([x(u,v),y(u,v),z(u,v)],u=a..b,v=c..d);

 

So what is the domain of this Maple function?

f:=proc(s) :: type(s,set);

combinat[powerset](s);

 end;

A powerful aspect of Maple is that we do not have to define the domain of a proc in order to properly define a proc.

And so we should not expect an algorithm to exist that will determine the domain of a proc.


 

 

Implicit in all of this is that the domain of a function is subset of the complex numbers.

But...if  I define

f:=x->x^2;

and then ask for f(Wisconsin)

then Maple returns Wisconsin^2. Since an output is associated with the input, I must conclude that Wisconsin is in the domain of f.

Of course, to some extent, this is silly, but it points out why the "domain" question really is subtle.

When mathematicians define a function, they know that they are obligated to state the domain. But when we use Maple to define a function, we are glad that we are under no such obligation.

 

 

I guess this means that Maple cannot find a symbolic solution to this non-linear ode.

Try for a numeric solution. For example:

ode:=2*diff(y(x),x,x)-y(x)/x+y(x)^3*cos(x);

soln:=dsolve({ode,y(Pi)=1,D(y)(Pi)=0},numeric);

 soln(Pi/2);
 

If you are using MapleTA 2.5, then I think you have to go through the gradebook student by student and look for assignments to force grade.

 

In MapleTA 3, type "forced grading" into the instructor help screen, and go from there.

 

Take off the limits of the integral and look at the indefinite integral:

 

int((T(x)-a)*diff(T(x),x),x);

 

See where to go from here?

Of course you are right: treating sin(theta) and cos(theta) as independent variables introduces some danger. I suppose this is precisely why Maple returns:

 Error, (in LinearAlgebra:-LA_Main:-Eigenvectors) expecting either Matrices of rationals, rational functions, radical functions, algebraic numbers, or algebraic functions, or Matrices of complex(numeric) values

But once you think about the reason for the error, it occurs to you that the error is related to the entries involving sin(theta) and cos(theta). So the logical step is to abstract out the relationship cos(theta)^2+sin(theta)^2=1 and treat cos and sin as independent variables precisely to get a Matrix of rational functions, as suggested by the error message.

Once you cross this Rubicon, it goes without saying that you must  accept penalties  introduced by forgetting the assumption c^2+s^2=1.

You could also treat sin(theta) and cos(theta) as independent variables s,c so that the entries are rational. Find the eigenvectors, then substitute:

 

 M:= Matrix(3, 3, {(1, 1) = 1/sin(Theta)^2, (1, 2) = -cos(Theta), (1, 3) = 0, (2,1)=-cos(Theta), (2, 2) = 1/sin(Theta)^2, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1});

 

MM:=subs(sin(Theta)=s,cos(Theta)=c,M);

 

(v,e):=LinearAlgebra[Eigenvectors](MM);

 

subs(s=sin(Theta),c=cos(Theta),v);
 

This is why Knuth created TeX, which begat LaTeX.

It would be so nice if Maple would provide LaTeX support.

With the results for your first command, notice the imaginary parts are on the order of 10^(-9). This is numerical garbage. If you throw away the insignificant imaginary parts, then the result is consistent with the second command.

So this is not a bug.

This looks like a bug in Maple 10 and Maple 11. In Maple 9.5

A:=Array([[2.5,0],[4.5,3],[6.5,12],[8.5,25],[10.5,40],[12.5,47]]);

 solve(CurveFitting[Spline](A, x, degree = 1) = (47/2),x);

returns only one number... the correct answer.

 

Maple 10 and 11 bomb. You should report the bug.

As a workaround, maybe use fsolve instead of solve.

PS..nice MapleTA question! You must have worked hard on it.

First 9 10 11 12 13 14 15 Page 11 of 17