gkokovidis

2370 Reputation

13 Badges

20 years, 288 days
Draeger Medical Systems, Inc.

 

 

Regards,
Georgios Kokovidis
Dräger Medical

MaplePrimes Activity


These are answers submitted by gkokovidis

This has nothing to do with your functions, since the built ins have the same effect.  You can impose floating point approximations by including a decimal point after each of your numbers, or executing an evalf after the fact.

 

restart:

Vector[column]([ cos(6) ,
                 cos(90) ]);

Vector(2, {(1) = cos(6), (2) = cos(90)})

(1)

evalf(%);

Vector(2, {(1) = .9601702867, (2) = -.4480736161})

(2)

restart:

Vector[column]([ cos(6.) ,
                 cos(90.) ]);

Vector(2, {(1) = .9601702867, (2) = -.4480736161})

(3)

Matrix([[ cos(6) ],
        [ cos(90) ]]);

Matrix(2, 1, {(1, 1) = cos(6), (2, 1) = cos(90)})

(4)

evalf(%);

Matrix(2, 1, {(1, 1) = .9601702867, (2, 1) = -.4480736161})

(5)

restart:

Matrix([[ cos(6.) ],
        [ cos(90.) ]]);

Matrix([[.9601702867], [-.4480736161]])

(6)

 

Download FuncMatrixVector.mw

Regards,

Georgios Kokovidis

Dräger Medical

Here is another way, using the float option to ?writedata.  For this specific example, the output, on a WinXP machine, with be in the C:\temp drive. If you edit the file "mpltest.dat", you will see 20 digits of precision.

restart:Digits:=20:

f:=x->0.3333334444433332211*x^2;        

f := proc (x) options operator, arrow; .3333334444433332211*(x^2) end proc

        Data:=[seq([i,f(i)],i=1..10)];

Data := [[1, .3333334444433332211], [2, 1.3333337777733328844], [3, 3.0000009999899989899], [4, 5.3333351110933315376], [5, 8.3333361110833305275], [6, 12.000003999959995960], [7, 16.333338777723327834], [8, 21.333340444373326150], [9, 27.000008999909990909], [10, 33.333344444333322110]]

You have to edit the file address to a diskette or directory where you have write privileges to execute this yourself:

writedata("c:/temp/mpltest.dat",Data);

To see the output, you can write it to your screen:

writedata(terminal,Data,float);

1        0.3333334444433332211
2        1.3333337777733328844
3        3.0000009999899989899
4        5.3333351110933315376
5        8.3333361110833305275
6        12.00000399995999596
7        16.333338777723327834
8        21.33334044437332615
9        27.000008999909990909
10        33.33334444433332211

   

Download writedata.mw

 

Regards,

Georgios Kokovidis

Dräger Medical

Are you looking for a numeric result, or something else, where the output is in terms of log10, and not a ratio of ln, as shown below.  For numeric results, just include a decimal point after your number for force a floating point apporoximation of the result.

restart:

log10(65);

ln(65)/ln(10)

(1)

log10(65.);

1.812913357

(2)

 

 

Download log10.mw

 

Regards,

Georgios Kokovidis

Dräger Medical

If BoxPlot by itself does not give you exactly what you are looking for, you can add to it by combining plot structures, using the ?display command.  ?textplot will allow you to annotate the plot wherever and however you like as well.

restart:with(plots):with(Statistics):

A := [seq(Sample(Normal(ln(i), 3), 100), i = 1 .. 5)]:

B:=BoxPlot(A, title = "Box Plot", color = red .. yellow, deciles = false, outliers=true):

C := `<,>`(6, 7, 8, 8, 7):

CC := `<,>`(6.3, 7.4, 8.5, 8.6, 7.7):

E:=PointPlot(C,symbol=solidcircle,symbolsize=20,color=green):

F:=PointPlot(CC,symbol=solidcircle,symbolsize=20,color=blue):

G:=textplot([5.4, 7, "outliers"]):

display(B,E,F,G);

 

Download BoxPlot.mw

Regards,

Georgios Kokovidis

Dräger Medical

