MaplePrimes Questions

Hi everyone! Just a quick question

When I use the Discrete Plot command. For example

DiscretePlot([1,2,3,4,5],[1,6,2,3,4],style=stem)

I get a graph looking like this 

Now, if possible, I would like to be able to have an indent between 0 and 1 to make it look a bit nicer.

I'm quite new to Maple but need it for work. I'm trying to work with metric tensors, and for easy examples it does work. For instance, such as here: https://gyazo.com/730e055f3393956ffe41427e11fa1b43

 

For more complicated problems I come into problems of recognising my tensors as actual metrics. In particular here: https://gyazo.com/58347c676b98ddf99275eea8cfecc69d

 

What am I doing wrong here? Is there some trick I'm missing, am I giving the data incorrectly?

 

Thank you,

Eivind

 

PS: For convenience I'm dumping the document in text format here:

 

> restart;
> with(PDETools); with(DifferentialGeometry); with(Tools); with(Tensor);
> k := 4;
                               4
> C := [w1, w2, z1, z2, seq(cat(x, i), i = 1 .. k), seq(cat(y, i), i = 1 .. k)];
        [w1, w2, z1, z2, x1, x2, x3, x4, y1, y2, y3, y4]
> DGsetup(C, PW, quiet);
                         frame name: PW
PW > F := [b, seq(cat(r, i), i = 1 .. k), seq(cat(s, i), i = 1 .. k)];
              [b, r1, r2, r3, r4, s1, s2, s3, s4]
PW > FunGen := proc (symb) options operator, arrow; PDETools[declare](symb(w1, w2), symb) end proc;
PW > map(FunGen, F);
              b(w1, w2) will now be displayed as b
             r1(w1, w2) will now be displayed as r1
             r2(w1, w2) will now be displayed as r2
             r3(w1, w2) will now be displayed as r3
             r4(w1, w2) will now be displayed as r4
             s1(w1, w2) will now be displayed as s1
             s2(w1, w2) will now be displayed as s2
             s3(w1, w2) will now be displayed as s3
             s4(w1, w2) will now be displayed as s4
PW > NULL;
PW > dx := proc (i) options operator, arrow; 'eval(cat(dx, i))' end proc;
PW > dy := proc (i) options operator, arrow; 'eval(cat(dy, i))' end proc;
PW > r := proc (i) options operator, arrow; cat(r, i) end proc;
PW > s := proc (i) options operator, arrow; cat(s, i) end proc;
PW > epsilon := proc (i) options operator, arrow; cat(epsilon, i) end proc;
PW > L1 := [1, b, seq(r(i), i = 1 .. k), seq(s(i), i = 1 .. k), seq(epsilon(i), i = 1 .. k)];
  [1, b, r1, r2, r3, r4, s1, s2, s3, s4, epsilon1, epsilon2,

    epsilon3, epsilon4]
PW > g := evalDG(`&s`(dw1, dz2)+`&s`(dw2, dz2)+b*(`&s`(dw1, dw1)+`&s`(dw2, dw2))+sum('r(i)'*(`&s`(dx(i), dw1)+`&s`(dy(i), dw2)), i = 1 .. k)+sum('s(i)'*(`&s`(dx(i), dw2)-`&s`(dx(i), dw1)), i = 1 .. k)+sum('epsilon(i)'*(`&s`(dx(i), dx(i))+`&s`(dy(i), dy(i))), i = 1 .. k));
_DG([["tensor", PW, [["cov_bas", "cov_bas"], []]], [

  [[1, 1], 2 b], [[1, 4], 1], [[1, 5], -s1 + r1],

  [[1, 6], -s2 + r2], [[1, 7], -s3 + r3], [[1, 8], -s4 + r4],

  [[2, 2], 2 b], [[2, 4], 1], [[2, 5], s1], [[2, 6], s2],

  [[2, 7], s3], [[2, 8], s4], [[2, 9], r1], [[2, 10], r2],

  [[2, 11], r3], [[2, 12], r4], [[4, 1], 1], [[4, 2], 1],

  [[5, 1], -s1 + r1], [[5, 2], s1], [[5, 5], 2 epsilon1],

  [[6, 1], -s2 + r2], [[6, 2], s2], [[6, 6], 2 epsilon2],

  [[7, 1], -s3 + r3], [[7, 2], s3], [[7, 7], 2 epsilon3],

  [[8, 1], -s4 + r4], [[8, 2], s4], [[8, 8], 2 epsilon4],

  [[9, 2], r1], [[9, 9], 2 epsilon1], [[10, 2], r2],

  [[10, 10], 2 epsilon2], [[11, 2], r3], [[11, 11], 2 epsilon3],

  [[12, 2], r4], [[12, 12], 2 epsilon4]]])
