MaplePrimes Questions

Search Questions:

Latest Questions Latest Questions Feed

I have a long list of two element lists, for example,

A := [ [2,3], [4,5] ,[6,7]];

I want apply '/' to the elements of each sublist.

The result will be

R := [2/3, 4/5, 6/7];

I do not need the list, I could use vectors or matrices.

Is it possible to do this other than by iteration?

Tom Dean


I want to set up a couple of tables. One problem I have is setting up the list of names for the columns.  u0 etc are actual variables. Being trying to use  ` ` and ' ' to stop them evaluating. I have even more problems with  h6 as a name and symbols Sigma etc.

How do you do this so it looks neat and the name preferably doesn`t display the  ` ` or " " or '  '?

 

 

"Names:=[`u0`,`u1`,`u2`,`u3`,`Px`,`Py`,`Pz`,`-`,`'g0'`,`'g1'`,`'g2'`,`'g3'`,`-`,`\`∑u`^(2)`,`-`\`,∑p`^(2)`,`-`,` ∑g^(2)`]"

Error, unable to delimit strings/identifiers

"Names:=[`u0`,`u1`,`u2`,`u3`,`Px`,`Py`,`Pz`,`-`,`'g0'`,`'g1'`,`'g2'`,`'g3'`,`-`,`\`∑u`^2`,`-`\`,∑p`^2`,`-`,` ∑g^2`]"

 

``

``

``


Download Table_Headers.mw

greatings all,

I want to calculate energy momentum tensor for a given metric. is it possible to calculate it in the physics package?
thanks.

Hi

Please find the attached file

The command PolynomialInterpolation doesn't work, I will be appreciate if you can help me

Thanks

 

Question.mw

hi.i am a problem for solving this non linear algebric equation.

please help me...thanks

FSOLVE.mw

FSOLVE.mw

 

With the RationalFunctionTutor generated then modified code (see egn2.mw attached).  Is it possible to make linestyle=spacedash for the two vertical asymtotes?  By selecting the graph and choosing from the plot menu the linestyle can be changed, but is there a way to do this with commands in the program code? 

egn2.mw

 

When I was editing the head of the question (? instead of .), its body disappeared. Please, insert it again.

Regard,

Markiyan Hirnyk

Maple 15.

I have a set of equations I can solve manually, but, solve fails.

restart;
eq1 := tgtX[1] = 0;
eq2 := tgtY[2] - y[2]    = m[2]*(tgtX[2]-x[2]);
eq3 := tgtY[3] - y[3]    = m[3]*(tgtX[3]-x[3]);
eq4 := tgtY[4] - y[4]    = m[4]*(tgtX[4]-x[4]);
eq5 := tgtY[2] - tgtY[1] = vy*t[2];
eq6 := tgtY[3] - tgtY[1] = vy*t[3];
eq7 := tgtY[4] - tgtY[1] = vy*t[4];
eq8 := tgtX[2]           = vx*t[2];
eq9 := tgtX[3]           = vx*t[3];
eq10:= tgtX[4]           = vx*t[4];
#
# solve the equations
eqs  := {eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9,eq10};

solvx := solve(eq10,vx);
solvy := solve(eq7,vy);
sol1  := subs(vx=solvx,{eq8,eq9});
sol2  := subs(vy=solvy,{eq5,eq6});

soln  := subs(sol1,{eq2,eq3});

soln  := subs(tgtY[2]=solve(sol2[1],tgtY[2]),soln);
soln  := subs(tgtY[3]=solve(sol2[2],tgtY[3]),soln);
soln  := subs(tgtY[1]=solve(soln[1],tgtY[1]),soln[2]);
soln  := solve({eq4,soln},{tgtX[4],tgtY[4]});

# this returns empty solution
solve(eqs,{tgtX[4],tgtY[4]});

Any ideas?

Tom Dean

Hello,

Is there an option/ or a way so as to ask pointplots to plot a interpolated curve for the points defined ?

Thank you for you help.

Hello,

 

I have a complex set of non linear diff eqns in the form :

y1'' = f(y1',y1,y2'',y2',y2,y3'',y3',y3,y4'',....,y6'',y6',y6,u1,u2,u3,u4) ;

y2'' = f(y1'',y1',y1,y2',y2,y3'',y3',y3,y4'',....,y6'',y6',y6,u1,u2,u3,u4)

and so on ... y6''=(...)

As I want to resolve this coupled systeme in matlab using @ODE45... I wanted the equations in the form : y1''=f(y1',y1,y2',y2,....) and so on ... => X'[] = f(X[],U[])

 

How can I force maple to rearrange a system of coupled eqns with only the variables i want ?

 

I know this is possible beacause it is a nonlinear state space model but maple do not work with nonlinear state space model... It give me error when I tried to create statespace model with my non linear diff eqns.

 

Thanks a lot !


----------------------------------------------------------------------------------------------------------------------
Introduction

I have a matrix (named DC on the piece of code below) all the elements of which are complex numbers a+b*I with a and b floating point numbers.
I want to obtain the real part of DC.

Obviously, if you do something like :
DC := Matrix(2,2, [1.0+1.0*I, 1.0-1.0*I, -1.0+1.0*I, -1.0-1.0*I];
Re~(DC);

the result corresponds to the desired matrix

----------------------------------------------------------------------------------------------------------------------
Context

In fact this matrix DC comes from some computations  described in the piece of code below

# Purpose :
# Given N points in a plane (here  in [0,1]X[0,1]), compute the matrix DX of distances between these points
#
# Example : if Pi and Pj are two such points, DX[i,j]=DX[j,i] denotes the Euclidian distance between Pi and Pj
#
# As I did not be able to find any single function in MAPLE that would construct DX , I proceed that way :
#   1/ let X the (N,2) matrix that contains the coordinates of the N points
#   2/ I represent these  N points as N complex numbers (vector C)
#   3/ I construct the (N,N) matrix MC = <C | C …..| C>
#   4/ I put MC = C – Transpose(C) :
#   5/ I take the norm DX of each elements of DC : DX := abs~(DC)
#       At this point, DX should contain the desired distances
#       But, due to floating point arithmetics, each element of DX writes a+0.*I where a is some floating point number)
#   6/ Last stage : execute Re~(DX)
#

with(Statistics):
with(LinearAlgebra):

N := 4:
X := Matrix(N,2, convert(Sample(Uniform(0,1), 2*N), list)):  #just an example

C   := X[..,1] +~ X[..,2] *~I;
MC := Multiply(C, Vector[row](N, 1));
DC := MC - Transpose(MC);
DX := abs~(DC);
Re~(DX)


----------------------------------------------------------------------------------------------------------------------
 My observations : 

1/ Maple 2015, Windows XP, 64 bytes
Re~(DX) returns DX and does not remove the imaginary (0.*I) part
But  Matrix(N, N, Re~(convert(DC, list))) does (which is a satisfactory, even if not clever, stopgap)

Why (it is just a question to help me to understand correctly how MAPLE proceeds) Re~(DC) does not (seem) to work here ?


2/ Maple 2015.2, Mac OS X El Capitan
DX := abs~(DC) gives me this strange result :
If (for instance) DC[i, j] = -1 – 2*I, DX[i, j] = +1 + 2*I
According to the compatibility problems between Maple 2015.1 and “El Capitan” (fixed from February), could it remain a few other problems ?

Last but not lesat : Did I do any syntax error ?


 I look forward to your responses

Hello,

I have a little question about the property "local" or not of a index in a for loop.

I notice that when I make "for loop" the index i is not local. In the small example, when I ask to evaluate i after having done this loop, the answer is 5 and not i.

Example :

for i from 1 to 4 do
i^2
od;

i; --> 5

How can I do to ask Maple to use index as local ?

Thanks a lot for your help.

 

Dear all,

I have a question: how to compute the roots of exp(z) = -1 with z in C? 

I tried: 

fsolve( exp(z) = -1, z, complex );

But it only gives one root (0.1671148658e-3+4.934802220*10^9*I) which does not even seem to be correct. I would prefere smth like z_n = I*(2*n-1)*pi or at least multiple roots...

By using

solve(exp(x) = -1, x);

it returns I*Pi.

 

MATLAB MuPAD gives the desired result:


solve(exp(x) = -1, x)

(PI*I + 2*PI*k*I, k in Z)

 

 

Thanks!

solarsysem.mw Sorry for the repost but this is my newest document.

I have to create a solar system model on maple by defining a force equation then using the seq function to create a diffeq and then solving those differential equations using the initial conditions with the sun at (0, 0, 0) in xyz coordinates.

It works until my last "ic1" entry and I get an error in dsolve/numeric/process_input

I'm pretty desperate, I'll appreciate any help I can get

 

 

 

 

I am a new user. I have a worksheet and need to see how the the procs are being accessed as it does not look like they are being called and executed as I would expect. What is the most efficient way to debug and see the calling order of my Procs?

 

Thanks in advance,

Bonnie

1 2 3 4 5 6 7 Last Page 3 of 1304