MaplePrimes Questions

f1 := -2*x1 - x2;
f2 := -x1 - 4*x2;
g1 := 2*x1 + 3*x2 - 6;
g2 := -x1;
g3 := -x2;
penalty := lambda1*Max(f1-M,0)+lambda2*Max(f2-M,0)+(M^2)*(max(g1,0) + max(g2,0) + max(g3,0));
M := 1;
k := 1;
s := 1;
lambda1 := 0.5;
lambda2 := 0.5;
with(Optimization):
Minimize(subs(lambda2=0.5, subs(lambda1=0.5, subs(M=1, penalty))));

correct answer for these parameters should be below, however, Minimize got error

when lambda1 = 0.5, lambda2 = 0.5
(x1, x2) = 1.551123, 0.965918
f(x1, x2) = (–4.068164, –5.414795);

want to export to excel to file from matrix

Error, (in FindLambda) invalid input: `convert/Array` expects its 1st argument, A, to be of type {Array, Matrix, Vector, array, list, listlist}, but received csvfile
csvfile = Matrix(30,7);

print(close3(t+i), rhs(Sol5[1][1]), ratioA, oddsratio, oddsratioSimUp, oddsratioSimDown,1);
csvfile[i+1,1] := close3(t+i);
csvfile[i+1,2] := rhs(Sol5[1][1]);
csvfile[i+1,3] := ratioA;
csvfile[i+1,4] := oddsratio;
csvfile[i+1,5] := oddsratioSimUp;
csvfile[i+1,6] := oddsratioSimDown;
csvfile[i+1,7] := 1;

29.95, 0.03355620525, 0.7651906074, 0.6000000000, 0.5294117647,

0.5714285714, 0
-8
29.95, 0.03361194645, 1.750709592 10 , 0.4444444444,

0.5000000000, 0.6000000000, 0
5
29.6, 0.03432592221, 1.013882143 10 , 0.6000000000, 0.4444444444,

0.6923076923, 1
29.55, 0.03447081290, -0.000009845029875, 0.7142857143,

0.6000000000, 0.5000000000, 0
29.8, 0.03403562903, 30660.46200, 0.5294117647, 0.4117647059,

0.7142857143, 0
30.4, 0.03327345914, -0.5761838946, 0.6000000000, 0.5714285714,

0.5294117647, 0
30.3, 0.03376575281, 6.256895964, 0.5000000000, 0.6000000000,

0.5000000000, 0
30.95, 0.03231017771, 0.5328449644, 0.6000000000, 0.6000000000,

0.5000000000, 0
31.1, 0.03104289658, -26.93771895, 0.5000000000, 0.5000000000,

0.6000000000, 0
29.2, 0.03366016138, -0.08555779615, 0.4444444444, 0.5000000000,

0.6000000000, 0
28.95, 0.03415453360, 0.4007940838, 0.6000000000, 0.4444444444,

0.6923076923, 0
28.3, 0.03605364033, 0.00001875789432, 0.3750000000,

0.6000000000, 0.5000000000, 0
28.75, 0.03523629490, 0.9740829247, 0.4117647059, 0.7333333333,

0.3750000000, 1
5
29.2, 0.03415861325, -6.244828641 10 , 0.6000000000,

0.7142857143, 0.4117647059, 1
28.8, 0.03514419367, -0.1430744128, 0.06666666667, 0.6000000000,

0.5000000000, 0
29.4, 0.03352191217, 0.1495513336, 0.5000000000, 1.000000000,

0.06666666667, 0
28.95, 0.03433350933, 2.034565984, 0.5000000000, 0.5000000000,

0.6000000000, 0
28.85, 0.03394117064, 16.52857996, 0.7142857143, 0.5000000000,

0.6000000000, 0
28.5, 0.03419513697, -67.32086106, 0.6000000000, 0.7142857143,

0.4117647059, 0
-8
27.05, 0.03748108008, -3.316856585 10 , 0.6000000000,

0.6000000000, 0.5000000000, 0
27.7, 0.03561234996, 0.9992012832, 0.5000000000, 0.5000000000,

0.6000000000, 1
7
27.25, 0.03636057571, -1.891574002 10 , 0.5000000000,

0.5000000000, 0.6000000000, 1
27.0, 0.03696844993, 1.002386970, 0.03225806452, 0.5000000000,

0.6000000000, 0
-8
26.85, 0.03745201461, -5.221638895 10 , 1.000000000,

