## 3063 Reputation

19 years, 271 days

Doug

`---------------------------------------------------------------------Douglas B. Meade  <><Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.eduPhone:  (803) 777-6183         URL:    http://www.math.sc.edu`

## forcing floating-point results...

Maple's basic design calls for it to provide responses that are consistent with the input.

If you give an exact number (integer) as input,  you're likely to get an exact answer.

If your input involves an floating point number (approximation),  you're likely to get an answer as a floating point number.

Here are two (simple) examples to show what I mean.

```sqrt(27);
(1/2)
3 3
sqrt(27.);  # with a floating point for input, you get a floating point number for output
5.196152423
solve( x^2-3*x-2=0, x );
3   1   (1/2)  3   1   (1/2)
- + - 17     , - - - 17
2   2          2   2
solve( x^2-3*x-2=0., x ); # note that the RHS is now a floating-point number, so all answers are as well
3.561552813, -0.5615528128
```

Since you don't really tell us anything about your exact needs, it's hard for me to say much more. If I've missed your point, please let me know and I'll see what else I can suggest.

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## use assign to turn parameters into assig...

Given a list or set of equations, the assign command can turn these into assignments (see ?assign):

```param := {a=1,b=2,c=3};
{a = 1, b = 2, c = 3}
a,b,c;
a, b, c
assign( param );
a,b,c;
1, 2, 3
```

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## corrected...

OK, I was in a hurry to get to my son's soccer game. Try this one instead:

```restart:
NaivePrimetest:=proc(n)
local t,k,prime:
prime:=true:
for k from 2 to (n)^1/2 while prime do
t:=gcd(k,n):
if t > 1 then
prime:=false:
printf("%a is not a prime",n):
fi:
od:
if prime then printf("%a is probably a prime",n) end if:
end proc:

NaivePrimetest(11);
11 is probably a prime

NaivePrimetest(12);
12 is not a prime
```

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## while not prime...

The problem I see is that this routine continues for all k up to sqrt(n) and does not stop as soon as the number is known not to be prime.

To fix this, change your do statement to:

```for k from 2 to (n)^1/2 while not prime do
```

This makes the full procedure definition:

```restart:
NaivePrimetest:=proc(n)
local t,k,prime:
prime:=true:
for k from 2 to (n)^1/2 while not prime do
t:=gcd(k,n):
if t > 1 then
prime:=false:
printf("%a is not a prime",n):
fi:
od:
printf("%a is probably a prime",n):
end proc:

NaivePrimetest(11);
11 is probably a prime

NaivePrimetest(12);
12 is probably a prime
```
```How's this?
```
`Doug`
```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## rescaling, partial fractions, series ?...

In theory, I believe you should be able to find a closed form for your integrals. In reality, I would be surprised if Maple can do this. But, I do think we can probably come up with something that could be workable.

Here's my reason for the above statements.

The function S_h is a rational function of t^(1/50). With t=u^50 we see that it's reciprocal is

```fu0 := 1/S_h(u^50) assuming u::positive;
/       207 /         100\\//                       (7/50)
\46225 u    \92450 + u   // \9131406466875781250 215

(7/50)  100                    107                 207
+ 98771297640625 215       u    - 987712976406250 u    + 463674885625 u

307        407\
- 10261950 u    + 111 u   /

```

If we had the partial fraction decomposition of 1/S_h(t), then we should be able to find a closed form for Int( t^a / S_h(t), t=b..c ) .

Unless someone has some insight into finding this partial fraction decomposition, I don't think Maple is likely to be able to find it. But, maybe I just didn't let Maple work long enough before I stopped its efforts.

```convert(fu0,parfrac,u);
Warning,  computation interrupted
```

What next?

Well, a series expansion comes to mind. If we expand about u=0 (remember that u=t^(1/50)) we find:

```series( fu0, u, 500 );
1          (43/50)  207          1            (18/25)  314
------------ 215        u    + ---------------- 215        u
459401384375                   4247165798546875

111             (18/25)  414
- --------------------- 215        u
981626195189146484375

1              (29/50)  421    / 514\
+ -------------------- 215        u    + O\u   /
39265047807565859375
evalf(%);
-10  207                 -14  314                 -18  414
2.206504289 10    u    + 1.125269315 10    u    - 5.404213908 10    u

