Maple 17 Questions and Posts

These are Posts and Questions associated with the product, Maple 17

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

 

 

I have to solve a system composed of a mass, a spring and a damper, represented by this equation :

m (d2x/dt2) + c (dx/dt) + k x(t) = F(t)

with m the mass, t the time, c the constant of the damper, k the constant of the spring, F an external force applied to the mass and x(t) the movement of the mass m at time t.

Please help me to solve this equation on Maple.

I have 2 problem with my jacobian matrix:

first: i can not evaluate 11*11 jacobian matrix. at last i can evaluate 10*10 matrix. can i solve this?
second: i want to export my matrix for matlab but i see this error : {export matrix"cannot convert matrix element to float[8] data type"}
so how i can use this matrix in my matlab code?
 my jacobian matrix:


with(VectorCalculus); Jacobian([VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`*`(2.68, ex), VectorCalculus:-`-`(VectorCalculus:-`*`(2, vx))), VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(3.500000001, e^VectorCalculus:-`*`(1.666666667, sqrt(VectorCalculus:-`+`(VectorCalculus:-`-`(VectorCalculus:-`+`(sqrt(VectorCalculus:-`+`(rx^2, ry^2)), sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))^2), VectorCalculus:-`-`(VectorCalculus:-`*`(4, vb^2)))))), VectorCalculus:-`+`(sqrt(VectorCalculus:-`+`(rx^2, ry^2)), sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))), VectorCalculus:-`+`(VectorCalculus:-`*`(rx, 1/sqrt(VectorCalculus:-`+`(rx^2, ry^2))), VectorCalculus:-`*`(1/2, VectorCalculus:-`*`(VectorCalculus:-`+`(VectorCalculus:-`*`(2, rx), VectorCalculus:-`-`(VectorCalculus:-`*`(4, vb(ex)))), 1/sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))))), ln(e)), 1/sqrt(VectorCalculus:-`+`(VectorCalculus:-`-`(VectorCalculus:-`+`(sqrt(VectorCalculus:-`+`(rx^2, ry^2)), sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))^2), VectorCalculus:-`-`(VectorCalculus:-`*`(4, vb^2)))))), VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(50.00000000, e^VectorCalculus:-`-`(VectorCalculus:-`*`(5.000000000, sqrt(VectorCalculus:-`+`(Rx^2, Ry^2))))), Rx), ln(e)), 1/sqrt(VectorCalculus:-`+`(Rx^2, Ry^2)))), VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`*`(2.68, ey), VectorCalculus:-`-`(VectorCalculus:-`*`(2, vy))), VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(3.500000001, e^VectorCalculus:-`*`(1.666666667, sqrt(VectorCalculus:-`+`(VectorCalculus:-`-`(VectorCalculus:-`+`(sqrt(VectorCalculus:-`+`(rx^2, ry^2)), sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))^2), VectorCalculus:-`-`(VectorCalculus:-`*`(4, vb^2)))))), VectorCalculus:-`+`(sqrt(VectorCalculus:-`+`(rx^2, ry^2)), sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))), VectorCalculus:-`+`(VectorCalculus:-`*`(ry, 1/sqrt(VectorCalculus:-`+`(rx^2, ry^2))), VectorCalculus:-`*`(1/2, VectorCalculus:-`*`(VectorCalculus:-`+`(VectorCalculus:-`*`(2, ry), VectorCalculus:-`-`(VectorCalculus:-`*`(4, vb(ey)))), 1/sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))))), ln(e)), 1/sqrt(VectorCalculus:-`+`(VectorCalculus:-`-`(VectorCalculus:-`+`(sqrt(VectorCalculus:-`+`(rx^2, ry^2)), sqrt(VectorCalculus:-`+`(VectorCalculus:-`+`(rx, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ex))))^2, VectorCalculus:-`+`(ry, VectorCalculus:-`-`(VectorCalculus:-`*`(2, vb(ey))))^2)))^2), VectorCalculus:-`-`(VectorCalculus:-`*`(4, vb^2)))))), VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`*`(50.00000000, e^VectorCalculus:-`-`(VectorCalculus:-`*`(5.000000000, sqrt(VectorCalculus:-`+`(Rx^2, Ry^2))))), Ry), ln(e)), 1/sqrt(VectorCalculus:-`+`(Rx^2, Ry^2)))), 1, 1, 1, 1, 1, 1, 1, 1, 1], [vx, vy, ex, ey, rx, ry, Ex, Ey, vb, Rx, Ry])