0.03225806452, 0, 0
26.85, 0.03734798123, 1.050118943, 0.5000000000, 0.06666666667,

1.000000000, 1

I have some data for a model in MapleSim that I would like to use a time look up table with.  I've found that the two options for interpolation are linear and 1st derivative, but the data was intended to be interpretted as piecewise constant.  Is there any way to acheive this option in MapleSim?

Hi everybody,

 

I'm an mechanical enginer and I have to solve numerically this kind of differential equation : m(d2z/dt2)+c(dz/dt) + k*z = F where z is the displacement.
The best resolution for this problem is to use a Newmark method (which is available here at page 10 http://www.google.fr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&ved=0CEEQFjAE&url=http%3A%2F%2Fpole-modelisation.univ-bpclermont.fr%2Fcisssi%2Findex.php%3Foption%3Dcom_docman%26task%3Ddoc_download%26gid%3D110%26Itemid%3D51&ei=8seqU5-wEaS00wXm14G4CA&usg=AFQjCNFerFoQ4O-nrIdOoUiX7SIkLMb6sA&sig2=MZ6BxmUPm7Gg3CGcH4nknQ&bvm=bv.69620078,d.d2k)

 

So I have written this method in Maple but nothing happen and I don't where the mistakes are. So if somebody could help me, that will be great.

My code is :

 

Hi

I tried to import the modelica library Buildings1.6 from the modelica website and get always the error "Nothing found in the modelica library". 

Is it possible to import modelica libraries? 

Thank you very much

in maple 12 or 15

assume 

result := Vector(10);

for i from 1 to 10 do

        result[i] := i;

od;

how to plot it against i?

after tried plot(result(x), x=1..10);

Hi all. I am using Maple 18.

1. How can I make maple NOT plot discontinuties with a vertical line? For example, plotting y=tan(x) displays vertical lines. Is there a setting to turn this off permanently?

2. When I type y=sin(x-Pi/2) and press enter, y = -cos(x) is displayed in blue. I am sure they are both the same thing, but I would like to see the expression that I typed, not an alternate expression that Maple wants to display.

3. Why do some expressions require a ; at the end, whilst others don't? Ie. y = sin(x) and y = 1+sin(x) do not, but y=2*sin(x) results in a "Warning, inserted missing semicolon at end of statement"

4. Is there a section on Mapleprimes(this site) where new users can ask questions? I would like to browse it to see what sort of problems other new Maples users have encountered. I am sure that my above questions may have been asked a few times over the years by newbies like myself.

Thanks in advance. :)

hi maple-friends !

for my work i have to solve a system of differential equations numerically - no problem with maple :-)

my problem: how can i get the resulting data of the numeric solutions in a file ?

(for example to use them with gnuplot)

what i have to do exactly ? i know just about writedata and readdata commands...

can anyone send me an example with a few comments ?

greetings,  kreso

 

 

 

 

How can I know the solution is correct??

 

Here is the code:

s := solve(sin(x^2) = 1/2);
test := subs(x = s[1], sin(x^2) = 1/2);

 

 

Does MapleSim 6 cover temperature dependent fluid media? In the modelica standard library (MSL), there is for example a medium model for T-dependent properties, defined by tables or polynomials (Modelica.Media.Incompressible).

 

Is it included in MapleSim 6 or can be somehow modelled?

 

Thanks!

I am trying to produce a worksheet that will give me the two roots of a quadratic equation.

This is what I have:

Maple Worksheet

 

As you can see, It's not giving me the right answers. What do I do?

Thanks,

Paul

 

I see a document with maple graphics in it, but i don't see the maple code in the document.

Has the author protected his code ?
I like to see the maple code used for the document ..how to read this maple code?

Note: try to find answer on the Maple site , but no idea where to find thisinformation on how to set up a document..frustrating.  
 

hi,

i obtained values for h(t) and u(t) and i wana obtaine s(t) , i don't konw how can i do it

 

for h(t) and u(t) ,

 

