Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

i assign 

seta := [x+1, x^2]

setb := [x^3, 2*x+5]

 

does morphism mean that

i use card_prod

to get

(x+1, x^3)

(x+1, 2*x+5)

(x^2, x^3)

(x^2, 2*x+5)

such that i composite each of 4 sets still satisfy F(f o g) = f o g

example

subs(x=x^3, x+1)

(A o C) o Colimit = (B o C) o Colimit

if known A, B, C and framework of Colimit

can it be said colimit?

 

Bonus, what are A,B,C? <- this can be not answered

Hi all,

I tried to create the*.exe file by C and call the kernel of maple for calculation.

To understand the OpenMaple, I ran the OpenMaple C code sample, “simple.c” in “<Maple>\ samples\OpenMaple\simple” through Microsoft Visual C++ 2008 but got the incorrect result:

 

It’s seems that the error is happen due to the wrong maple directory. But according to the description of "kernelopts" in help, the value of mapledir cannot be set.

 

Refer to the description of  "OpenMaple,Examples" in help , both header file path and library file path had been set:

O/S: Windows (32-bit)

Header file Directories: "C:\Program Files\Maple 17\extern\include"

Library Directories: "C:\Program Files\Maple 17\bin.win"

Environment Variable: "C:\program files\Maple 17\bin.win"

 

I'd appreciate any help on this topic. Thank a lot.

Has anyone used Maple for Empirical Mode Decomposition ? Any tips, Maple docs ? I can't seem to find anything when searching Maple sites.

I have recently written a maple program to deconvolute gamma-ray spectra using the Richardson-Lucy algrithm. Although this method works well I would prefer to use a method based on the Maximum Entropy algorithm, and would like to know if anyone has tried to write a Maple program to deconvolute 1 dimensional data?

In ode solve command i generated a large array data. The output shows a large order matrix of this form

 

[110001x6 Matrix

Datatype:Anything

Storage:rectangular

order:Fortran_order].

 

I want to export this matrix into a notepad. Which can then be used for plotting in TecPlot. 

 

Looking for good response

 

 

I'm trying to display some flow lines for a vector field. The vector field I have is:

What I put into Maple is:

I've tried this with a number of points, but I always get an error message along the lines of:

"Error, (in Student:-VectorCalculus:-FlowLine) cannot determine if this expression is true or false: (2.*(1)(0)-4.)^2+(-2.+4.*(1)(0))^2 < 0.9e-9"

Could someone please shed some light as to what's going wrong for me? I would be very grateful for any help.

Thanks.

a := matrix(...);
b := Convert to hermit matrix from a;
Norm(MatrixMatrixMultiply(b, a), 2) = Norm(a,2)^2

i have tried, but not exactly equal
Norm(MatrixMatrixMultiply(b, a), 2) = 0.01
Norm(a,2)^2 = 0.1

Guess what matrix a is?

run a command string in C# by calling maple

it can run in maple if copy into maple

however return input string was not in correct format

String commandstring = "restart;with(LinearAlgebra):with(ExcelTools): filename := "0257.HK";open3 := Import(cat(cat("C://Temp//HK//Transportation//",filename),".xls"), filename, "B2:B100");high3 := Import(cat(cat("C://Temp//HK//Transportation//",filename),".xls"), filename, "C2:C100");low3 := Import(cat(cat("C://Temp//HK//Transportation//",filename),".xls"), filename, "D2:D100");close3 := Import(cat(cat("C://Temp//HK//Transportation//",filename),".xls"), filename, "E2:E100");n := 30;Round := proc(x,n::integer:=1) parse~(sprintf~(cat("%.",n,"f"),x)); end proc: t:=1; gg :=Matrix(n+1,1); ggg :=Matrix(n+1,1); for k from 0 to n do InputMatrix3 := Matrix([[close3[t+1+k] , close3[t+k], close3[t+2+k]],[close3[t+k], close3[t+2+k],0],[close3[t+2+k],0 , 0]]): InputMatrix3b := Matrix([[close3[t+2+k], close3[t+1+k] , close3[t+3+k]],[close3[t+1+k] , close3[t+3+k],0],[close3[t+3+k],0 , 0]]): InputMatrix3c := Matrix([[close3[t+3+k] , close3[t+2+k], close3[t+4+k]],[close3[t+2+k], close3[t+4+k],0],[close3[t+4+k],0 , 0]]): Old_Asso_eigenvector := Eigenvectors(MatrixMatrixMultiply(Transpose(InputMatrix3), InputMatrix3)): Old_Asso_eigenvector2 := Eigenvectors(MatrixMatrixMultiply(Transpose(InputMatrix3b), InputMatrix3b)): Old_Asso_eigenvector3 := Eigenvectors(MatrixMatrixMultiply(Transpose(InputMatrix3c), InputMatrix3c)): gg[k+1,1] :=Old_Asso_eigenvector[2][1,1]; od;Round(Re(gg[1,1][1,1]));";

 