-19  421    / 514\
+ 5.738629362 10    u    + O\u   /

```

What are the relative sizes of b and c? If they not incredibly small, this looks prone to numerical errors.

If b and c are large, then (maybe) it makes more sense to look at a series expansion in v=1/u:

```fv0 := eval( fu0, u=1/v );
/      /         1  \\///
|46225 |92450 + ----|| ||                       (7/50)
|      |         100|| ||9131406466875781250 215
\      \        v   // ||
\\

(7/50)
98771297640625 215         987712976406250   463674885625   10261950
+ ------------------------ - --------------- + ------------ - --------
100                   107              207          307
v                     v                v            v

\     \
111 |  207|
+ ----| v   |
407|     |
v   /     /
series( fv0, v=0, 1000 );
46225  100   8547002500  200   66275540716859375  300
----- v    + ---------- v    + ----------------- v
111            111                  12321

2209800364983939062500  400   4565703233437890625    (7/50)  407
+ ---------------------- v    - ------------------- 215       v
12321                        12321

7116382540250308515927734375  500
- ---------------------------- v
1367631

1688397055725331953125000    (7/50)  507
- ------------------------- 215       v
12321

539025761916589812331067382812500  600
- --------------------------------- v
455877

30418488482877127250565917968750    (7/50)  607    / 700\
- -------------------------------- 215       v    + O\v   /
1367631
evalf( % );
100                 7  200                 12  300
416.4414414 v    + 7.700002252 10  v    + 5.379071562 10   v

17  400                 14  407                 21  500
+ 1.793523549 10   v    - 7.859648178 10   v    - 5.203437579 10   v

20  507                 27  600                 25  607
- 2.906497897 10   v    - 1.182392974 10   v    - 4.717480111 10   v    +

/ 700\
O\v   /

```

Remember that these need to be multiplied by t^a before integrating.

If neither of these is appropriate, maybe you have some information about b and c that would suggest an appropriate rescaling that would make the numerics more stable. If this is a physical problem, can you find a nondimensional formulation for it?

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## sort the indices?...

There are probably some more sophisticated ways to accomplish this. Here's a relatively simple, and explicit, way to achieve this goal.

How about sorting the indices, like this:

```V := Array( 1..4, 1..4, 1..4, 1..4, (i,j,k,l)->v(sort([i,j,k,l])[]) ):

V(1,2,3,4),V(4,1,3,2),V(2,3,4,1);
v(1, 2, 3, 4), v(1, 2, 3, 4), v(1, 2, 3, 4)

```

If you have an explicit function for the indices, that could be handled as follows:

```v := (i,j,k,m) -> 2^i+3^j+4^k+5^m;
i    j    k    m
(i, j, k, m) -> 2  + 3  + 4  + 5

V(1,2,3,4),V(4,1,3,2),V(2,3,4,1);
700, 700, 700