sol1 := dsolve([4.00000000000000*u(t)^2*h(t)*(diff(diff(h(t), t), t))-8.00000000000000*h(t)^2*(427.2460938*u(t)+385620.1174/u(t)-25671.38673)^2+16.0000000000000*u(t)*h(t)*(427.2460938*u(t)+385620.1174/u(t)-25671.38673)*(diff(h(t), t))+(16406.2500000000*(-29.8200000000000+u(t)))*h(t)^2*(427.2460938*u(t)+385620.1174/u(t)-25671.38673)+7171.87500000000*u(t)*h(t)*(diff(h(t), t))-16406.2500000000*h(t)^2*(30-u(t))*(427.2460938*u(t)+385620.1174/u(t)-25671.38673)+u(t)^2*h(t)-0.225000000000000e-1+0.225000000000000e-1*(.997494986604054+.106105802501554*sin(t-1.5))^2+4.00000000000000*(h(t)*(427.2460938*u(t)+385620.1174/u(t)-25671.38673)+u(t)*(diff(h(t), t)))^2 = 0, diff(u(t), t) = 427.2460938*u(t)+385620.1174/u(t)-25671.38673, h(1.44) = 0.145e-4, (D(h))(1.44) = .12093, u(1.44) = .62], numeric)

 

and s(t) is , s(t)=1/r*d/dt(u(t)*h(t))

 

thanks.

Code was computed on two different PC:
1) Win 8.1, Maple 17.02 x64
2) Win 8.1, Maple 18.01 x64

In brief:

n:=3: 
Grid:-Seq('f(i)', i = 1 .. n):

works well in Maple 17.02 but gives an error in Maple 18.01. Why?

However,

(j -> Grid:-Seq('f(i)', i = 1 .. j))(n):

works well for both Maple versions.

according to examples from Maple help page
http://www.maplesoft.com/support/help/Maple/view.aspx?path=Grid%2fSeq
we have to pass exactly 'f(i)' (not just f(i)) into Grid:-Seq(...). Why?

Why doesn't Digits:=30: work properly for Grid:-Seq(...)?

For details see attached file. Output was produced in Maple 17.02. In Maple 18.01 the output will differ.


restart; n := 3; f1 := proc (i) options operator, arrow; evalf(sqrt(i)) end proc; f2 := proc (i) options operator, arrow; evalf(sqrt(i+1)) end proc; f3 := proc (i) options operator, arrow; evalf(i*Pi) end proc; g1 := proc (f, n) local za, zb, zc, str; str := sprintf("g1(%a,n)", f); za := seq(f(i), i = 1 .. n); zb := Grid:-Seq(f(i), i = 1 .. n); zc := (proc (j) options operator, arrow; Grid:-Seq(f(i), i = 1 .. j) end proc)(n); print("------------------------------"); print(cat("(a):   ", str), za); print(cat("(b):   ", str), zb); print(cat("(c):   ", str), zc); print("------------------------------") end proc; g2 := proc (f, n) local za, zb, zc, str; str := sprintf("g2(%a,n)", f); za := seq('f(i)', i = 1 .. n); zb := Grid:-Seq('f(i)', i = 1 .. n); zc := (proc (j) options operator, arrow; Grid:-Seq('f(i)', i = 1 .. j) end proc)(n); print("------------------------------"); print(cat("(a):   ", str), za); print(cat("(b):   ", str), zb); print(cat("(c):   ", str), zc); print("------------------------------") end proc

3

(1)

g1(f1, n);

"------------------------------"

 

"(a):   g1(f1,n)", 1., 1.414213562, 1.732050808

 

"(b):   g1(f1,n)", 1, 2^(1/2), 3^(1/2)

 

"(c):   g1(f1,n)", 1, 2^(1/2), 3^(1/2)

 

"------------------------------"

 

"------------------------------"

 

"(a):   g1(f2,n)", 1.414213562, 1.732050808, 2.

 

"(b):   g1(f2,n)", 1.414213562, 1.732050808, 2.000000000

 

"(c):   g1(f2,n)", 1.414213562, 1.732050808, 2.000000000

 

"------------------------------"

 

"------------------------------"

 

"(a):   g1(f3,n)", 3.141592654, 6.283185308, 9.424777962

 

"(b):   g1(f3,n)", 3.141592654, 6.283185308, 9.424777962

 

"(c):   g1(f3,n)", 3.141592654, 6.283185308, 9.424777962

 

"------------------------------"

 

"+++++++++++++++++++++++++++++++++++++++++++"

 

"------------------------------"

 

"(a):   g2(f1,n)", 1., 1.414213562, 1.732050808

 

"(b):   g2(f1,n)", 1., 1.414213562, 1.732050808

 

"(c):   g2(f1,n)", 1., 1.414213562, 1.732050808

 

"------------------------------"

 

"------------------------------"

 

"(a):   g2(f2,n)", 1.414213562, 1.732050808, 2.

 

"(b):   g2(f2,n)", 1.414213562, 1.732050808, 2.

 

