Robert Israel

6577 Reputation

21 Badges

18 years, 209 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are answers submitted by Robert Israel

You can put the equation in a title or use textplot.  For example:

> with(plots):
  animate(plot,[x^2+s*x,x=-1..1,title=(f(x)=x^2+s*x)],s=-1..1,
    paraminfo=false);
 

Reducing Digits below 10 is generally a bad idea.  It can cause severe roundoff error, and is unlikely to speed things up at all.  In particular, many numerical routines (including, I think, the pdsolve/numeric ones) will use hardware floats if possible, in which case reducing Digits would not help.

What you might find useful are the spacestep and timestep options to pdsolve.

Try randperm in the combinat package.

plots[spacecurve]([cos(t)^2, sin(t)^2, (2*sin(t)*cos(t))^2], 
   t=0 .. 2*Pi, axes=box, labels=[x,y,z]);

 

First of all, you need to choose something to stand for those expressions (rather than the expressions themselves, or variables which have those expressions assigned as values).  I'll use X[j].

> eqs:= [seq(X[i]-f[i],i=1..8)];
  

You could try Groebner basis techniques.

> with(Groebner):
  B:= Basis(eqs, plex(v[1],v[2],seq(a[i],i=1..10),X[6]));

This tries to eliminate (as much as possible) v[1], v[2] and the a[i]).  The rather complicated result has as its first element an expression that still contains a[7], a[8], a[9] and a[10].  So it is impossible to express X[6] in terms of the other X[i] without any of the v's or a's. 

On the other hand, if you substitute, say, a[7]=1, a[8]=2, a[9]=3, a[10]=4:

> neweqs:= eval(eqs, {a[7]=1, a[8]=2, a[9]=3, a[10]=4});
  B:= Basis(neweqs, plex(v[1],v[2],seq(a[i],i=1..6),X[6]));

The first element contains no v's or a's, and we can solve it for X[6] in terms of the other X's:

> solve(B[1], X[6]);

X[6]=(24*X[2]*X[3]*X[8]+5*X[5]*X[8]^2+8*X[3]*X[7]*X[8]+40*X[4]^2*X[5]-40*X[7]*X[3]*X[4]-30*X[8]*X[4]*X[5])/(-22*X[7]*X[4]+5*X[8]*X[7]+24*X[4]*X[2])

This is not really a Maple question, but here's a hint:

Consider Det(V) as a polynomial in x_n.  What is its degree?
When is it 0?

For this case (a univariate function on a bounded interval) the NLPSolve command in the Optimization package has the method=branchandbound option, which will return a global optimum.  For example:

> Optimization[NLPSolve](x/10 + sin(10*x), x= -5 .. 5, method=branchandbound,
     maximize);
 

[1.45558093518719910, [x = 4.55630936427124844]]

 

You could use dfieldplot in the DEtools package.  For example:

> with(DEtools):
  dfieldplot(diff(y(x),x)=sin(y(x)), y(x), x=-3..3, y=-5..5);

If you know the general form of the curve you want, you could try Fit in the Statistics package.
For example:

> Data := {[1,3],[2,1], [4,1], [5,9]};
  X:= <seq(d[1], d = Data)>;
  Y:= <seq(d[2], d = Data)>;
  with(Statistics):
  f:= Fit(a+b*x+c*x^2, X, Y, x);
  

You might try something like

> plots[odeplot](numericalsol, [t,w[1](t)], 0..20, numpoints=1000);

 

This is a matter of convention, and there just is not a universally accepted convention for how to interpret x^y^z.  I don't know why your default interpretation would be x^y^z = (x^y)^z when the equivalent (for positive x) notation x^yz is available.  The interpretation in 2-D input seems more consistent with the typography, where in

it looks to me like the z is a superscript on the y, not on the (x^y)

The main tool for solving differential equations or systems of them is dsolve.  In this case the symbolic version of dsolve doesn't completely solve your system, so you'll want to use the numeric version.  That won't give you a formula for the solution, but in all likelihood there are no closed-form formulas. 

> sys:= {diff(E(t),t) = -k1*E(t)*S(t) + ki*ES(t) + k2*ES(t),
       diff(S(t),t) = -k1*E(t)*S(t) + ki*ES(t),
       diff(ES(t),t) = k1*E(t)*S(t) - ki*ES(t) - k2*ES(t),
       diff(P(t),t) = k2*ES(t)};
  k1:= 1; ki:= 1; k2:= 10;
  IC:= {E(0)=0.1,S(0)=1,ES(0)=0,P(0)=0};
  Sol:= dsolve(sys union IC, numeric);
  plots[odeplot](sol,[[t,E(t)],[t,S(t)],[t,ES(t)],[t,P(t)]],
    t=0..30,colour=[red,blue,green,black],
    legend=[enzyme,substrate,complex,product]);

This is a nice homework problem.  What have you done so far?  What point are you stuck on?

 

It should be an integer in the range of slider values (0 to 10 by default).  For example:

> GetIt := proc()
   local v;
   v:= Maplets:-Tools:-Get('SL1');
   [v, whattype(v)]
  end proc:
  maplet1 := Maplet([TextField['TF1'](), 
     Slider['SL1'](0..100,10,'showticks','majorticks'=10), 
    [Button("What", Evaluate('TF1' = "GetIt")), 
     Button("OK", Shutdown(['TF1']))]]);
  Maplets[Display](maplet1);

 

It might help if you could specify intervals where you think the value of each variable in a solution should lie.  Otherwise it may be hard to find a solution.  Do you have reason to believe that a solution does exist?

First 45 46 47 48 49 50 51 Last Page 47 of 138