```

This does not use iterated loops, but the same idea could be used there as well (with each loop from 1 to 4).

Hoping this is helpful,

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## MathContainer and TextArea examples...

A MathContainer displays a mathematical object using MathML. So, it won't be able to display the display created by your seq command.

My first idea was to try to use a TextArea. Here is how that could work:

```# insert a TextArea by clicking on the appropriate icon in the Components palette
# (check that the name is TextArea0 - or adjust below)
# (use the Component Properties entry of the context menu to set the width to 80 and the height to 11)
T := cat( seq( sprintf("%20a  %10a  %10a  %10a  %10a  %10a\n",
i, i^2, i^3, i^4, i^5, rt[i]), i = 1 .. 10 ) );
DocumentTools:-Do(%TextArea0=T):
```

Note that I have replaced printf with sprintf and use cat to create T as a single string.

But, the more I thought about your original request, the more I realized this could also be done in a MathContainer. The key to making this work is to replace the formatted prints with a matrix. For example:

```# insert a MathContainer by clicking on the appropriate icon in the Components palette
# (check that the name is MathContainer0 - or adjust below)
# (use the Component Properties entry of the context menu to set the width to 210 and the height to 300)
T2 := Matrix( 10, 5, (i,j)->i^(j-1) ):
R := Vector( 10, i-> rt[i] ):
DocumentTools:-Do(%MathContainer0=<T2|R>):
```

I hope these suggestions give you some ideas about how to achieve your goals,

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## histogram explained and improved...

Here's what I did:

data := [ 1,2,3,4,5,6,1,2,3,4,5 ]:
with( Statistics ):
p1 := Histogram( data ):
p2 := Histogram( data, binwidth=1 ):
p3 := Histogram( data, binwidth=0.99 ):
p4 := Histogram( data, binwidth=0.5 ):
p5 := Histogram( data, bincount=6 ):
p6 := Histogram( data, bincount=6, range=0..7 ):
P := < < p1, p2 > | < p3, p4 > | < p5, p6> >:
plots:-display( P );

This creates a nice 2x3 array of histograms. One thing you notice when you do this is that each histogram is a probability density function. The vertical scaling is adjusted so that the total area of the rectangles in the histogram is 1.

Five of the six plots have the same general shape; only the one I call p2 is different.

This one is like the OP describes. Look closely at this plot, it has only 5 bins. So, this plot reflects 2 1's, 2 2's, 2 3's, 2 4's, and 3 5's and 6's. That would be 4 bins at 18% and 1 bin at 27%. This is exactly what you see in p2.

To get the plot you desire, with binwidth=1, I might suggest using:

Histogram( data, binwidth=1, bincount=7, range=0..7 ):

I agree that Maple's default plot is somewhat misleading. Even though it's possible to eventually get what you want, it would be nice if this were the default.

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## infolevel, printlevel, and trace...

While this discussion is interesting, it does NOT address Thomas' real question (which he has restate a couple of times). Well, I do see that jakubi's latest post does contain some information about tracing (some of which I will repeat in my post).

What he really wants to know is how to get more information about what Maple is doing behind the scenes.

My first suggestion is to use infolevel. You can get started as follows:

```restart;
eq := x^2=sin(x);
2
x  = sin(x)
infolevel[all]:=1:
solve( eq, x );
evala/Indep: testing independence of RootOfs
factor/polynom: polynomial factorization: number of terms 2
evala/Factors: starting factorization at time 1.359
factor/polynom: polynomial factorization: number of terms 2
evala/Factors: finishing factorization at time 1.359
factor/polynom: polynomial factorization: number of terms 2
simplify/do: applying simplify/RootOf function to expression
simplify/do: applying simplify/RootOf function to expression
factor/polynom: polynomial factorization: number of terms 2
simplify/do: applying simplification with respect to side relations
simplify/siderels: Groebner basis computed with respect to plex(sin(Z({})))
simplify/siderels: the list of rewrite rules (from Groebner basis) is:
[                   2]
[sin(Z({})) = -Z({}) ]
simplify/do: applying simplify/RootOf function to expression
simplify/do: applying simplify/RootOf function to expression
/             2             \
RootOf\-sin(_Z) + _Z , label = _L1/

```

The highest level of information is generally obtained at level 5:

```infolevel[all]:=5:
solve( eq, x );
solve/rec/trig: trigonometric substitution _S000003 = sin(x)
LinearRational: solving for linear equation in _S000003
evala/Indep: testing independence of RootOfs
evala/Indep: number of RootOfs 1
evala/Indep: number of RootOfs 1
evala/Gcd/doit: entering Gcd at time 1.906
evala/Gcd/doit: exiting Gcd at time 1.906
factor/polynom: polynomial factorization: number of terms 2
evala/Factors: starting factorization at time 1.906
evala/Factors: starting factorization at time 1.906
factor/polynom: polynomial factorization: number of terms 2
evala/Factors: finishing factorization at time 1.906
evala/Factors: number of factors 1
evala/Factors: finishing factorization at time 1.906
evala/Factors: number of factors 1
evala/Reduce/ff/urad: Reducing radicals [RootOf(-_S000003+_Z^2 label = _L2)] at time 1.906
factor/polynom: polynomial factorization: number of terms 2
simplify/do: applying simplify/RootOf function to expression
simplify/do: applying simplify/RootOf function to expression
factor/polynom: polynomial factorization: number of terms 2
simplify/do: applying simplification with respect to side relations
SuggestVariableOrder: [[_t[1] 1 1 5]]
-> F4 algorithm
domain: rat_fcn_cof   coeffs: rat_fcn
----------------------------
symbolic prc        0.000 sec
inter reduce        0.000 sec
update pairs        0.000 sec
reduce basis        0.000 sec
total time:         0.015 sec
-----------------------------
simplify/siderels: Groebner basis computed with respect to plex(sin(Z({})))
simplify/siderels: the list of rewrite rules (from Groebner basis) is:
[                   2]
[sin(Z({})) = -Z({}) ]
1 x 1 with 1 rhs
symbolic preproc       0.000 sec
linear solve           0.000 sec
build result           0.000 sec
simplify/do: applying simplify/RootOf function to expression
/             2             \
RootOf\-sin(_Z) + _Z , label = _L2/

