gkokovidis

2370 Reputation

13 Badges

20 years, 289 days
Draeger Medical Systems, Inc.

 

 

Regards,
Georgios Kokovidis
Dräger Medical

MaplePrimes Activity


These are answers submitted by gkokovidis

restart:Digits:=20;

20

                                 (1)

eqn:=x*arccosh(56/x)-40;

x*arccosh(56/x)-40

(2)

plot(eqn,x=0..1000,thickness=2);

 

solve(eqn,x);

RootOf(arccosh(56/_Z)*_Z-40)

                                                                (3)

allvalues(%);

RootOf(arccosh(56/_Z)*_Z-40, 31.109442303035683230-10.324947980131277543*I), RootOf(arccosh(56/_Z)*_Z-40, 31.109442303035683230+10.324947980131277543*I)

(4)

answers:=evalf(%);

31.109442303035683230-10.324947980131277543*I, 31.109442303035683230+10.324947980131277543*I

(5)

ans1:=eval(eqn,x=answers[1]);

0.2e-17-0.83687961669673448110e-18*I

(6)

ans2:=eval(eqn,x=answers[2]);

0.2e-17+0.83687961669673448110e-18*I

(7)

abs(ans1)-abs(ans2);

0.

                                                                                                 (8)

 

Download roots.mw

Regards,

Georgios Kokovidis

Dräger Medical

Have you used Maple on your schools network locally and successfully loaded DirectSearch, or is this your first attempt, using a remote login?

The error message you are getting is due to the package not being found because it is not installed, or if it is installed, the search path in the maple.ini file does not include the path to the package.

 

What do you see when you type

>libname;

at the Maple prompt?  Do you see DirectSearch being displayed?

 

Regards,

Georgios Kokovidis

Dräger Medical

A brute force approach using the ?identify command (not computationaly efficient). 

restart:

ans:=solve(z^3=-sqrt(6)-sqrt(18)*I,z);

(-6^(1/2)-(3*I)*2^(1/2))^(1/3), -(1/2)*(-6^(1/2)-(3*I)*2^(1/2))^(1/3)-((1/2)*I)*3^(1/2)*(-6^(1/2)-(3*I)*2^(1/2))^(1/3), -(1/2)*(-6^(1/2)-(3*I)*2^(1/2))^(1/3)+((1/2)*I)*3^(1/2)*(-6^(1/2)-(3*I)*2^(1/2))^(1/3)

(1)

identify(evalf(abs(ans[1])));#Magnitude1

2^(1/2)*3^(1/6)

(2)

identify(evalf(argument(ans[1])));#Angle1

-(2/9)*Pi

(3)

identify(evalf(abs(ans[2])));#Magnitude2

2^(1/2)*3^(1/6)

(4)

identify(evalf(argument(ans[2])));#Angle2

-(8/9)*Pi

(5)

identify(evalf(abs(ans[3])));#Magnitude3

2^(1/2)*3^(1/6)

(6)

identify(evalf(argument(ans[3])));#Angle3

(4/9)*Pi

(7)

 

Download polarform.mw

 

Regards,

Georgios Kokovidis

Dräger Medical

How would you interpret this result?

restart:with(geom3d):


point(M,t+1,t-2,t+3);

M

Cd:=coordinates(M);

Cd := [t+1, t-2, t+3]

plane(P,x + 2*y -3*z + 1 = 0,[x,y,z]);

P

subs(x=Cd[1], y=Cd[2], z=Cd[3], Equation(P));

-11 = 0

 

 

Download coords.mw

 

Regards,

Georgios Kokovidis

Dräger Medical

With cut and paste, and using 1-D Maple input, your worksheet looks like this:

The first line gets parsed as:

(1*1)*`*`*(1*1);

The output of "*" is correct.

The second line gets parsed as:

1*1*(1*1);

So the output of "1" is also correct.

 

Regards,

Georgios Kokovidis

Dräger Medical

Define your differential equation:

     ode:=diff(y(x), x, x)-4*y(x) = ln(x);

