# Items tagged with maxmax Tagged Items Feed

### ODE,problem:division by zero, why?...

November 11 2015
0 3

I want to solve an ODE from Game Theory, the Cournot competition.

It says

p(q1+r2(q1))+p'(q1+r2(q1))*r2(q1)-c2'(r2(q1))=0

where, I think,

' means diff(,q1),

c2(q2)=c*q2 for a fixed c in [0,1]

and

p(q)=max(0,1-q).

So c2,p and r2 are functions.r2 goes from [0,inf) to [0,inf).

I look for r2, which should be r2(q1)=(1-q1-c)/2 when correctly solved.

However, the command dsolve says Error in dsolve (divison by 0).

What is wrong? How do I obtain the solution for r2 in Maple?

### Maximum point of plot...

November 03 2015
0 19

hi all

i have a plot in maple. how can i print the maximum point of my plote?

### Evaluating target function at list...

October 26 2015
1 15

So I am using the with(Student[MultivariateCalculus]); package to find the maximum and minimum of the fumction xyz to the given constraint: LagrangeMultipliers(x*y*z, [x^2+4*y^2+4*z^2-4], [x, y, z]) and I got 14 points. But to find the global maximum/minimum I need to evaluate all these points in the main function xyz. I tried converting it to a list and doing something and checked out this thread but it's only for single variable stuff so I am not sure how to extrappolate it to my case.

http://www.mapleprimes.com/questions/202529-Evaluating-A-Function-At-More-Than-One-Point#

These were my points by the way, Yeah lots.

[0, 0, 1], [0, 0, -1], [0, 1, 0], [0, -1, 0], [2, 0, 0], [-2, 0, 0], [(2/3)*sqrt(3), (1/3)*sqrt(3), (1/3)*sqrt(3)], [-(2/3)*sqrt(3), -(1/3)*sqrt(3), -(1/3)*sqrt(3)], [(2/3)*sqrt(3), (1/3)*sqrt(3), -(1/3)*sqrt(3)], [-(2/3)*sqrt(3), -(1/3)*sqrt(3), (1/3)*sqrt(3)], [(2/3)*sqrt(3), -(1/3)*sqrt(3), (1/3)*sqrt(3)], [-(2/3)*sqrt(3), (1/3)*sqrt(3), -(1/3)*sqrt(3)], [(2/3)*sqrt(3), -(1/3)*sqrt(3), -(1/3)*sqrt(3)], [-(2/3)*sqrt(3), (1/3)*sqrt(3), (1/3)*sqrt(3)]

### "max"/"min" Command in Maple...

April 30 2015
0 5

Hi all,

min/max command in Maple can return the minimum/maximum of a sequence or array.

In my case, I want to find not only the minimum/maximum, but also where are them. How can I do?

For example, there is a squence [1,2,3,7,6,5,4].

Through max([1,2,3,7,6,5,4]), we can get 7.

But I still want to get "4" which is the index value of "7".

Thank you.

### evaluating derivatives of max(x^2,sqrt(abs(x)))...

February 01 2015
0 2

I've plotted the graph for this max function. Is there any way I can find the points of discontinuity in general and then use that to compute the derivatives at points where it exists?

### Simplifying a procedure's result...

January 10 2015
0 4

Hi all,

I'm having some trouble trying to make it so the answer Max(3,1,x,4) turns into Max(x,4), that is, only the greates number and the non numerical values are returned. I've tried a bunch of different things, but have gone out of ideas.

This is the link to the Maple file :6-1.mw and this is the code:

 > #Improve the general Max procedure on page 224 so that Max(3,x,1,4)returns Max(x,4). That is, the procedure returns the maximum numerical value along with all nonnumerical values.
 > Max:=proc() local m, i; m:=-infinity; for i in (args) do   if not type(i, numeric) then     return 'procname'(args):   end if;   if i>m then     m:=i   end if; end do; m; end proc;
 (1)
 > Max(3,1,x,4);
 (2)
 >

Would really appreaciate your help with this

### the maximize of equation...

December 18 2014
0 6

I want to solve maximize of equation,but the maximize failed to solve it,who can help me.thanks.

 (1)

 (2)

 (3)

 (4)

 (5)

 (6)