```

See ?infolevel for more complete information about using infolevel.

The printlevel shows some of the intermediate resutls from the different procedures that are executed. Each command's "level" is determined by its depth within the calling sequence and the nesting of conditional and repetition statements. Each procedure adds 5 to the level and each nesting adds 1. Commands executed at a prompt have level 1; level 0 can be used to suppress some output. See ?printlevel for more complete details, including the statement that for debugging purposes setting printlevel to 1000 is not unreasonable.

Here's the information for Thomas' example with printlevel 10:

```printlevel:=10:
solve( eq, x );
value remembered (at top level): sin(x) -> sin(x)
{--> enter solve, args = x^2 = sin(x), x
[ 2            ]
[x  = sin(x), x]
false
_MaxSols
infinity
_SolutionsMayBeLost
{x}
false
{}
{}
{}
[ 2            ]
[x  = sin(x), x]
2
x  = sin(x)
2
x  - sin(x)
x
solve/rec/remember
proc(oeqns, ineqs, vars)  ...  end;
false
true
x -> evalb(normal(SolveTools:-CancelInverses(x)) = 0)
/ 2         \
{ x  = sin(x) }
\           /
{}
solve/rec/trig: trigonometric substitution _S000007 = sin(x)
LinearRational: solving for linear equation in _S000007
evala/Indep: testing independence of RootOfs
evala/Indep: number of RootOfs 1
evala/Indep: number of RootOfs 1
evala/Gcd/doit: entering Gcd at time 2.000
evala/Gcd/doit: exiting Gcd at time 2.000
factor/polynom: polynomial factorization: number of terms 2
evala/Factors: starting factorization at time 2.000
evala/Factors: starting factorization at time 2.000
factor/polynom: polynomial factorization: number of terms 2
evala/Factors: finishing factorization at time 2.000
evala/Factors: number of factors 1
evala/Factors: finishing factorization at time 2.000
evala/Factors: number of factors 1
evala/Reduce/ff/urad: Reducing radicals [RootOf(-_S000007+_Z^2 label = _L4)] at time 2.015
factor/polynom: polynomial factorization: number of terms 2
simplify/do: applying simplify/RootOf function to expression
simplify/do: applying simplify/RootOf function to expression
factor/polynom: polynomial factorization: number of terms 2
simplify/do: applying simplification with respect to side relations
SuggestVariableOrder: [[_t[1] 1 1 5]]
-> F4 algorithm
domain: rat_fcn_cof   coeffs: rat_fcn
----------------------------
symbolic prc        0.000 sec
inter reduce        0.000 sec
update pairs        0.000 sec
reduce basis        0.000 sec
total time:         0.000 sec
-----------------------------
simplify/siderels: Groebner basis computed with respect to plex(sin(Z({})))
simplify/siderels: the list of rewrite rules (from Groebner basis) is:
[                   2]
[sin(Z({})) = -Z({}) ]
1 x 1 with 1 rhs
symbolic preproc       0.000 sec
linear solve           0.000 sec
build result           0.000 sec
simplify/do: applying simplify/RootOf function to expression
[ /          /             2             \\ ]
[{ x = RootOf\-sin(_Z) + _Z , label = _L4/ }]
[ \                                       / ]
_MaxSols
[ /          /             2             \\ ]
[{ x = RootOf\-sin(_Z) + _Z , label = _L4/ }]
[ \                                       / ]
[ /          /             2             \\ ]
[{ x = RootOf\-sin(_Z) + _Z , label = _L4/ }]
[ \                                       / ]
[ /          /             2             \\ ]
[{ x = RootOf\-sin(_Z) + _Z , label = _L4/ }]
[ \                                       / ]
[ /          /             2             \\ ]
[{ x = RootOf\-sin(_Z) + _Z , label = _L4/ }]
[ \                                       / ]
[ /          /             2             \\ ]
[{ x = RootOf\-sin(_Z) + _Z , label = _L4/ }]
[ \                                       / ]
[ /          /             2             \\ ]
[{ x = RootOf\-sin(_Z) + _Z , label = _L4/ }]
[ \                                       / ]
[ /          /             2             \\ ]
[{ x = RootOf\-sin(_Z) + _Z , label = _L4/ }]
[ \                                       / ]
[ /          /             2             \\ ]
[{ x = RootOf\-sin(_Z) + _Z , label = _L4/ }]
[ \                                       / ]
x
<-- exit solve (now at top level) = RootOf(-sin(_Z)+_Z^2, label = _L4)}
/             2             \
RootOf\-sin(_Z) + _Z , label = _L4/