Define your initial conditions:

     ics:=y(0)=0,(D(y))(0)=0;

Use ?dsolve to solve the above.  The help page shows how to do this in the first example.

Regards,

Georgios Kokovidis

Dräger Medical

Without your worksheet it is hard to determine what the problem might be.

The help page for ?dsolve/numeric/DAE has an example with a double pendulum.  Have you looked at it?

Regards,

Georgios Kokovidis

Dräger Medical

The following will give a value for y when you select a value for x.

restart:with(geometry):_EnvHorizontalName := x_EnvVerticalName := y

line(l,2*x + 3*y + 4 =0);

l

(1)

Equation(l);

2*x+3*y+4 = 0

(2)

draw(l,axes=normal,view=[-10..10,-10..10]);

 

plot((-4-2*x)/3,x,view = [-10 .. 10, -10 .. 10]);

 

y:=unapply(solve(Equation(l),y),x);

proc (x) options operator, arrow; -4/3-(2/3)*x end proc

(3)

y(5);

-14/3

(4)

y(0);

-4/3

(5)

y(-2);

0

(6)

 

Download pointsOnLine.mw

 

Regards,

Georgios Kokovidis

Dräger Medical

Reflecting back on your original question, I think I got it wrong. 

The output which is described by:

seq(evalf[2](exp(-n/5)*sin(n)),n=0..20);

is the step response of your system, which is unknown, but approximated by a transfer function:

G(z)=(a1*z+a2)/(b1*z^2+b2*z+b3);

Therefore, a unit step input to the above should yield your data vector, whithin a certain error tolerance.  That is not the case with what I did, which was fit your data to the transfer function.  The document that you reference does what you want.  What I showed is not the same.  The simulation using DynamicSystems shows this. Maybe I am missing something?

restart:with(plots):with(Statistics):interface(rtablesize=21):

numerator:=Vector([seq(0..20,0.01)]):

denominator:=Vector([seq(evalf[4](exp(-n/5)*sin(n)),n=0..20,0.01)]):

G:=z->(a1*z+a2)/(b1*z^2+b2*z+b3):

proc (z) options operator, arrow; (a1*z+a2)/(b1*z^2+b2*z+b3) end proc

(1)

X := numerator:

Y := denominator:

eq:=Fit((a1*z+a2)/(b1*z^2+b2*z+b3), X, Y, z);

(HFloat(1.0027671984544524e-8)*z-HFloat(3.4282295259752474e-8))/(-HFloat(3.1430298395277063e-8)*z^2+HFloat(8.125226175757262e-8)*z-HFloat(8.975743283345938e-8))

(2)

loglogplot(eq,z=1e-3..3,gridlines=true);

 

with(DynamicSystems):

sys2 := TransferFunction((1.00276719845445*10^(-8)*s-3.42822952597525*10^(-8))/(-3.14302983952771*10^(-8)*s^2+8.12522617575726*10^(-8)*s-8.97574328334594*10^(-8)));

