MaplePrimes Questions

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

restart;
Digits := 15;

b := -I;

a := sqrt(2);

epsilon := 1;

f := proc (t) options operator, arrow; evalf(Int(exp(I*k*t)/((1+a^2*sin(k)^2)*(k-b)^epsilon), k = -infinity .. infinity)) end proc;

f(1.3)

 

I tried different methods like _d01amc, but either I have this error:

Error, (in evalf/int) NE_QUAD_NO_CONV:
  The integral is probably divergent or slowly convergent.


or it takes forever.

I also tried to map the interval to some finite length (k=tan(u)), but then I get

Error, (in evalf/int) NE_QUAD_BAD_SUBDIV:
  Extremely bad integrand behaviour occurs around the
  sub-interval (-1,5707963e+000, -1,5707963e+000 ).


disgusting integrand?

I hope to enter something like

5^(x-1)=5^x/5

And get "true". Mathematica and some other softwares do this but Maple returns my exact input (I'm new to Maple).

I tried using evalb and verify, but they all return false or FAIL. Is there a straightforward to verify equality and get a result of True or False in Maple?

Thanks!

Is there any way with integer programming function "LPSolve" to get all optimal solutions, because I know there is more than one, and in case if there is a lot of optimal solutions, how to show only the number of optimal solutions?

Thanks in advance!

Executing the entire worksheet several times I obtain random results for Threads:-Seq

restart;

N:=10^3;
f:= (a,b) -> add(evalf(j), j=a..b);

1000

 

proc (a, b) options operator, arrow; add(evalf(j), j = a .. b) end proc

(1)

seq(f(k*N/4+1,(k+1)*N/4), k=0..3);

31375., 93875., 156375., 218875.

(2)

Threads:-Seq(f(k*N/4+1,(k+1)*N/4), k=0..3);

31218.+j, 93875., 156375., 218875.

(3)

Threads:-Seq(f(k*N/4+1,(k+1)*N/4), k=0..3);

31375., 93875., 156375., 218875.

(4)

Threads:-Seq(f(k*N/4+1,(k+1)*N/4), k=0..3);

31900., 94170., 156375., 218875.

(5)

 


Download threads!.mw

Hello,

I have the follownig set of inequality:

{0 < p[1, 2], p[1, 1] < 2*p[2, 2]+(3/2)*p[1, 2], p[1, 2]^2/p[2, 2] < p[1, 1], (2/3)*p[1, 2] < p[2, 2]}

Now I need to find value of p11,p12,p22 that satisfy the above inequality. Is there any easy way to find

parameters p11, p12, p22 in maple?

Best

I have a system with the following config:

But when I run my worksheet, only 10% of CPU and 8% of the RAM are working, and it takes one hour my wrksheet to be computed, I am wondering why Maple do not use enough CPU and RAM to do the computation fast.

What is the justification behind this? Is there a way to coerce the Maple to use more capacities of the CPU and RAM to speed up the computations?

In a for loop how is it possible to see online value of the specific parameter during the loop running?

For example I want to see the online value of the parameter t only not j and k, but it seems maple gives out all parameters.

``

restart

t := 0:

for i to 11 do j := i^2+i; k := j+t; t := j/k end do;

2

 

2

 

1

 

6

 

7

 

6/7

 

12

 

90/7

 

14/15

 

20

 

314/15

 

150/157

 

30

 

4860/157

 

157/162

 

42

 

6961/162

 

6804/6961

 

56

 

396620/6961

 

13922/14165

 

72

 

1033802/14165

 

509940/516901

 

90

 

47031030/516901

 

516901/522567

 

110

 

57999271/522567

 

5225670/5272661

 

132

 

701216922/5272661

 

115998542/116869487

(1)

``

``

``


In Matlab it is easily done by ignoring the end ; at the specified pararmeter computation as

for i=1:11
j= i^2+i;
k = j+t;
t = j/k
end

                             

Download porsesh.mw

How is it possible?

3 4 5 6 7 8 9 Last Page 5 of 1688