(g o f ) o alpha =g o (f o alpha)
restart;alpha := (1/2)*(-x-x*t1-y*t2-y*t3+sqrt(x^2+2*x^2*t1+2*x*y*t2+2*x*y*t3+x^2*t1^2+2*x*t1*y*t2+2*x*t1*y*t3+y^2*t2^2+2*y^2*t2*t3+y^2*t3^2-4*x*t4*y*t9-4*x^2*t4*t7-4*x*t4*y*t8-4*y^2*t9-4*y*x*t7-4*y^2*t8-4*y^2*t5*t9-4*y*t5*x*t7-4*y^2*t5*t8-4*y^2*t6*t9-4*y*t6*x*t7-4*y^2*t6*t8))/(x*t4+y+y*t5+y*t6);
g := -y/x;
f := (-x+sqrt(x^2-x*y-2*y^2))/(2*y+x);
subs(p=f,subs(q=f,subs(x=p,subs(y=q,g)))); # -1
g := (-x+sqrt(x^2-x*y-2*y^2))/(2*y+x);
f := x*y;
gof := subs(p=f,subs(q=f,subs(x=p,subs(y=q,g)))); # -(1/3)*(y/x+sqrt(-2*y^2/x^2))*x/y
lhsgofoalpha := subs(q= alpha,subs(p=alpha, subs(x=p,subs(y=q,gof))));
foalpha := subs(p= alpha,subs(q=alpha,subs(x=p,subs(y=q,f))));
rhsgofoalpha := subs(x= foalpha,subs(y= foalpha, g));
osys := lhsgofoalpha = rhsgofoalpha;
sys1 := subs(x=0, osys);
sys2 := subs(y=0, osys);
sys3 := subs(x=1, osys);
sys4 := subs(y=1, osys);
sys5 := subs(x=2, osys);
sys6 := subs(y=2, osys);
sys7 := subs(x=3, osys);
sys8 := subs(y=3, osys);
sys9 := subs(x=4, osys);
sys1 := subs(x=3,subs(y=2, osys));
sys2 := subs(x=5,subs(y=1, osys));
sys3 := subs(x=1,subs(y=5, osys));
sys4 := subs(x=1,subs(y=2, osys));
sys5 := subs(x=2,subs(y=5, osys));
sys6 := subs(x=5,subs(y=2, osys));
sys7 := subs(x=2,subs(y=1, osys));
sys8 := subs(x=3,subs(y=5, osys));
sys9 := subs(x=5,subs(y=3, osys));
res:=solve([sys1, sys2, sys3, sys4, sys5, sys6, sys7, sys8, sys9], {t1,t2,t3,t4,t5,t6,t7,t8,t9});
eval(osys,res);
simplify(%);
`~`[lhs](select(evalb, res));

I want to begin by saying hello! im new to the forums i hope some one can give me a push in the right direction with some of my maple homework. im sort of stuck on a few of these questions and would be greatfull for some help. 

 

Let .

a) Let g be the tangent line to f when x = c. Use Maple to find g as a function of c.

b) Use Maple to plot f and g(3) using view = [0..5, -25..100].

c) Define a function called plot_tan that plots both f and g(c) where f is blue and g(c) is red. Also use the same view as in part (b). Note that plot_tan is also a function of c.

