MaplePrimes Questions

Dear authors,
How to solve this ode problem.

Download link ode.mw

In this problem the boundary condition is

Note: F=g in our problem.

eta approaches N.

Thank you.

 

If I let Maple computer the integral of tan(x), it gets

Int(tan(x), x)=int(tan(x),x), which is the same result as many other softwares get.

However, if I do integral of tan(2*x), it becomes

Int(tan(2*x), x)=(1/4)*ln(1+tan(2*x)^2), instead of -(1/2)*ln(cos(2*x)). The latter form should make more sense considering what Maple gives for tan(x).

In fact, Maple alwys gives the anwer ln(1+tan(n*x)^2)/(2*n) (1) as the integral for tan(n*x) when n>=2. While this is also an indefinite integral of tan(n*x), it is not exactly the equivalent of -(1/n)*ln(cos(n*x)) (2), which is the form Maple gives for integral of tan(x). Expression (2) sometimes evaluates to complex values while (1) only evaluates to real values. It seems that for integral of tan(2x) Maple tries to find the antiderivative that always evaluates to real values, but for tan(x) Maple is happy with -ln(cos(x)), whose value may be complex.

Is there a reason why Maple does this? And is there any way to change the way Maple computes indefinite integrals?

I am trying to put a number of related 2-d plots into a 3-d frame so I can see them stacked up in the third dimension (which follows a parameter) and rotate things around.

The way I once did this successfully was to create the 2-d plots and then use plottools:-transform to move the individual plots in the third dimension, like so:

plt:=plot(something);

tr:=plottools:-transform((x,y) -> [x,2,y]); # the "2" gets changed for the other plots (not shown here).

plots:-display(tr(plt));

The only effect I can get is that the GUI gets confused and I have to close and reload the sheet to get it back again. I have a (complicated) sheet where this actually works, but I am not able to make it work even in the small example I am posting below.

Any hint of where I am going off trail is appreciated. Incidentally, this problem is what led to the corrupted sheet I had maybe a week ago.

Thanks,

Mac Dude.

display3d.mw

 

I unprotect the GAMMA, but still receives error:

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.


 

NULL

restart

II := 2

2

(1)

JJ := 2

2

(2)

N := 2:

unprotect(GAMMA):

q := max(II+1, JJ+1):

M := 5:

seq(seq(seq(assign(GAMMA[i, j, r], a*`#mover(mi("Γ",fontstyle = "normal"),mo("&uminus0;"))`[i, j, r]), i = 0 .. q), j = 0 .. q), r = 1 .. N):

a := .2:

RrProc := proc (i, m) local K, j, Q; if i <= m then 0 else K := 1; Q := Matrix(i, 1); for j by 2 to i do Q(j) := 2*i-K; K := 4+K end do; Q := FlipDimension(Q, 1); Q(m+1) end if end proc:
``

`#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))` := Array(0 .. II, 0 .. JJ, 1 .. 6, 1 .. M):

f1 := RandomArray(II+1, JJ+1):

for m to M do `&Gamma;m`[1, m] := f1; `&Gamma;m`[2, m] := f2; `&Gamma;m`[3, m] := f3; `&Gamma;m`[4, m] := f4; `&Gamma;m`[5, m] := f5; `&Gamma;m`[6, m] := f6 end do:

unprotect(`#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`):

for m to M do `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 1, m] := ArrayTools:-Alias(`&Gamma;m`[1, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 2, m] := ArrayTools:-Alias(`&Gamma;m`[2, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 3, m] := ArrayTools:-Alias(`&Gamma;m`[3, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 4, m] := ArrayTools:-Alias(`&Gamma;m`[4, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 5, m] := ArrayTools:-Alias(`&Gamma;m`[5, m], [0 .. II, 0 .. JJ]); `#mover(mi("&Gamma;",fontstyle = "normal"),mo("&uminus0;"))`[0 .. II, 0 .. JJ, 6, m] := ArrayTools:-Alias(`&Gamma;m`[6, m], [0 .. II, 0 .. JJ]) end do:

