MaplePrimes Questions

Hello,

I'm having some difficulty solving a set of equations. For example

dn/dt = Const*(phi - n)

ds/dt= Const*(phi-n)

s = d2 phi/dx2 + d2 phi/dy2

How do you solve a system like this? It is 2 equations with 2 unknowns, but it is the s variable that is evolved, i.e. ds/dt, instead of phi.

Anyone know of some code that could do this? (periodic boundary conditions)

Better yet, how do you formulate this as a regular ODE for n and phi?

 

I stumpled upon an exercise involving calculating double points for the spacecurve for a vector function defined in the plane. It reduces to solving two equations with two variables. The command solve is usually the way to find solutions, but since the equation contain a trigonometric function, Maple gives the solutions parametrized by aritrary constants _Z and _B. It is however cumbersome to 'decipher' the possible solutions as I do in the attached Maple file.  

I wonder if Maple have a way to deliver the solutions numerically in the interval from -4 to 4? If it had been a single equation this would have been possible, I know. 

 

NB! I know I can use the symmetri in the current example, but I am interested in a general technique to solve these kind of equations. 

 

Download Solving_system_of_equations_including_trigonometric_functions.mw

 

Regards,

Erik

 

Dear Users!

Hope everyone fine here. I have following three quires that need to be fix.

1. I want to collocate Vector IntXYZ1 and IntXYZ2 present in file Q1 in such a way that the first M1M2 + 2(M3-1)M2 + 2(M3-1)(M1-2) rows are zero and other rows are collocated at x=(i-1)/(M1-1), y=(j-1)/(M2-1), t=(k-1)/(M3-1) for i = 2,3,…,M1-1, j = 2,3,…,M2-1, k = 2,3,…,M3 as given as XX (of order 27 by 27 with first 25 rows are zero) for M1=M2=M3=3

 

2. Next, in file Q2 we have a Vector b with some entries which are actually the values of chi[1, 1, 1], chi[1, 1, 2],...,chi[2, 2, 2] in such a following way

(Vector(8, {(1) = chi[1, 1, 1], (2) = chi[1, 1, 2], (3) = chi[1, 2, 1], (4) = chi[1, 2, 2], (5) = chi[2, 1, 1], (6) = chi[2, 1, 2], (7) = chi[2, 2, 1], (8) = chi[2, 2, 2]})) = (Matrix(8, 1, {(1, 1) = 0, (2, 1) = 0, (3, 1) = 0, (4, 1) = 0, (5, 1) = 1.000000000, (6, 1) = 1.000000000, (7, 1) = 1.000000000, (8, 1) = .3678794412}))

Matrix B given in file Q2 have entires which are the linear cobiniation of chi[1, 1, 1], chi[1, 1, 2],...,chi[2, 2, 2]. I want to evaluate matrix B at the values of chi[1, 1, 1], chi[1, 1, 2],...,chi[2, 2, 2] which are obtained in vector b.

3. I want to recall a vector B in file Q3 at highlighted portion and B matrix is present in Q4. Which is the command to recall or export a matrix which contain in some other file like in file Q4.

I shall be very grateful for your support.

Q1.mwQ2.mwQ3.mwQ4.mw

 Let d an integer ">=5 " and 
                    "lambda  in ]-(1)/(2),-(1)/(d+1)[. "
Put
> gamma[s+1,d]=((s+1)[d]((d+1)lambda+s))/(2^(d+1)(lambda+s)[d+1]).;
We need to show that
> gamma[s+1,d]>=-(1)/(2^(s+1)),;
for 
> s=1,...,[(d+1)/(2)].;
                                   
 a[k] designates the pochhammer symbol.

Thanks a lot 

Would anybody tell me that what does it mean

Warning, A new binding for the name `pdetest` has been created. The global instance of this name is still accessible using the :- prefix, :-`pdetest`.  See ?protect for details. pdetest

Does it mean that the solution satisfies the main equation? because doing manual calculations doesn't satisfy.

Here is my file test_3.mw

I am currently struggling with a piecewise functions. Seeing as this function is defined over a large number of breakpoints, it would seem that Maple is unable to execute a certain integration (over a particular interval). Since the first derivatives match up at all breakpoints and the piecewise function looks perfectly smooth to my eyes, I figured that I might obtain a sensible result approximating the function by means of a polynomial and integrating based on the resulting approximation. When I try to use minimax from numapprox, however, I just receive an error message to the effect that:

Error, (in evalf/int/CreateProc) function does not evaluate to numeric

I'd very much appreciate it if anyone had any pointers on how I might find a reasonably precise (not necessarily polynomial) approximation for a seemingly smooth piecewise function with a large number of breakpoints.

Many thanks.

Edit: Please find attached my worksheet: worksheet.mw. My goal is to approximate the function Z over the interval 5/3 to 5 by something that is not defined in a piecewise manner.

 

 

Dear all

I have a matrix defined using loop 

How, can I print the value of the  matrix

Print_vaue_G.mw

thank you

Dear all

I have a table with entries obtained using maple code, how can I copy this table to powepoint as image 

many thanks

 

How do we replace D^i by diff(y(x),x$i) in did:=D^14+23*D^13+144*D^12
in Maple 13?