PW > Gam := Christoffel(g);
Error, (in DifferentialGeometry:-Tensor:-Christoffel) expected 1st argument to be a metric tensor. Received: _DG([["tensor", PW, [["cov_bas", "cov_bas"], []]], [`...`]])
PW > Ric := RicciScalar(g);
Error, (in DifferentialGeometry:-Tensor:-RicciScalar) expected 1st argument to be metric tensor. Received: _DG([["tensor", PW, [["cov_bas", "cov_bas"], []]], [`...`]])
PW > CovariantDerivative(g, Gam);
Error, (in DifferentialGeometry:-Tensor:-CovariantDerivative) expected 2nd argument to be an affine connection. Received: Gam
PW > LieDerivative(D_x, g);
Error, (in DifferentialGeometry:-LieDerivative) expected 1st argument to be a vector field. Received D_x
PW > CurvatureTensor(g);
Error, (in DifferentialGeometry:-Tensor:-CurvatureTensor) expected 1st argument to be a metric tensor or an  affine connection. Received: _DG([["tensor", PW, [["cov_bas", "cov_bas"], []]], [`...`]])
PW >

 

Hi everyone again

This one is linked to my previous 2 question.

Essentially I am trying to use a procedure to reproduce the formula:

S(j) = (1 + sum(H_j*T_j,j=1..n))/(1 + sum(1/(H_j*T_j),j=1..n))

BigProc:= proc(H::list,T::list)
local Form, i;
Form:=[];
for i from 1 to nops(H) do
Form := [op(Form),(1 + [sum(H[1..i]*~T[1..i],i=1..5)])/~(1 + [sum(1/~(H[1..i]*~T[1..i]),i=1..5)])]
end do:
end proc:
MainProc([1,3,5],[3,6,8])

Error, (in sum) summation variable previously assigned, second argument evaluates to 1 = 1 .. 5
 

The actual answer should be (3, 396/25,22320/509)

ie 

S(1) = (1+ 3)/(1+(1/3)) = 3

S(2) = (1 +(3+18))/(1+1/3 + 1/18)) = 396/25

S(3) = (1 +(3+18+40))/(1+1/3 + 1/18 +1/40) = 22320/509

I feel like I am missing a few things to my procedure. Any help would be greatly appreciated!

The output of a solve command was:

solution := {p[1] = 2.788944999, p[2] = 4.940143518}, { p[1] = 15.29764736, p[2] = 4.946617373}

My question is: How to capture these 4 numbers in a 2 by 2 matrix ?

I tried assign, subs commands. Did not succeed. Could some one help, please?

 

Hi

I would like to be able to use a procedure in order to create a sequence using a list. Here is an example of what I am trying to achieve:

X = [1,3,4, 50,10]

T_n = 1 + sum^n_j=1 X_j

So T_1 = 1 + 1 = 2

T_2 = 1 + [1+3] = 5

T_3 = 1 +[1+3 +4] = 9

T_4 = 1 + [1+3+4+50] = 59

T_5 = 1+ [1+3+4+50+10] = 69

So my final list would be [2,5,9,59,69]

I am quite new to this forum so i was not sure how to create the Sum from j = 1 to n bit. I know the command for creating a summation but not in a procedure sense.

How do I get a graph from Maple for function f(x) that is continuous on [0,2] except at x=1, where f(1)=4, limx approaching 1- f(x)=2, and limx approaching 1+ f(x)=3?

Duarte and Agustí (1998) investigatedthe CO2 balance o f  aquati  c ecosystems. They related thecommunity respiration rates (R) to the gross primary production rates (P) of aquatic ecosystems. (Both quantities were measured in the same units.) They made the following statement:


Our results  confirm the generality of earlier reports that the relation between community respiration rate andgross production is not linear. Community respirationis scaled as the approximate two-thirds power of grossproduction.

(a) Suppose that you obtained data on the gross production and respiration rates of a number of freshwater lakes. How would you display your data graphically to quickly convince an audience that the exponent b in the power equation relating Rand P is indeed approximately 2/3? (Hint: Use an appropriate log transformation in Maple)


(c) The r atio R/P for an ecosystem is important in assessing the global CO2 budget. If respiration exceeds production (i.e., R >P), then the ecosystem acts as a carbon dioxide source, whereas if production exceeds respiration (i.e., P > R), then the ecosystema cts as a carbon dioxide sink. Assume now that the exponent inthe power equation relating R and P is 2/3. Show that the ratio R/P, as a function of P, is continuous for P > 0. Furthermore,show that
           lim R/P =∞
            P→0+

and
            lim R/P= 0
            P→∞


How to use Maple to sketch the graph of the ratio R/P as  afunction of P for P > 0. (Experiment with the graphing calculatorto see how the value of a affects the graph.)