Iwant to maximize the equation (5)and (6),under the conditon of x,y,z are negative or positive at the same time.

### maximum number of equations for MapleSim...

November 06 2014
1 3

Dear Community,

Does anybody know, if there is a limit for the maximum number of equations for MapleSim? I tried with a system of 4456 equations, and I got the error message "(in DSN/RunSimulation ) system is inconsistent" When I took away most of the components (subsystems) it worked. So I suppose there must be some limit for the number of equations.

Andras

### Spacial Matrix Prodution...

July 18 2014
0 0

Hi all

I have a mathematical problem and I asked it in various sites but the answers till yet are not correct.

Assume that we have:

T[m]:=t->t^m:
b[n,m]:=unapply(piecewise(t>=(n-1)*tj/N and t<n*tj/N, T[m](N*t-(n-1)*tj), 0), t):

where n,N,tj are known constants. furthermore assume that we want to comute the following integral:

for following approximations:

I have written the following code but it seems to be incorrect:

V1:=Vector([seq(seq(b[n,m](t),m=0..1),n=1..3)]);
V:=evalf(V1.Transpose(V1));

the original program is :

taaylor.mws

I will be so grateful if any one can help me to solve it by maple

Ph.D Candidate

Applied Mathematics Department

### Maple and Matlab - Global Optimization toolbox...

July 17 2014
1 23

Hi,

On page 32 （PDF）

Two different results were obtained using the Global optimization.

Log likelihood does not differ much. BUT the estimates vary a lot, such as mu[p].

tmp.mw

tmp.pdf

When I tried to use one of the answer from a particular run, I get the HFLOATING error, see picture.

So how reliable is this? Could there be a better way to optimize this ?

Thanks!

As an additional note, if I have Matlab R2014a, could I use Matlab to optimize the target function? DO I need to purchase a seperate addon?

### How do I compare solutions from numeric dsolve?...

July 04 2014
2 5

Hello,

This is probably a silly question, but I am trying to compare the difference between two variables in the numerical solution of a system of ODEs. Ideally, I would like a method to find the maximal difference that occurs between two variables.

The following is a highly simplified example of what I'm talking about. In this case I'd like some means to find the timepoint and magnitude of the maximal difference between y2(t) and y3(t) for t>0, which from the plot can be seen to occur at about 1.75 seconds. Note: I realise this particular case admits an analytic solution of y3(t) which could be exploited, but in the general case I'm interested in that won't be true.

 (1)

 (2)

### How can I find n so that maximum of all coefficie...

June 27 2014
2 21

Suppose (1 + 2x)^n = a0 + a1*x + a2*x^2+...+an*x^n.

I want to find value of n so that max(a0, a1, ..., an) is a8

I tried directly.

With n = 12

restart:
A:=expand((1+2*x)^12,x);
max(coeffs(A));

And with n = 11

B:=expand((1+2*x)^11,x);
max(coeffs(B));

Therefore,  n = 12 or  n = 11.

How can I solve the problem with Maple?

### Error, (in ysol) cannot evaluate the solution furt...

June 09 2014
0 3