"(c):   g2(f2,n)", 1.414213562, 1.732050808, 2.

 

"------------------------------"

 

"------------------------------"

 

"(a):   g2(f3,n)", 3.141592654, 6.283185308, 9.424777962

 

"(b):   g2(f3,n)", 3.141592654, 6.283185308, 9.424777962

 

"(c):   g2(f3,n)", 3.141592654, 6.283185308, 9.424777962

 

"------------------------------"

(2)

Digits := 30;

30

 

"------------------------------"

 

"(a):   g1(f1,n)", 1., 1.41421356237309504880168872421, 1.73205080756887729352744634151

 

"(b):   g1(f1,n)", 1, 2^(1/2), 3^(1/2)

 

"(c):   g1(f1,n)", 1, 2^(1/2), 3^(1/2)

 

"------------------------------"

 

"------------------------------"

 

"(a):   g1(f2,n)", 1.41421356237309504880168872421, 1.73205080756887729352744634151, 2.

 

"(b):   g1(f2,n)", 1.414213562, 1.732050808, 2.000000000

 

"(c):   g1(f2,n)", 1.414213562, 1.732050808, 2.000000000

 

"------------------------------"

 

"------------------------------"

 

"(a):   g1(f3,n)", 3.14159265358979323846264338328, 6.28318530717958647692528676656, 9.42477796076937971538793014984

 

"(b):   g1(f3,n)", 3.14159265358979323846264338328, 6.283185308, 9.424777962

 

"(c):   g1(f3,n)", 3.14159265358979323846264338328, 6.283185308, 9.424777962

 

"------------------------------"

 

"+++++++++++++++++++++++++++++++++++++++++++"

 

"------------------------------"

 

"(a):   g2(f1,n)", 1., 1.41421356237309504880168872421, 1.73205080756887729352744634151

 

"(b):   g2(f1,n)", 1., 1.414213562, 1.732050808

 

"(c):   g2(f1,n)", 1., 1.414213562, 1.732050808

 

"------------------------------"

 

"------------------------------"

 

"(a):   g2(f2,n)", 1.41421356237309504880168872421, 1.73205080756887729352744634151, 2.

 

"(b):   g2(f2,n)", 1.414213562, 1.732050808, 2.

 

"(c):   g2(f2,n)", 1.414213562, 1.732050808, 2.

 

"------------------------------"

 

"------------------------------"

 

"(a):   g2(f3,n)", 3.14159265358979323846264338328, 6.28318530717958647692528676656, 9.42477796076937971538793014984

 

"(b):   g2(f3,n)", 3.141592654, 6.283185308, 9.424777962

 

"(c):   g2(f3,n)", 3.141592654, 6.283185308, 9.424777962

 

"------------------------------"

(3)

``

NULL


Download Grid[Seq].mw

Hello guys...

please help me to solve these equation.I have some equation with some boundary condition.

Why can't I have good results for it?
q3:=-0.1080877976e-1:
q2:=0.04351279185:
q1:=-0.7037638761e-1:
q0:=0.05575044494:
c:=3:

eq := q3*m^6+q2*m^4+q1*m^2+q0;
rishe := solve(eq = 0, m);
a := 1/(2*c); rho := a/`#msub(mi("t"),mn("1"))`;
f0 := evalf(cosh(abs(rishe[1])*xi));
f1 := evalf(cosh(abs(Re(rishe[3]))*xi)*cos(abs(Im(rishe[3]))*xi));
f2 := evalf(sinh(abs(Re(rishe[3]))*xi)*sin(abs(Im(rishe[3]))*xi));
pin := C0*k0*f0+C1*f1+C2*f2;
ppin := diff(pin, xi); pis := C0*f0+(k1*C1+C2*k2)*f1+(C2*k1-k2*C1)*f2;
pin1 := evalf(subs(xi = a, pin));
pin2 := evalf(subs(xi = -a, pin));
pin3 := evalf(subs(xi = a, ppin));
pin4 := evalf(subs(xi = -a, ppin));
pis1 := evalf(subs(xi = a, pis));
pis2 := evalf(subs(xi = -a, pis));
hal := solve({pin1 = sigma01xx, pin2 = sigma01xx, pin3 = 0, pin4 = 0, pis1 = sigma01xy, pis2 = sigma01xy}, {C0, C1, C2, k0, k1, k2});
how can I have a good result with this method?
please help me to solve this multi equations multi variable.

First 1415 1416 1417 1418 1419 1420 1421 Last Page 1417 of 2434