```

The debugger could also be used, but I'm not a regular user. It would sure be nice if someone could provide a quick lesson on how to make effective use of the debugger (even if it's not directly related to the example used in this thread).

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## plotting tan(x) - Maple cannot read your...

Why do you think your plot is incorrect?

I say this because this is an example that I use whenever I introduce Maple to students.

Does your graph look more like an echocardiogram?

```plot( tan(x), x=-Pi..Pi );

```

What are the scales on Maple's plot? Maple can't guess what part of the graph is most interesting to you. When Maple's choice is not what you want you have to tell it the viewing window to use.

```plot( tan(x), x=-Pi..Pi, view=[DEFAULT,-10..10] );

```

When Maple plots it connects dots. When a point to the left of an asymptote is joined with a point to the right of a (vertical) asymptote you get a nearly vertical line in the plot. In cases where you want to see the asymptote this is great; but if you don't want to see the asymptote you have to tell Maple to look for discontinuities (in which case it won't join points across discontinuities):

```plot( tan(x), x=-Pi..Pi, view=[DEFAULT,-10..10], discont=true );

```

Is this more like how you expect the graph of the tangent function to appear?

The moral to this story is that Maple is powerful but it's not intelligent. Maple cannot read our minds. The user has to give clear instructions about what you want to see. It takes some skill and practice to learn to use a tool such as Maple.

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## curve fitting by Maple...

Here's a complete Maple solution to your problem. You might not know all of the commands I am going to use, and some of these steps might be easier to do by hand. You should be certain that you understand what's going on at each step.

We start by defining the curve, and the three conditions (in forms that will be useful later).

```restart;
Curve := a*x*y + y + b*x + c = 0;
a x y + y + b x + c = 0
Cond1 := [x=x0, y=Y0];
Cond2 := [y(x0)=Y0, D(y)(x0)=Y1];
Cond3 := [x=m, y=Ym];
[x = x0, y = Y0]
[y(x0) = Y0, D(y)(x0) = Y1]
[x = m, y = Ym]
```

The first and third conditions are easy to apply:

```eq1 := eval( Curve, Cond1 );
a x0 Y0 + Y0 + b x0 + c = 0
eq3 := eval( Curve, Cond3 );
a m Ym + Ym + b m + c = 0
```

For the second condition, we have to differentiate the curve (after declaring that y depends on x, and end by converting the derivatives from diff to D):

```dCurve := convert( diff( eval(Curve,y=y(x)), x ), D );
a y(x) + a x D(y)(x) + D(y)(x) + b = 0
eq2 := eval( eval(dCurve,x=x0), Cond2 );
a Y0 + a x0 Y1 + Y1 + b = 0
```

Now, just solve the 3 equations for the three parameters:

```solve( {eq1,eq2,eq3}, {a,b,c} );
/                                                                          2
|          Y0 + m Y1 - Ym - x0 Y1          -Ym Y0 + Ym m Y1 - x0 Y1 Ym + Y0
< a = - ------------------------------, b = ---------------------------------,
|                         2                                    2
\      m x0 Y1 + m Y0 - x0  Y1 - m Ym       m x0 Y1 + m Y0 - x0  Y1 - m Ym