Hello everybody, I need help please

 > restart:with(plots):
 > mb:=765; mp:=587;Ib:=76.3*10^3;Ip:=7.3*10^3; l:=0.92; d:=10; F:=-1.2; omega:=0.43;g:=9.81;ly:=3;k:=0.02001014429;
 (1)
 > A:=168913.8672;
 (2)
 > s:=0.0666666666667;
 (3)
 > n:=49.97465213;
 (4)
 > eq1:=(mp+mb)*diff(x(t),t\$2)+mp*(d*cos(theta(t))+l*cos(alpha(t)+theta(t)))*diff(theta(t),t\$2)+mp*l*cos(alpha(t)+theta(t))*diff(alpha(t),t\$2)+mp*(d*diff(theta(t),t)^2*sin(theta(t))+l*(diff(theta(t),t)+diff(alpha(t),t))^2*sin(alpha(t)+theta(t)))+A*2*(s*sinh(k*ly+k*ly)*sin(omega*t-k*x(t)))=0;
 (5)
 > eq2:=(mp+mb)*diff(z(t),t\$2)-mp*d*(sin(theta(t)+alpha(t))+sin(theta(t)))*diff(theta(t),t\$2)-mp*l*sin(alpha(t)+theta(t))*diff(alpha(t),t\$2)+mp*(d*diff(theta(t),t)^2*cos(theta(t))+l*(diff(theta(t),t)+diff(alpha(t),t))^2*cos(alpha(t)+theta(t)))+9.81*(mp+mb)+1000*g*z(t)*15.3*30+A*cosh(k*ly+k*z(t))*n*(cos(omega*t-k*15)-cos(omega*t+k*15))=0;
 (6)
 > eq3:=mp*(d*cos(theta(t))+l*cos(alpha(t)+theta(t)))*diff(x(t),t\$2)-mp*(l*sin(theta(t)+alpha(t))+d*sin(theta(t)))*diff(z(t),t\$2)+(Ip+Ib+mp*(d^2+l^2)+2*mp*d*l*cos(alpha(t)))*diff(theta(t),t\$2)+(Ip+mp*l^2+mp*d*l*cos(alpha(t)))*diff(alpha(t),t\$2)-mp*sin(alpha(t))*(l*d*diff(alpha(t),t)^2-l*d*(diff(alpha(t),t)+diff(theta(t),t))^2)+mp*9.81*l*sin(alpha(t)+theta(t))+mp*9.81*d*sin(theta(t))=0;
 (7)
 > eq4:=mp*l*cos(alpha(t)+theta(t))*diff(x(t),t\$2)-mp*l*sin(alpha(t)+theta(t))*diff(z(t),t\$2)+(Ip+mp*l^2+mp*d*l*cos(alpha(t)))*diff(theta(t),t\$2)+(Ip+mp*l^2)*diff(alpha(t),t\$2)-mp*9.81*l*sin(alpha(t)+theta(t))+l*d*mp*diff(theta(t),t\$1)^2*sin(alpha(t))=0;
 (8)
 > CI:= x(0)=0,z(0)=0,theta(0)=0,alpha(0)=0,D(x)(0)=0,D(alpha)(0)=0,D(z)(0)=0,D(theta)(0)=0;
 (9)
 > solution:=dsolve([eq1,eq2,eq3,eq4,CI],numeric,maxfun=100000);
 (10)

 > odeplot(solution,[[t,x(t)],[t,alpha(t)],[t,z(t)],[t,theta(t)]], t=0..1000, thickness=2);
 > odeplot(solution,[[t,x(t)]], t=0..1000, thickness=2);
 > odeplot(solution,[[t,z(t)]], t=0..1000, thickness=2);
 > odeplot(solution,[[t,alpha(t)]], t=0..1000, thickness=2);
 > odeplot(solution,[[t,theta(t)]], t=0..1000, thickness=2);

thank you

### maximum and minimum functions...

November 14 2013
0 6

I tried to get the maximum and minimum values of the following function. From the plot I get them but its not accurate. Please advise me to get them accurate.

F:=0.85:B:=0.5:

K:=N->(N*(1+F*N/(N^2+B^2-F*N)));

implicitplot(((N^2+B^2-F*N)*K=N*(N^2+B^2-F*N+F*N),K=0..10,N=0..10,view=[0..5,0..4],numpoints=90000,axes=boxed,thickness=2,color=black,font=[1,1,20],tickmarks=[3, 3],linestyle=1));

### plot a function divided by its maximum...

October 29 2013
0 33

Hi,

1-Triying to plot a function divided by its maximum value,sometimes it works with some parameters that means, the max.value of the plot is 1.

But when i change the data the max. value in the plot in graeter than 1 which is wrong!! should be 1.

dont know why??

2- Changing different data in the parameters, the programme takes long long time then i stop it?

restart:
>
------------------------- Defining the nature of the variables used ----------------------
assume(T,real):Digits:=25:n:=1:tau:=Pi:
theta:=0:phi:=0:
lambda:=n;Omega:=1:Gamma:=0.01:
--------------------- Input---------------------------------
1

J1