Hyperbolic functions are used in the sciences. The hyperbolic sine , sinh x;the hyperbolic cosine, cosh x; and the hyperbolic tangent, tanh x,defined respectively as


sinh x = ex − e−x/ 2, x ∈ R
cosh x = ex + e−x/2, x ∈ R
tanh x = ex − e−x/ex + e−x , x ∈ R


How do I show that these three hyperbolic functions are continuous forall x ∈ R using Maple?

Suppose that an organism reacts to a stimulusonly when the stim ulus exceeds a certain threshold. Assume that
the stimulus is a function of time t and that it is given by s(t) = sin(πt), t ≥ 0.The organism reacts to the stimulus and shows a certain reactio nwhen s(t) ≥ 1/2.

Define a function g(t) such  that g(t) = 0 when the organism shows no reaction at time t and g(t) = 1 when theorganism shows the reaction.

I already got the function g(t) manually.

g(t)= {  1 for 1/6 + 2k<=x<= 5/6 + 2k, k=0,1,2,...

           0  otherwise

  How do I plot s(t) and g(t) in the same coordinate system?
 

Nt+1 = RNt/ [1+ (R-1/K)Nt] where R> 1, K>0. When No >0 , lim t approaching infinityNt = K for all values of R>0.

Find Nt for t=1,2,3...10 for K= 100 and No= 20 when a) R=2, b)R=5 and c)R= 10.

I have managed to get the answers for a), b) and c) manually.

But how do I plot Nt as a function of t for the three choices of R in one coordinate system?

The pH levels of a lake controls the conc. of harmless ammonium ions(NH4+) and toxic ammonia (NH3) in the lake.

For pH levels <8, conc. of ammonium ions are little affected by pH changes, but decline over many orders of magnitude as pH levels increase beyond pH 8.

Toxic ammonia are negligible at low pH , increase over many orders of magnitude as the pH level increases and reach a high plateau at about pH =10 (after which, NH3 are little affected by pH changes).

 

How do I illustrate this graphically?

 

Percentage survivorship is a function of time; there ia negligible decline in survivorship at pH=6, marked decline in survivorship at pH=3.5, resulting in no survivors after just 8 hours.

What is the function for this problem and how do I plot it in Maple?

 

Hi all,

I have the following expression,

Typesetting[delayDotProduct](b, K[P], true)+k*K[D]-(Typesetting[delayDotProduct](b, m[1], true)+Typesetting[delayDotProduct](b, m[2], true)+K[D]*m[2])*k*K[P]/(Typesetting[delayDotProduct](b, K[D], true)+k*m[1]+k*m[2]+K[P]*m[2]-m[1]*m[2]*(Typesetting[delayDotProduct](b, K[P], true)+k*K[D])/(Typesetting[delayDotProduct](b, m[1], true)+Typesetting[delayDotProduct](b, m[2], true)+K[D]*m[2]))

where K and K_P are the controller gains, k is the stiffness, b is the damper, m1 and m2 are masses.

How can I find the condition on variables such that the numerator of this expression is greater that zero?

The conditions should appear as inequalities.


 

b*K[P]+k*K[D]-(b*m[1]+b*m[2]+K[D]*m[2])*k*K[P]/(b*K[D]+k*m[1]+k*m[2]+K[P]*m[2]-m[1]*m[2]*(b*K[P]+k*K[D])/(b*m[1]+b*m[2]+K[D]*m[2]))

b*K[P]+k*K[D]-(b*m[1]+b*m[2]+K[D]*m[2])*k*K[P]/(b*K[D]+k*m[1]+k*m[2]+K[P]*m[2]-m[1]*m[2]*(b*K[P]+k*K[D])/(b*m[1]+b*m[2]+K[D]*m[2]))

(1)

``


 

Download Routh-Hurwitz_stability.mw

 

The rate of resource consumption by organisms,v depends on resource concentration, S. The Blackman model of resource consumption assumes a linear relationship between v and S. Below a threshold concentration, Sk , consumption rate increases linearly with S=0 when v=0; when S=Sk, v reaches its max value, vmax. For S> Sk, v stays at vmax.

The function like this is defined piecewise,

  v= { g(S)   for 0<=S< Sk

         vmax  for S>=Sk

g(S)=( vmax/Sk).S

How do I graph v as a function of S with the graph showing the point where Sk=vmax?

Egg development

It takes 3 days at 20oC, but almost 20 days at 5oC for an egg to develop and hatch. When graphed on log -log plot, it says that egg development time (in days) as a function of temperature (in oC) is a straight line.

 

How do I sketch the log-log graph in Maple?

First 836 837 838 839 840 841 842 Last Page 838 of 2427