d) Using your function plot_tan, the following all in one graph using the display command:

plot_tan(1), plot_tan(1.5), plot_tan(2), plot_tan(2.5), plot_tan(3), plot_tan(3.5), plot_tan(4), plot_tan(4.5), plot_tan(5).

e) Try using the option insequence = true in the display command. What does this option do? (You will need to click on the graph and play around with some buttons).

now it seems to me i have to use the point slope formula to get to a fuction g of c. thanks in advance! i hope you can help

 

Data.xlsx

XY.mw

XYZ.mw

 

Hello,

I'm using the Global Optimization Toolbox to solve some examples and fit equations to a given data, finding "unknown" parameters. I generated the data on Excel, and I already know the values of these parameters.

The XY case is (there is no problem here, I just put as a example I follow):

> with(GlobalOptimization);
> with(plots);

> X := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "I5:I25");
> Y := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "J5:J25");

> XY := zip( (X, Y) -> [X, Y] , X, Y);
> fig1 := plot(XY, style = point, view = [.9 .. 3.1, 6 .. 40]);


> Model := A+B*x+C*x^2+D*cos(x)+E*exp(x):
> VarInterv := [A = 0 .. 10, B = 0 .. 10, C = -10 .. 10, D = 0 .. 10, E = 0 .. 10];

> ModelSubs := proc (x, val)

    subs({x = val}, Model)

    end proc;


> SqEr := expand(add((ModelSubs(x, X(i))-Y(i))^2, i = 1 .. 21));
> CoefList := GlobalSolve(SqEr, op(VarInterv), timelimit = 5000);

> Model := subs(CoefList[2], Model):

 

I could find the right values of A, B, C, D and E. 

 

My problem is in the XYZ case, where I don't know how to "write" the right instruction. My last attempt was:

> with(GlobalOptimization);
> with(plots);

> X := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "Q5:Q25"); X2 := convert(X, list);
> Y := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "R5:R25"); Y2 := convert(Y, list);
> Z := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "S5:S25"); Z2 := convert(Z, list);
> NElem := numelems(X);

> pointplot3d(X2, Y2, Z2, axes = normal, labels = ["X", "Y", "Z"], symbol = box, color = red);

 

> Model := A*x+B*y+C*sin(x*y)+D*exp(x/y);

> VarInterv := [A = 0 .. 10, B = 0 .. 10, C = 0 .. 10, D = 0 .. 10];

> ModelSubs:=proc({x,y},val)

subs({(x,y)=val},Model)

end proc:
Error, missing default value for option(s)

> SqEr := expand(add((ModelSubs(x, y, X(i), Y(i))-Z(i))^2, i = 1 .. NElem));
> CoefList := GlobalSolve(SqEr, op(Range), timelimit = 5000);
Error, (in GlobalOptimization:-GlobalSolve) finite bounds must be provided for all variables

 

My actual problem involves six equations, six parameters and four or five independent variables on each equation, but I alread developed a way to solve two or more equations simultaneously.

Thanks

Does anybody know why the answer of a equation i am getting on maple is coming with "eval" written?

Example:

 

the answer should be a number ...

Why does it happen?

 

 

Dear Experts,

When I run this code in maple I am facing with "Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging".

restart:
 
 unprotect('gamma');
 lambda:=5*10^5:
 mu:=0.003:
 beta:=4*10^(-10):
 delta:=0.2:
 alpha:=0.043:
 sigma:=alpha+delta:
 k:=6.24:
 gamma:=0.65:
 A[1]:=1:
 A[2]:=1:

ics := x[1](0)=1.7*10^8, x[2](0)=0,x[3](0)=400,psi[1](50)=0,psi[2](50)=0,psi[3](50)=0:

ode1:=diff(x[1](t), t)=lambda-mu*x[1](t)-(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[1](t)*x[3](t)+delta*x[2](t),
 diff(x[2](t), t) =(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[1](t)*x[3](t)-sigma*x[2](t),
 diff(x[3](t), t) =(1+psi[3](t)*k*x[2](t)/A[2])*k*x[2](t)-gamma*x[3](t),
 diff(psi[1](t), t) =-1+1/A[1]*beta^2*x[1](t)*x[3](t)^2*(psi[1](t)-psi[2](t))^2-psi[1](t)*(-mu+beta^2*x[3](t)^2*(psi[1](t)-psi[2](t))/A[1]*x[1](t)-(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[3](t))-psi[2](t)*(-beta^2*x[3](t)^2*(psi[1](t)-psi[2](t))/A[1]*x[1](t)+(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[3](t)),
> diff(psi[2](t), t) =1/A[2]*psi[3](t)^2*k^2*x[2](t)-psi[1](t)*delta+psi[2](t)*sigma-psi[3](t)*(psi[3](t)*k^2/A[2]*x[2](t)+(1+psi[3](t)*k*x[2](t)/A[2])*k),
> diff(psi[3](t), t) = 1/A[1]*beta^2*x[1](t)^2*x[3](t)*(psi[1](t)-psi[2](t))^2-psi[1](t)*(beta^2*x[1](t)^2*(psi[1](t)-psi[2](t))/A[1]*x[3](t)-(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[1](t))-psi[2](t)*(-beta^2*x[1](t)^2*(psi[1](t)-psi[2](t))/A[1]*x[3](t)+(1-beta*x[1](t)*x[3](t)*(psi[1](t)-psi[2](t))/A[1])*beta*x[1](t))+psi[3](t)*gamma;

sol:=dsolve([ode1,ics],numeric, method = bvp[midrich]);

Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging

Please help me to solve this equation on Maple.




Hello,

I understand that the question is not really Maple related, but I still hope for some help.


See the worksheet below. I defined a pure sine wave and determined the complex Fourier coefficients for it which I used to plot the amplitude and power spectra. It is easy to see the relations in terms of amplitude and power between the time and frequency signal.

The Fourier Transform of the sine wave logically shows the Dirac distribution, but I can't see the relation in terms of amplitude and power to the original time signal. Taking the integral of the transformed signal (A) wil result in a step of Pi at w=-1 and again at w=1. What am I missing here?

Thanks

restart; with(inttrans); with(plots); with(DynamicSystems)

 

Define a signal:

 

T := 2*Pi;

2*Pi

 

sin(t)

(1)

 

Determine the waveform power:

 

F := (int(f^2, t))/T+C:

C := simplify(solve(subs(t = 0, F) = 0, C)):

eval((int(f^2, t = -(1/2)*T .. (1/2)*T))/T)

1/2

(2)

plot([f, f^2, F], t = -Pi .. Pi, gridlines = true)

 

 

Determine the complex Fourier series coefficients and plot the spectra:

 

q := proc (n) options operator, arrow; (int(f*exp(-(2*I)*n*Pi*t/T), t = -(1/2)*T .. (1/2)*T))/T end proc:

simplify(q(n))

I*sin(Pi*n)/(Pi*(n^2-1))

(3)

ComplexCoefficients := evalf(`<,>`(seq(q(n), n = -1 .. 1)))

ComplexCoefficients := Vector(3, {(1) = .5000000000*I, (2) = 0., (3) = -.5000000000*I})

(4)

B := evalf(`<,>`(seq(sqrt(Re(q(n))^2+Im(q(n))^2), n = -3 .. 3))):

 

C := evalf(`<,>`(seq(Re(q(n))^2+Im(q(n))^2, n = -3 .. 3))); -1; DiscretePlot(C, -3, 1, titlefont = ["ARIAL", "bold", 14], title = "Power Spectrum", color = "Red", gridlines = true, style = stem)

 

So, the signal power for f of 1/2 can be found directly within the power spectrum plot "(2*1/(4))."

 

I would expect to be able to directly see the amplitude and power relation to the time signal from the Fourier Transform of f but i can't.

 

A := fourier(f, t, w);

I*Pi*(Dirac(w+1)-Dirac(w-1))

(5)


Download 20140127MaplePrime.mw

 

 

First 201 202 203 204 205 206 207 Last Page 203 of 2097