term1:=(exp((Gamma+I*d)*tau)-1)/(2*(Gamma+I*d)):
Ak1:=d->(exp((Gamma+I*(d+0.5*Omega-2*lambda*k/Gamma))*tau)-1)/(Gamma+I*(d+0.5*Omega-2*lambda*k/Gamma))+(exp((Gamma+I*(d-0.5*Omega+2*lambda*k/Gamma))*tau)-1)/(Gamma+I*(d-0.5*Omega+2*lambda*k/Gamma)):
Ak2:=d->(exp((Gamma+I*(d-0.5*Omega-2*lambda*k/Gamma))*tau)-1)/(Gamma+I*(d-0.5*Omega-2*lambda*k/Gamma))+(exp((Gamma+I*(d+0.5*Omega+2*lambda*k/Gamma))*tau)-1)/(Gamma+I*(d+0.5*Omega+2*lambda*k/Gamma)):
term2:=(evalf(-0.25*sum(BesselJ(k,Omega*Gamma/(4*n))*Ak1(d)+BesselJ(k,-(Omega*Gamma)/(4*n))*Ak2(d),k=0..50))):
J1:=(term1+term2):
J1mod:=(Re(J1))^2+(Im(J1))^2:
###### J2#########################
Ak1:=d->(exp((Gamma+I*(d+0.5*Omega-2*lambda*k/Gamma))*tau)-1)/(Gamma+I*(d+0.5*Omega-2*lambda*k/Gamma))-(exp((Gamma+I*(d-0.5*Omega+2*lambda*k/Gamma))*tau)-1)/(Gamma+I*(d-0.5*Omega+2*lambda*k/Gamma)):
Ak2:=d->(exp((Gamma+I*(d-0.5*Omega-2*lambda*k/Gamma))*tau)-1)/(Gamma+I*(d-0.5*Omega-2*lambda*k/Gamma))-(exp((Gamma+I*(d+0.5*Omega+2*lambda*k/Gamma))*tau)-1)/(Gamma+I*(d+0.5*Omega+2*lambda*k/Gamma)):

J2:=(evalf(-0.25*sum(BesselJ(k,Omega*Gamma/(4*n))*Ak1(d)+BesselJ(k,-Omega*Gamma/(4*n))*Ak2(d),k=0..100))):
######################

J2mod:=(Re(J2))^2+(Im(J2))^2:
J3 same as J1differ in sign
term1:=(exp((Gamma+I*d)*tau)-1)/(2*(Gamma+I*d)):
Ak1:=d->(exp((Gamma+I*(d+0.5*Omega-2*lambda*k/Gamma))*tau)-1)/(Gamma+I*(d+0.5*Omega-2*lambda*k/Gamma))+(exp((Gamma+I*(d-0.5*Omega+2*lambda*k/Gamma))*tau)-1)/(Gamma+I*(d-0.5*Omega+2*lambda*k/Gamma)):
Ak2:=d->(exp((Gamma+I*(d-0.5*Omega-2*lambda*k/Gamma))*tau)-1)/(Gamma+I*(d-0.5*Omega-2*lambda*k/Gamma))+(exp((Gamma+I*(d+0.5*Omega+2*lambda*k/Gamma))*tau)-1)/(Gamma+I*(d+0.5*Omega+2*lambda*k/Gamma)):
term2:=(evalf(0.25*sum(BesselJ(k,Omega*Gamma/(4*n))*Ak1(d)+BesselJ(k,-Omega*Gamma/(4*n))*Ak2(d),k=0..100))):
J3:=term1+term2:
J3mod:=(Re(J3))^2+(Im(J3))^2:
J4 same as J2 but -0.25-->2

J4:=-2*J2:
######################

J4mod:=(Re(J4))^2+(Im(J4))^2:

calculate the spectrum

Spec:=d->(exp(-2*Gamma*tau)*(J1mod*cos(theta/2)^2+J2mod+J3mod*sin(theta/2)^2-0.5*Re(J3*J4*sin(theta)*exp(I*phi))+0.5*Re(J1*J4*sin(theta)*exp(-I*phi)))):

with(plots):

tit:=sprintf("l=%g,W=%g,G=%g",lambda,Omega,Gamma):
Smax1:=max(seq(evalf(Spec(d)),d=-100..100)):
plot(evalf(Spec(d)/Smax1),d=-15..15,axes=boxed,title=tit,color=black,font=[2,3,18],thickness=2,tickmarks=[3,3],titlefont=[SYMBOL,14],font=[1,1,18],linestyle=1);

 1 2 3 Page 1 of 3
﻿