UP := proc (s, GAMMA, N, M, a, b, II, JJ) local k; i, j, r, p, m, q, n, l; if s = 1 then add(add(add(add(add(add((2/3)*Rr[i, m]*Rr[k, m]*b*add(GAMMA[i, j, q, p]*GAMMA[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) elif s = 2 then add(add(add(add(add(add((1/2)*Rr[i, m]*Rr[k, m]*b*add(GAMMA[i, j, q, p]*GAMMA[k, j, q, r]*tau[p](t)*tau[r](t), q = 1 .. N)/((2*m+1)*(2*j+1)*a), i = 0 .. II), k = 0 .. II), m = 0 .. II), j = 0 .. JJ), p = 1 .. M), r = 1 .. M) end if end proc:

Grid:-Seq(UP(s, GAMMA, N, M, a, b, II, JJ), s = 1 .. 2)

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

Error, attempting to assign to `GAMMA` which is protected.  Try declaring `local GAMMA`; see ?protect for details.

 

UP(1, GAMMA, N, M, a, b, II, JJ), UP(2, GAMMA, N, M, a, b, II, JJ)

(3)

NULL


 

Download soal.mw

 

What is the problem?

 

Hi, I'm investigating an equation of motion, and I'm attempting to plot t against different values of thetabn. I have acquired a list of my data points (in the real domain) of the form [thetabn1, t1], [thetabn2, t2] ... etc. But I am struggling to figure out how to plot it. Using dataplot gives me a graph but it is incorrect. I would like a scatterplot, ideally once I have refined my range of thetabn I would like to be able to join it up with a line to create a nice looking plot. Also any improvements to my method would be appreciated. v[i], thetavn and omegac are set variables and s[n] is my function which I am setting equal to zero, and solving for t.

 

with(RealDomain);
v[i] := 145000;
thetavn := (1/6)*Pi;
omegac := .1;
s[n] := v[i]*cos(thetavn)*(cos(2*thetabn)*tan(thetabn)+sin(2*thetabn)*sin(omegac*t)/omegac);
for thetabn from evalf((1/100)*Pi) by evalf((1/100)*Pi) to evalf(Pi) do assign('result', [op(result), [thetabn, solve(v[i]*cos(thetavn)*(cos(2*thetabn)*tan(thetabn)+sin(2*thetabn)*sin(omegac*t)/omegac) = 0, t)]]) end do;
dataplot(result);

 

Hello, I need to figure out what theta is through this matrix:

https://imgur.com/RldbcJD

Should I use a solve command for this?

MY worksheet have more than 100 parameters, now I want to use all of the parameters within a procedure, is there any easy way to introduce all these paramaters to proc without mentioning them in parentheses one by one proc(x,y,z,...)?

hello everyone,

I am trying to optimize expressions symbolically. I need to find out the maximum value possible for an variable, so that the expressoin still have a valid solution.

For Example:

expr:=a-b/b-a^3;  # a=(0,10), b=(0,10)

In this eypression b=a^3 is the only case where undefined solution is possible, for a given interval of variables

This looks fine for simple expression. But in reality there are complex equations to solve with more than 2 varibles.

1) first thing is to find out all values of a variable resulting in undeifined output(or infinite)
2) assign a symbolic value(variable < or > some value) to the variable so that the undefined result can be eliminated.

 I need to optimize the given expression so that it does not have any undefined cases when solving. I understood that when optimizing, there always be a condition on variables(in this case variable max is the condition, maximum value the variable can take). output of an expression is always a real value

OptimizedExpr:=a-b[max]/b[max]-a^3 --> b[max]>a^3 or b[max]<a^3

(it is easy to to say b[max] is not equal to a^3 , also a^3 is the limiting value. In some case it is more resonable to just ignore other part of limiting value. Hence, I would like to optimize using greaterthan or lessthan of limiting value).

I would be very glad to know how I can find Optimized expressions. I tried using the solve function but observed that expressions are equalled to zero and solving. which is completely opposite to what I was looking. I really do not know is there any way to find out undefined cases in expressions and on what varibale at what values.

I tried to explain the situation at my best and I welcome for any suggested edits or furthur information required.

 

Thank you

how I can determied  this integral in figure below or compute area in figure which adressed in the following website?

https://en.m.wikipedia.org/wiki/Spherical_cap

Hello everyone !

 when I use  the command   ''G1:=NonIsomorphicGraphs(5, output = graphs, outputform = adjacency)''  , I want to compute the   rank of   adjacent  matrices of 

every graph in  G1,. I try to do , but maple  retutn false:

Rank(G1);
Error, invalid input: too many and/or wrong type of arguments passed to LinearAlgebra:-Rank; first unused argument is Matrix(5, 5, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 1, (1, 4) = 1, (1, 5) = 1, (2, 2) = 0, (2, 3) = 1, (2, 4) = 1, (2, 5) = 1, (3, 3) = 0, (3, 4) = 1, (3, 5) = 1, (4, 4) = 0, (4, 5) = 1, (5, 5) = 0}, datatype = integer[1], storage = triangular[upper], shape = [symmetric])

  How to achieve it , I do not konw to  invoke these adjacent matrices . Would someboby 

give me a hand. 

Thanks very much!


 

 

 

how I can write taylor function for following example.

I want to gain an answer similar to the image result by using taylor function.

tylor.mw
 

P27 := f(x+fNx/`&Delta;x`, y+(`&Delta;y`-fNy)/`&Delta;y`, z+fNz/`&Delta;z`)

f(x+fNy/`&Delta;x`, y+(`&Delta;y`-fNy)/`&Delta;y`, z+fNz/`&Delta;z`)

(1)

with(MultiSeries)

taylor(P27, x = 0)

series(f(fNy/`&Delta;x`, -(-y*`&Delta;y`+fNy-`&Delta;y`)/`&Delta;y`, (z*`&Delta;z`+fNz)/`&Delta;z`)+(D[1](f))(fNy/`&Delta;x`, -(-y*`&Delta;y`+fNy-`&Delta;y`)/`&Delta;y`, (z*`&Delta;z`+fNz)/`&Delta;z`)*x+((1/2)*(D[1, 1](f))(fNy/`&Delta;x`, -(-y*`&Delta;y`+fNy-`&Delta;y`)/`&Delta;y`, (z*`&Delta;z`+fNz)/`&Delta;z`))*x^2+((1/6)*(D[1, 1, 1](f))(fNy/`&Delta;x`, -(-y*`&Delta;y`+fNy-`&Delta;y`)/`&Delta;y`, (z*`&Delta;z`+fNz)/`&Delta;z`))*x^3+((1/24)*(D[1, 1, 1, 1](f))(fNy/`&Delta;x`, -(-y*`&Delta;y`+fNy-`&Delta;y`)/`&Delta;y`, (z*`&Delta;z`+fNz)/`&Delta;z`))*x^4+((1/120)*(D[1, 1, 1, 1, 1](f))(fNy/`&Delta;x`, -(-y*`&Delta;y`+fNy-`&Delta;y`)/`&Delta;y`, (z*`&Delta;z`+fNz)/`&Delta;z`))*x^5+O(x^6),x,6)

(2)

``


Download tylor.mw

 

Hello,

I am trying the following command:

restart; with(IntegrationTools):
simplify(int(f(x), x = 0 .. L*Ts)-Split(int(f(x), x = 0 .. L*Ts), [i*Ts, i = 0 .. L]))

Clearly the output should be 0. However, maple is not able to output the correct result. Any ideas?

 

Hello everyone,

I have 26 equations  and 26 variables and I want to solve them numerically. fsolve function returns whole equations as a solution.

Any advice ?

What command in Maple runs specific worksheets within other worksheet?

Actually I want to know how is it possible to comminucate and control multiple worksheets within one specific worksheet?

 

Hi 

I want to store the matrix m2 representing a system m2*x=b with vectors as given by the command "CompressedSparseForm" and solve the system using those vectors and b without using m2 and b.

Thanks

vectors.mw


 

``

restart; with(LinearAlgebra)

``

``

``

m2 := Matrix([[102, 0, 0, .1, 1], [0, 3, 0, 0, 1], [1, 3.1, 7, 0, 0], [1, 33, 0, .5, 0], [1, 0, 0, 0, 1]], 'datatype = float')

Matrix([[102., 0., 0., .100000000000000, 1.], [0., 3., 0., 0., 1.], [1., 3.10000000000000, 7., 0., 0.], [1., 33., 0., .500000000000000, 0.], [1., 0., 0., 0., 1.]])

(1)

``

cm, rm, values := CompressedSparseForm(m2)

Vector(6, {(1) = 1, (2) = 5, (3) = 8, (4) = 9, (5) = 11, (6) = 14}, datatype = integer[8]), Vector(4, {(1) = ` 1 .. 13 `*Vector[column], (2) = `Data Type: `*integer[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order}), Vector(4, {(1) = ` 1 .. 13 `*Vector[column], (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

(2)

``

b := `<,>`(1.1, 2, 5, .5, 5)

Vector(5, {(1) = 1.1, (2) = 2, (3) = 5, (4) = .5, (5) = 5})

(3)

``

LinearSolve(m2, b)

Vector(5, {(1) = -.107505070993915, (2) = -1.03583502366464, (3) = 1.18837052062204, (4) = 69.5801217038540, (5) = 5.10750507099392})

(4)

``

NULL b

``

``

``

``


 

Download vectors.mw

First 578 579 580 581 582 583 584 Last Page 580 of 2261