Thank you!

mapleatha

 

I have the expression:

This works (Ans. 144):

coeff(144*D^10,D,op(2,op(2,144*D^10)));

This works (Ans. 144):

coeff(op(3,did),D,op(2,op(2,op(3,did))));

Why doesn't this work?

eval(coeff(op(i,did),D,op(2,op(2,op(i,did)))),i=3);

Why doesn't this work?

subs(i=3,coeff(op(i,did),D,op(2,op(2,op(i,did)))));

I need those "generic" substituions for certain loops that I am making.

Thank you!

mapleatha

 

 

sometimes I have a need to do an assignment inside  operator call `if`(......) . but it is not possible it seems to do this in Maple.

This happens when I am using `if`(...) inside cat() to build a long string, and  depending on some condition, different string is build.  

This works fine in general, until I need to assign new value to a variable at the same time as I am building the string.

An example will make it more clear. Instead of the following

str:="A";
x:=10;

str:=cat(str,`if`(x=10," it was 10","it was not 10"));

if x=10 then
   x:=11;
else
   x:=9;
fi;                         

I'd like to do something like this (which does not work in Maple)

str:="A";
x:=10;
str:=cat(str,`if`(x=10,  x:=11;" it was 10" , x:=9; "it was not 10"))

Tried assign() also. Does not work.  I tried different variation on the above, none works. 

In Mathematica, the above is possible. But this is using standard `If`, which can be inlined

Is it possible to do something like this in Maple? 

The reason is that I do not have to do the checking twice: once to build the string, and once after that is done, in order to do the assignment. It is better if both are done in one place. The above is just an example. I could have more than one `if` inside as I am building the long string. 

Btw, how does one look up help on the operator if and not the statement if ? the help page for if does not talk about it or give any examples.

Maple 2020.2

If I set

B:=[1,2^(1/3),2^(2/3),I*sqrt(3),I*sqrt(3)*2^(1/3),I*sqrt(3)*2^(2/3)];

and then let

g:=B[2]+B[4];

I would like to be able to solve for g^2 in terms of the (basis) B, i.e.

solve(expand(g^2)=c[1]*B[1]+c[2]*B[2]+c[3]*B[3]+c[4]*B[4]+c[5]*B[5]+c[6]*B[6],{c[1],c[2],c[3],c[4],c[5],c[6]});

However, Maple does not seem to be able to recognize g^2 as a linear combination of the elements in the set B, in particular that g^2 = -3*B[1] + B[3] + 2*B[5]

A parallel question would be whether one could, for example, do something like this:

coeff(expand(g^2),2^(2/3))

but Maple does not compute coeffiencts except with respect to indeterminates.

Does anyone have an idea how to do such a computation? Thanks.

(The set B is a basis of the field extension of Q given by adjoining 2^(1/3) and sqrt(-3) and I'm trying to find a so-called 'primitive element' for this field extension.)

 

EDİT:
I wrote a procedure in order to add the legends inside plots as follows:

restart:
newlegend:=proc(f::algebraic,g::algebraic,x_left,x_right)
local A,B,location,y_min,y_max,L1,L2,rect,T,F,G:

y_min:=min(minimize(f,x=x_left..x_right),minimize(g,x=x_left..x_right));
y_max:=max(maximize(f,x=x_left..x_right),maximize(g,x=x_left..x_right));
F:=unapply(f,x):
G:=unapply(g,x):
L1, L2:=plottools:-line([x_left,0.9*y_max],[x_left+abs(x_right-x_left)/15,0.9*y_max],color=red), plottools:-line([x_left,0.7*y_max],[x_left+abs(x_right-x_left)/15,0.7*y_max],color=blue):
rect:=plottools:-rectangle([x_left,y_max-abs(y_max-y_min)/3],[x_left+abs(x_left+x_right)/4,y_max],color=cyan);
T:=plots:-textplot([[x_left+abs(x_right-x_left)/9,0.9*y_max,f],[abs(x_left+x_right)/9,0.7*y_max,g]]):
A:=plot(F(x), x=x_left..x_right, style=line, color=red   ):
B:=plot(G(x), x=x_left..x_right, style=line,  color=blue  ):

plots:-display(A, B, L1, L2, T,rect,  scaling=constrained, size=[800,300],axes=boxed);
end proc:
newlegend(sin(x),cos(x),0,2*3.14)

 

Question 1: The lines behind the cyan rectangle seem. How to make the rectangle opaque? 

Question 2:  Could you help me improving the procedure? Because I have bad results for some functions. 

For example;

newlegend(exp(x),x,0,3)

Some Suggestions:

  • If we add an option to change the location of the legends like 'northeast' or 'southwest' etc, it will be a really good procedure.
  • If we add an option to remove the rectangular like "rectangular=off", it will be great.

If you share your valuable ideas and comments, I will be very glad. 

I am trying to rearrange the elements of an equation by the absolute value of their coefficients. eg -3y^2 x+2x z^2+6z^2 to

2x z^2 -3y^2 +6z^2 

 

Download Rearange_test.mwRearange_test.mw

First 431 432 433 434 435 436 437 Last Page 433 of 2420