sys2:=[[[`Transfer Function`],[continuous],[`1 output(s); 1 input(s)`],[`inputvariable = `[u1(s)]],[`outputvariable = `[y1(s)]]]

(3)

vin2:=Step();

Heaviside(t)

(4)

Tsim := 6;

6

(5)

ResponsePlot(sys2,vin2, duration = Tsim, thickness = 2);

 

 

Download tf_from_data3.mw

Regards,

Georgios Kokovidis

Dräger Medical

Try changing the value of evalf in the line below to a higher value to see what happens to the continuous time plot.

denominator:=Vector([seq(evalf[2](exp(-n/5)*sin(n)),n=0..20)]);

You will see that with a value of 4, the continuous time function has 2 discontinuous like peaks @ an X-value of 1 and 2.  With an evalf[2], this is not noticeable.  This also impacts the rest of the worksheet, so while the continuous loglog plot looks good with an evalf[2], the discrete version, after a transformation does not.

Regards,

Georgios Kokovidis

Dräger Medical

Have you tried using unevaluation quotes around your function to avoid symbolic argument errors.  See ?int/numeric for details, half way down the page.

 

Regards,

Georgios Kokovidis

Dräger Medical

Result of ?Fit does not yield a discrete system, but a continuous one.  I should have changed your "z" to an "s", to make that clear.

Once the transfer function is returned from the Fit command, you can convert it to a discrete version, using the DynamicSystems  function ?ToDiscrete.  That should be a closer apporximation to a discrete transfer function.  As you can see below, the invlaplace command yields a plot that is similar to original plot.  Hope this helps.

restart:with(plots):with(Statistics):interface(rtablesize=21):with(inttrans):

numerator:=Vector([seq(0..20)]):

denominator:=Vector([seq(evalf[2](exp(-n/5)*sin(n)),n=0..20)]):

G:=z->(a1*z+a2)/(b1*z^2+b2*z+b3):

X := numerator:

Y := denominator:

eq:=Fit((a1*s+a2)/(b1*s^2+b2*s+b3), X, Y, s);

(HFloat(1.7504871982847843e-8)*s-HFloat(4.804230977911808e-8))/(-HFloat(5.049769289936845e-8)*s^2+HFloat(1.8133268480818195e-7)*s-HFloat(1.783504277448385e-7))

(1)

loglogplot(eq,s=1e-3..3,gridlines=true):

invlaplace(eq,s,n);seq((Re(%),n=1..10));

plots[listplot]([%],style=point);

0.4535591834e-51*exp(1.795455143*n)*(-0.7642816586e51*cos(.5551520718*n)+0.1306571388e52*sin(.5551520718*n))

 

.1069514565, 13.66658370, 136.0068840, 896.4652177, 4243.288692, 10920.44012, -42114.39647, -827118.5753, -6938689.993, -41024492.44

 

 

with(DynamicSystems):

sys := TransferFunction(eq):

sys:-tf[1, 1];

(-0.1750487198e-7*s+0.4804230978e-7)/(0.5049769290e-7*s^2-0.1813326848e-6*s+0.1783504277e-6)

(2)

sys_z1 := ToDiscrete(sys, 1, method = bilinear):

sys_z1:-tf[1, 1];

.2000000000*(z+1.)*(651628291.*z+4152602687.)/(176758297.*z^2-472806878.*z+7430065689.)

(3)

MagnitudePlot(sys_z1, range = .1 .. 3, color = blue, legend = "bilinear");

 

 

 

Download tf_from_data2.mw

Regards,

Georgios Kokovidis

Dräger Medical

How about this;

invztrans(eq,z,n);seq((Re(%),n=1..10));

instead of

invztrans(eq,z,n);seq(%,n=1..10);

 

Regards,

Georgios Kokovidis

Dräger Medical

One way below.  There is a Control Sytem Toolbox which you can evaluate for a period of time here.  It has an Identify function, which will fit your TF to a given set of data. 

restart:with(plots):with(Statistics):interface(rtablesize=21):

numerator:=Vector([seq(0..20)]):

denominator:=Vector([seq(evalf[2](exp(-n/5)*sin(n)),n=0..20)]):

G:=z->(a1*z+a2)/(b1*z^2+b2*z+b3);

proc (z) options operator, arrow; (a1*z+a2)/(b1*z^2+b2*z+b3) end proc

(1)

X := numerator:

Y := denominator:

eq:=Fit((a1*z+a2)/(b1*z^2+b2*z+b3), X, Y, z);

(HFloat(1.7504871982847843e-8)*z-HFloat(4.804230977911808e-8))/(-HFloat(5.049769289936845e-8)*z^2+HFloat(1.8133268480818195e-7)*z-HFloat(1.783504277448385e-7))

(2)

loglogplot(eq,z=1e-3..3,gridlines=true);

 
Download tf_from_data.mw

Regards,

Georgios Kokovidis

Dräger Medical

At the end of your worksheet, enter:

Matrix(5,nsi);

See ?Matrix for more help and details on the Matrix command.

Regards,

Georgios Kokovidis

Dräger Medical

First 11 12 13 14 15 16 17 Last Page 13 of 75