2                               2   \
m Y0  - m Ym Y0 + Ym m x0 Y1 - Ym x0  Y1|
c = - ---------------------------------------- >
2               |
m x0 Y1 + m Y0 - x0  Y1 - m Ym     /
```

If you want to convert the system of equation into matrix form (Ax=B), I suggest:

```x := < a, b, c >;
A,B := LinearAlgebra:-GenerateMatrix( [eq1,eq2,eq3], [a,b,c] );
```

Note that you need to be careful not to use b for both a parameter in the system and for the rhs of the linear system.

I hope this is instructive,

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## one more idea...

That's not a bad plan, except how did you come up with your approximation? I'd think a series expansion would do better, and would have some real connection to your original problem.

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## overflow in hardware floating point eval...

I believe the source of your problem is that plot uses "hardware floating point" ( ?evalhf ) numbers. Compare:

```eval( 60*9.81*x/14.981, x=18 );
707.2158067

[evalf,evalhf]( cosh(%) );
[              306                        306]
[6.900687631 10   , 6.90068763070755401 10   ]

eval( 60*9.81*x/14.981, x=19 );
746.5055738

[evalf,evalhf]( cosh(%) );
[              323                 ]
[7.984016314 10   , Float(infinity)]

```

It is actually somewhere between 18 and 19 that Maple stops plotting your function.

If you really want to plot this function, you can construct a list of points and ask Maple to plot them, as follows:

```zx := 2000 - (14.9165/9.81)*ln(cosh(60*9.81*x/14.981));
2000 - 1.520540265 ln(cosh(39.28976704 x))

PTS := [seq( [x,zx], x=1..38 )]:
plot( PTS );

```

Is the plot really this linear? One way to answer this is to look at the series expansion of your expression:

```series( zx, x=0 );

2                 5  4                   5    / 6\
2000 - 1173.618203 x  + 3.019496248 10  x  - 0.005778053007 x  + O\x /

```

Actually, the graph should be more like a parabola - but to see any curves in the graph you have to restrict the domain to, say, 0..0.1:

plot(zx, x = 0..0.1);

I hope this is helpful,

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## clarification? and hints!...

Your question, as stated, does not make complete sense to me. What gives me problems is the way you state the three conditions. Are you trying to say that you are given the value of the function and its slope at one point and the value of the function at a different point? Say, y(X0)=Y0, y'(X0)=Y1, and y(m)=Ym?

If so, then you get 1equation for a, b, and c by using y(X0)=Y0 and a second equation by using y(m)=Ym. For the third equation you have to differentiate your curve (with respect to x - using implicit differentiation), then use y(X0)=Y0 and y'(X0)=Y1 to get a third equation for a, b, and c.

This will give a system of 3 linear equations for a, b, and c. The solution to this system will depend on the exact values of X0, Y0, Y1, m, and Ym. It should not be too difficult to complete this analysis.

Is this what you are trying to do?

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

## assignments with assigned and unassigned...

The names x[1] and x1 are different.

x[1] is a reference to the first "element" of the object named x

So, in your first example, IF THE NAME x DOES NOT HAVE A PREVIOUS VALUE, you do have a recursive assignment because x is involved in both sides of the assignment. Note that if x has previously been assigned a value, and x[1], x[2], and x[3] make sense, then the first assignment will not be a problem.

```restart;
x := < x[1], x[2], x[3] >;
Error, recursive assignment
x := < x1, x2, x3 >;
[ x1 ]
[ x2 ]
[ x3 ]
x := < x[1], x[2], x[3] >;
[ x1 ]
[ x2 ]
[ x3 ]

```

I sure hope you did not enter the commands with the syntax shown in your original post. The syntax used in my examples should be equivalent to what you wrote.

I hope this is helpful,

Doug

```---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
```

 First 15 16 17 18 19 20 21 Last Page 17 of 44
﻿