## 1365 Reputation

16 years, 218 days
University of Twente (retired)
Enschede, Netherlands

My "website" consists of a Maple Manual in Dutch

## type...

@kfli Use

type(R2,Matrix);
true
R2[1,1];
44

## Curve with points...

@waseem What is the question? Do you mean something like:

```restart; with(plots): f := x -> x+1: pp := pointplot( [seq([x,f(x)],x=0..10)], symbol=solidcircle, symbolsize=20, color=red ): pl := plot( f, 0..10, thickness=2, color=red ): display( {pp,pl}, view=[0..11,0..11] );```

## @Adam Ledger In the command remove(f,L),...

@Adam Ledger In the command remove(f,L), f must be a boolean-valued procedure.

## Correction...

@Adri van der Meer This procedure doesn't work properly if the polynom has coefficients of the form -c.

 > restart;
 > pol := q^3-a*q^2+b*q^2-5-c*q^4;
 (1)
 > coeffs(pol,q);
 (2)
 > map(op,[coeffs(pol,q)]);
 (3)
 > # op(-c) is -1,c. Only sums have to be splitted:
 > nplus := x -> if type(x,`+`) then op(x) else x end if:
 > cs :=map(nplus,[coeffs(pol,q)]);
 (4)
 > remove(type,cs,'numeric'): cs1 := %=~1;
 (5)
 > subs(cs1,pol): newpol := subs(-~cs1,%);
 (6)

## z-domain...

@carriewong For example, if z takes values in the square -2-2i (bottom left) to 2+2i (top right):

`conformal(I*sqrt(z),z=-2-2*I..2+2*I,grid=[8,8],numxy=[50,50]);`

@Axel Vogt If F is defined by "->", the right hand side stays unevaluated until it is called as F(x). So, when f changes after the definition of F, F changes too. If "unapply" is used, the right hand side is evaluated, so changing the definition of f has no effect on F.

 > f := x -> x;
 (1)
 > F1 := x -> int( f(X), X=0..x );
 (2)
 > F1(x);
 (3)
 > F2 := unapply( int( f(X), X=0..x ), x );
 (4)
 > f := x -> sin(x)*cos(x):
 > F1(x);
 (5)
 > F2(x);
 (6)
 >

## General case; improvement...

@H-R My second suggestion is meant for the general case, where x(t), y(t) are the coordinate functions. There is, of course, no need to calculate the tangent vector: just make an arrow from one point on the curve to another.

x,y := t->cos(t), t->sin(t):
p1 := plot([x(t),y(t),t=0..2*Pi] ):
p2 := plottools:-arrow( [x(Pi/4),y(Pi/4)],[x(Pi/4+0.05),y(Pi/4+0.05)], 0.03,0.05,1 ):
plots:-display( {p1,p2} );

## Startup code...

@AngelaRURU Perhaps it resides in the startupcode? Ctrl+Shift+E

## Explanation...

Note that you solve for x in the command c := solve(...), and assign the result to the variable c.
so you have to apply the condition to x, i.e. solve simultaneously one equation:
limit( (f(x+h)-f(x))/h, h=0 )= (f(b)-f(a))/(b-a),
and two inequations:
x>a, x<b

now the answer comes in the form:
{x=...}

and to assign this value to te variable c:
c := subs(%,x);

Try to find out what to do if there are more solutions in the interval (a,b).
Hint: [solve( ... )] and use subs~(...), see ?Element-wise Operators

## maximum point of the plot...

@farzane you need the second operand of the second element of the output:

op(2,plottools:-getdata(p)[2,2]);
1.81963128310659839

## parametrization...

@asa12 use a parametrization for the surface:

plot3d( [0,y,z], y=0..1, z=0..1, axes=normal );

## See......

for example this question     .

## Logplot...

@shadi1386 Apply LeastSquares to the logarithm of the dependent variable:

XYlist := zip( (x,y) -> [x,ln(y)], xlist,flist):
p1 := plot(XYlist):
with(CurveFitting):
LS := LeastSquares( XYlist, x, curve=add(a[i]*x^i, i=0..7) );
p2 := plot( LS, x=0..1 ):
plots:-display( {p1,p2} );

## @shadi1386 If you (only) want to calcula...

@shadi1386 If you (only) want to calculate the integral, the data are so detailed that a straightforward Riemannsum (like my answer of sept 28) will give a good result. But if the purpose is a single formula that fits the data, then use CurveFitting:-LeastSquares

## Counting terms...

@Markiyan Hirnyk Right! I forgot an expand in nops (answer corrected). Of course a procedure is more elegant (like Stephen Forrest did).

 1 2 3 4 5 6 7 Last Page 1 of 11
﻿