When you rotate a 3d plot, the values of theta, phi, and psi are displayed in the context menu bar.  See this help page for more details.  You can use these values in the plot3d command directly once you are satisfied with the view orientation of the plot.  Are you looking for something else?

 

Regards,

Georgios Kokovidis

Dräger Medical

Try increasing the number of points used to render the plot, and see if it is acceptable for your needs/

Using the above plot statement, the line is concstant from x=0 to 4.6*10^2.

Regards,

Georgios Kokovidis

Dräger Medical

At the main Maple website, click on Support, and then Download Product Updates.  It will take you here.

 

Regards,

Georgios Kokovidis

Dräger Medical

Here is another example using ?solve instead of fsolve.  Either way, you will get what you are looking for.

restart:

r:=solve(sin(x)=0,x,allsolutions);

Pi*_Z1

(1)

seq(eval(r, op(indets(r)) = i),i=0..10);

0, Pi, 2*Pi, 3*Pi, 4*Pi, 5*Pi, 6*Pi, 7*Pi, 8*Pi, 9*Pi, 10*Pi

(2)

 

Download solve.mw

Regards,

Georgios Kokovidis

Dräger Medical

I haven't tried it, but just looking at the "seq" comman I noticed m1.  Maple is case sensitive.  What is m1?  Where is it defined?

 

Regards,

Georgios Kokovidis

Dräger Medical

The topic of numerical Laplace inversion was discussed before here.  You will also find Maple code as well as examples.

There is a paper discussing de Hoog here, which you can use as a guide if you want to rewrite the code samples in Maple.

You can find C source code for de Hoog here.

Regards,

Georgios Kokovidis

Dräger Medical

Look at the help files for ?display and ?textplot for starters.  In order to do what ?CurveAnalysisTutor does manually, you have to build the plot piece by piece and then display it all at once at the end, when you have everything you need.  Here is an example, not exact to what ?CurveAnalysisTutor does with (5*x)/(x^2-4), but close enough to give you an idea that you can build on.

restart:with(plots):

p1:=plot((5*x)/(x^2-4),x=-6..-2.05,color=red,filled=true):

p2:=plot((5*x)/(x^2-4),x=-1.95..0,color=blue,filled=true):

p3:=plot((5*x)/(x^2-4),x=0..1.95,color=yellow,filled=true):

p4:=plot((5*x)/(x^2-4),x=2.05..6,color=green,filled=true):

display(p1,p2,p3,p4);

 

 

Download plot.mw

 

Regards,

Georgios Kokovidis

Dräger Medical

A few more ways, to complement the plot, in order to find the real part of the solution.

restart:

f:=x->a/x^2-3*x+2:

g:=x->a*sin(2*x):

ans:=allvalues(solve(f(f(-1))=sqrt(2)+g(f(2)),a)):

ans2:=[evalf(ans)];

[13.02210936-4.135282756*I, 13.02210936+4.135282756*I, -5.81217740]

(1)

 

restart:

f:=x->a/x^2-3*x+2:

g:=x->a*sin(2*x):

ans:=fsolve(f(f(-1))=sqrt(2)+g(f(2)),a);

 

-5.812177402

(2)

 

Download solve_fsolve.mw

 

Regards,

Georgios Kokovidis

Dräger Medical

I am sure that it is one of many answers that satisfy your original question of finding z(1+I) + I  = 0, for z. See comments by Axel Vogt and ?solve/details for more help on this.

If helpwas not a valid solution, then this statement

 

evalc(subs(z=ans,eqn));

 

would not evaluate to 0=0, showing that the left hand side is equal to the right hand side.

Regards,

Georgios Kokovidis

Dräger Medical

I did not take into account an error for long and complicated expressions.  I was only looking at exp((-1/4-1/4*I)*Pi)   and  (exp(3*Pi*(1/4)))(-sqrt(2*(1/2))+I*sqrt(2*(1/2))).

 

Regards,

Georgios Kokovidis

Dräger Medical

You can check by using ?evalf on each of them to see a "simplified" floating point approximation.  If they were equivalent, then you can subtract one from the other and get zero (0) as an answer. 

 

Regards,

Georgios Kokovidis

Dräger Medical

First 8 9 10 11 12 13 14 Last Page 10 of 75