The matrix:

<3,-2,-1,2,0>;

<11,4,-8,2,7>;

<0,0,2,0,0>;

<3,3,-4,3,3>;

<-8,4,5,-4,-1>;

 

has eigenvector:

<2,0,-1,0,1>

 

Find its corresponding eigenvalue.

(Hint: you don't need to find all the eigenvalues and eigenvectors to answer this question.)

 

Steps and the solution will be greatly appreciated. thanks!

number10:=`466d06ece998b7a2fb1d464fed2ced7641ddaa3cc31c9941cf110abbf409ed39598005b3399ccfafb61d0315fca0a314be138a9f32503bedac8067f03adbf3575c3b8edc9ba7f537530541ab0f9f3cd04ff50d66f1d559ba520e89a2cb2a83`:

number8:=`315c4eeaa8b5f8bffd11155ea506b56041c6a00c8a08854dd21a4bbde54ce56801d943ba708b8a3574f40c00fff9e00fa1439fd0654327a3bfc860b92f89ee04132ecb9298f5fd2d5e4b45e40ecc3b9d59e9417df7c

I first define

f:=x->convert(x, decimal, hex):

with(Bits):
str1:=convert( `Xor(f(number8), f(number10))`, bytes);

now how can I get back the alphabets, since again use of convert with bytes return the inital argument.

Moreover, I would really appreciate if someone could explain the difference between 

convert(`expr`, bytes)

convert( [expr], bytes)

 

Many regards!!

 

Hi everyone

I am currently trying to make my own simple package including a few procedures. So far I have been able to write some "code" that actually works when I open the document and hit "enter". I would, however, like to save the package so it can be accessed during any Maple session using the command "with". I have unsuccesfully tried to comprehend the Maple help pages regarding this question but I definitely don't want to mess things up.

This is what I have written:

mat := module ()
description "useful procedures for mathematics, physics and chemistry";
export AtomicWeight;
option package;

   AtomicWeight := proc (x) description "returns the average atomic mass of the naturally ocurring element";
   Units:-AddSystem(NewSystem, Units:-GetSystem(SI), u);
   return evalf(ScientificConstants:-Element(x, atomicweight, system = NewSystem, units))
   end proc

end module;

What should I do to save it correctly?

Thank in advance,
Mads


 

 

 

 

Good afternoon sir.

 

I request your kind suggestion to the above cited question.

 

 

With thanks & Regards

 

M.Anand

Assistant Professor in Mathematics

SR International Institute of Technology,

Hyderabad, Andhra Pradesh, INDIA.

I am trying to solve a fixed-point equation.

K := Matrix(2, 2, {(1, 1) = 2, (1, 2) = 1, (2, 1) = 1, (2, 2) = 3})

q := 4

solve({a = (1-exp(-.5*K[1, 1]*a-.5*K[1, 2]*b))/(1+(q-1)*exp(-.5*K[1, 1]*a-.5*K[1, 2]*b)), b = (1-exp(-.5*K[2, 1]*a-.5*K[2, 2]*b))/(1+(q-1)*exp(-.5*K[2, 1]*a-.5*K[2, 2]*b))}, [a, b]);

However, no solutions are returned, and I get the warning message "Warning, solutions may have been lost."  How can I be sure that the full set of solutions has been returned?  (I should also say that, based on other cases of the same problem, I expect that there are two or three solutions.)

I received an unexpected error message when trying to minimize a function: evaluating

returns the error message

Error, (in @) too many levels of recursion

Why am I getting this message?  It's hard for me to see how minimizing a function involves recursion, unless Maple is trying to iteratively approximate a solution.

Maple people:

The title is the question.  I would like to know if there is any Maple code available, either part of Maple itself or written by a user, to do computations with quaternions or dual quaternions.

I could Google this and probably find something, but I'll probably find a more helpful and less outdated answer here.

I am teaching a student about the subject and I'd like something to help me teach and help him learn.

I have a lot of experience with Maple but I am not a "computer person", so if the code involves fancy "libraries" or something beyond regular Maple worksheets, I may need a few tips how to use it.

GS

Mapleprimes_Integral.mw

I have a question regarding following problem:

assume(a > 0, a < 1, t > 0, Z0 > 0, z > 0)

f1 := proc (z) options operator, arrow; 1/z end proc

proc (z) options operator, arrow; 1/z end proc

(1)

I_1 := int(f1(z)*ln((a*z+1)/(1+z/a)), z = 0 .. Z0); 1; MultiSeries:-asympt(%, Z0, 3)

2*ln(Z0)*ln(a)+(a^2-1)/(a*Z0)-(1/4)*(a^4-1)/(a^2*Z0^2)+O(1/Z0^3)

(2)

Using the representation which should hold for all a>0 and z>0

int(z*exp(t)*(a^2-1)/((exp(t)+a*z)*(exp(t)*a+z)), t = 0 .. infinity); 1; combine(%)

ln((a*z+1)*a/(z+a))

(3)

I'm calculating the result the other way around

int(z*exp(t)*(a^2-1)*f1(z)/((exp(t)+a*z)*(exp(t)*a+z)), z = 0 .. Z0); 1; I_2 := int(%, t = 0 .. infinity); 1; MultiSeries:-asympt(%, Z0, 3)

2*ln(Z0)*ln(a)+(a^2-1)/(a*Z0)-(1/4)*(a^4-1)/(a^2*Z0^2)+O(1/Z0^3)

(4)

plot(eval([I_1, I_2], a = 1/2), Z0 = 0 .. 10)

 

So the results are the same.

But if I calculate this with another function

f2 := proc (z) options operator, arrow; 1/(z*(z+a)) end proc

proc (z) options operator, arrow; 1/(z*(z+a)) end proc

(5)

I_3 := int(f2(z)*ln((a*z+1)/(1+z/a)), z = 0 .. Z0); 1; MultiSeries:-asympt(%, Z0, 3)

-dilog(a^2)/a-2*ln(a)/Z0+(1/2)*(2*ln(a)*a^2+a^2-1)/(a*Z0^2)+O(1/Z0^3)

(6)

int(z*exp(t)*(a^2-1)*f2(z)/((exp(t)+z*a)*(exp(t)*a+z)), z = 0 .. Z0); 1; I_4 := IntegrationTools:-Change(int(%, t = 0 .. infinity), t = ln(z)); 1; MultiSeries:-asympt(%, Z0, 3); 1; simplify(convert(convert(MultiSeries:-series(I_4, Z0, 1), polynom), polynom))

ln(a)*(ln(Z0)+ln(a))/a

(7)

I get another result :-/ The Integral doesn't even vanish in the limit Z0 -> 0

Though if I take the limit prior:

int(z*exp(t)*(a^2-1)*f2(z)/((exp(t)+z*a)*(exp(t)*a+z)), z = 0 .. infinity);

-dilog(a^2)/a

(8)

the result is correct. What is the problem here?



Download Mapleprimes_Integral.mw

 

How can I join the points on this graph to look like the second graph below.

Hello guys, I want maple to show me the time taken to execute the entire 500 loops shown in the code below. I read maple help and was able to come up with the code  (just part of the whole code).

st := time[real]():

for k from 1 to 500 do

  sol := LinearSolve(A, eval(b, [y[0]=y_init,z[0]=z_init])):
  y_init:=sol[9]:
  z_init:=sol[10]:
end do:


time[real]() - st;

my problem is that the time that shows varies/differs if i run it several times. I was expecting the same time interval of calculation. Am I doing something wrong?

Slides of the presentation at the VII Workshop Fast Computational and Applied Mathematics developed in graduate school at the National University of Trujillo. January 8, 2014.

 

Visualización_Geomét.pdf

 

L. Araujo C.

First 39 40 41 42 43 44 45 Last Page 41 of 61