MaplePrimes Questions

Hi,

May  I please get a Maple code to solve the below Perturbation Iteration Solutions for Volterra Integral Equations? 

I shall be very much grateful if I can get the Maple Code.

And possible plotting

Thanks

Any comment, idea or innovation to calculate this parametric integral?

Note M, II, JJ are arbitrary positive integers (0<M, II, JJ<11).

F must be a function of Pm at the final!

``

restart

M := 3:

JJ := 5

II := 5

with(ArrayTools):

W := RandomArray(II, JJ, M):

V := ArrayTools:-RandomArray(II, JJ, M):

w := add(add(add(W[i, j, m]*LegendreP(i-1, x)*LegendreP(j-1, y)*p[m], i = 1 .. II), j = 1 .. JJ), m = 1 .. M):

v := add(add(add(V[i, j, m]*LegendreP(i-1, x)*LegendreP(j-1, y)*p[m], i = 1 .. II), j = 1 .. JJ), m = 1 .. M):

L := add(add((LegendreP(i-1, x)*LegendreP(j-1, y))^2, i = 1 .. II), j = 1 .. JJ):

H := 1+tanh(w-v)

F := int(H*L, [y = -1 .. 1, x = -1 .. 1])

Warning,  computation interrupted

 

``

``

Download integralproblem.mw

What does the following message imply?

"Error, (in Engine:-Dispatch) invalid boolean expression: 0"

For a vector of floats like this:

v := < 4,3,2>;

How do I get the 24 (=4*3*2)?

Thanks.

Now, there are two unknows, and i cant seem to get it right. 

Its "the method of the least squares", and it has gone wrong. How terrible, now ive made many books, but this book always sets me up, you may have guessed it: the Dutch Math book strikes again... 

Ive tried to use a value, it looks like i used the rights steps, but the wrong input, the solution does not give me anything that looks like it is doing the rigth thing. Checking the new formula does not give the solution it is suppose to give. Now i know they mentioned that x=1/I but that does not give the right answer either. 

Okey the question states: "A battery delivers a current I to a circuit with an external(not inside the battery) resistance Ry. The battery has an internal resistance Ri and delivers a source tension (voltage) U. These are the formulas U=(Ry+Ri)*I, of which follows: Ry+Ri=U/I. We state that x= 1/I and then we get Ry+Ri=U*x, of which follows: Ry=U*x-Ri. 

That last formula gives a linear conjunction between x and Ry. There are a couple of measurements done, of which different values of the resistance Ry and the current I is measured (look at table 5.4). The value of x is determined by the smallest squares method." 

While i did not use x instead of I, it made no difference. I was no where close to the results. I think i am misschien something.


`<,>`(`<|>`(1, 1.5, 2, 2.5, 3), `<|>`(1.31, 1.01, .81, .67, .56))

Matrix(%id = 18446745647253576510)

(1)

"f(t):=t/(2);seq(f(t),t=2..6);Sum(f(t),t=2..6)=sum(f(t),t=2..6)"

proc (t) options operator, arrow, function_assign; (1/2)*t end proc

 

1, 3/2, 2, 5/2, 3

 

Sum((1/2)*t, t = 2 .. 6) = 10

(2)

10*(1/5)

2

(3)

convert(`<,>`(1.31, 1.01, .81, .67, .56), `+`)

4.36

(4)

4.36*(1/5)

.8720000000

(5)

`<,>`(1, 1.5, 2, 2.5, 3).`<,>`(1.31, 1.01, .81, .67, .56)

7.80000000000000071

(6)

"f(t):=(t/(2))^(2);seq(f(t),t=2..6);Sum(f(t),t=2..6)=sum(f(t),t=2..6)"

proc (t) options operator, arrow, function_assign; (1/4)*t^2 end proc

 

1, 9/4, 4, 25/4, 9

 

Sum((1/4)*t^2, t = 2 .. 6) = 45/2

(7)

solve([(45/2)*a+10*b = 7.80000000000000071, 2*a+b = 4.36], [a, b])

[[a = -14.32000000, b = 33.00000000]]

(8)

"f(t):=-14.32 t+33"

proc (t) options operator, arrow, function_assign; -14.32*t+33 end proc

(9)

plot(proc (t) options operator, arrow, function_assign; -14.32*t+33 end proc)

 

f(1)

18.68

(10)

``

Maybe someone knows an answer to this. 

Thank you!

Greetings,

The Function 

Download Mapleprimes_Question_Book_2_Paragraph_5.12_Question_3.mw

The result is wrong and I want to know the reason. the dot is the  Matrix multiplication.


I cannot find documentation on Typesetting commands that can explain the following

From the help page of apply:

lprint(Typesetting[Typeset](sqrt(x)));

Typesetting:-msqrt(Typesetting:-mi("x"))

 

The first argument to Typeset has type uneval , signifying that it is not evaluated before being passed to Typesetting[Typeset].

Questions:

Where can I see  in the lprint output that the first argument is of type uneval?
Is sqrt(x) the first argument?
What does mi do?

Download help_page_apply.mw

I was introduced to DataFrame by some kind people here the other day and I thought I understood.  Then I tried this

M := DataFrame(<0,0,0;0,1,a;0,a,1>,rows=[0,1,a],columns=[0,1,a])

Now M[1, a] returns 0.  What's going on here? 

do not accept substitution after line EQ
restart;
with(LinearAlgebra);
A := [1, -2];
B := [-2, 3];
C := [1, 1];
M := [x, y];
ProjPL := proc(C, A, B) local M, AB, AM, Q, eq, EQ, eq1, a, b, c, t, tt, n, dist, x, y, xH, yH, H, CH, no; M := [x, y]; AM := M - A; AB := B - A; Q := Matrix(2, [AM, AB]); eq := Determinant(Q); a := coeff(eq, x); b := coeff(eq, y); c := tcoeff(eq); dist := abs(a + b + c)/sqrt(a^2 + b^2); n := [a, b]; x := C[1] + n[1]*t; y := C[2] + n[2]*t; EQ := eq = 0; tt := solve(subs(x = C[1] + n[1]*t, y = C[2] + n[2]*t, EQ), t); xH := subs(t = tt, x); yH := subs(t = tt, y); H := [xH, yH]; CH := H - C; no := sqrt(CH[1]^2 + CH[2]^2); RETURN(EQ, dist, H, no); end proc;
ProjPL(C, A, B);
Thank you for your help.

Here is a graph (g.txt) in Graphlet (gml) format that I threw up with another program. I want to import it by maple. 

I am expecting to do two things:

  • Import the graph correctly;
  • draw the graph according to the vertex position, vertex color, vertex shape and edge color etc. in the file.

This question may come from https://www.mapleprimes.com/questions/235457-How-To-Draw-A-Directed-but-Maybe-Not-Acyclic. My intention is to use this format to efficiently pass graphs and other attributes such as vertex positions, vertex colors, and edge colors. 

However maple doesn't seem to be able to handle them even it cannot handle  the above first point well.

Import ("G:\\test\\g.gml");
# or 
GraphTheory:-ImportGraph ("G:\\test\\g.gml",graphlet)

Error, (in Import) incorrect syntax in parse: unexpected number (near 12th character of parsed string)

Error, (in GraphTheory:-ImportGraph) incorrect syntax in parse: unexpected number (near 12th character of parsed string)

I'm not sure what type of the mistake is here.

 

Mathematica can do it nicely:

g=Import["G:\\test\\g.gml"]

List @@@ PropertyValue[g, VertexLabels]
GraphEmbedding[g]

 

{{8, "x8"}, {12, "b3"}, {14, "x14"}, {2, "b2"}, {13, "x13"}, {5, 
  "r3"}, {7, "r5"}, {9, "r6"}, {11, "x11"}, {6, "r4"}, {1, "b1"}, {15,
   "x15"}, {3, "r1"}, {4, "r2"}, {10, "x10"}}

{{1080, 1440}, {480, 320}, {660, 560}, {420, 160}, {1380, 880}, {1020,
   720}, {720, 880}, {660, 800}, {2160, 0}, {0, 0}, {1500, 
  480}, {1320, 800}, {1800, 240}, {900, 1120}, {1080, 1360}}

PropertyValue[g, VertexStyle]

 

Is there a way to write a function definition that involves multiple cases so that it looks nice with braces as one would write on paper. 
For example, the function $f(x)=|x|$ which is $f(x)=x$ if $x>0$ and $f(x)=-x$ if $x<0$.

First of all, I'd like to be able to write this out with braces in non-executable math in my worksheet. This would already be great.

Then, is it possible to actually define a function this way (ie, not just display the braces in non-executable, but actually run in executable math and have a defined function)?

I would like to create a fuction from the values in a vector. Say I have a 3 vectors , A,F,Theta.

A=col vect of Amplitudes (order n)
F=col vector of Frequecies (order n)
Theta=col vector of phases (order n)

I want to create a function 

f(x):=x->A[0]*cos(F[0]*x+Theta[0] + A[1]*cos(F[1]*x+Theta[1] + ... + A[n]*cos(F[n]*x+Theta[n]

I would then like to create a vector x, and get the values for f(x). I am trying to create a function that is a sum of sinusoids that I can then create data from using a vector x.

I have tried many things but I can't seem to get it right. Can anyone help me with this.

Thanks

Hello guys,

I created a palette, but when I click on an entry, the following occurs:

If the entry line, where the mouse cursor is, is empty, insertion takes place on this line.
If the input line has any expression and the mouse cursor is to the left of the expression, insertion takes place on the line above.

If the input line has any expression and the mouse cursor is to the right of the expression, insertion takes place on the line below.

Does anyone know how to fix this?

Sincerely,

Oliveira

Before answering, Please Note,

Do not suggest I use

maple <filename.maple>

The conversion in maple to convert an ".mw" file in xmaple for a text file to be executed with

maple command

does not work and I therefore need a way to execute and operate a ".mw" workksheet straight in terminal without the need for X.

This is a Linux based question.

I have batches of about 50 maple processes that I run in parallel accross several 32-core and 64-core servers.
I am not using the built in spawning process commands, but rather run a new instance of maple.

Some of these batches need to be developed in xmaple it is just not feasable to do it in a text editor to be executed by "maple"

QUESTION:

Is there any switches in maple that I can run a ".mw" maple file as a terminal operation without starting the interface ?

e.g. how can I run

xmaple <mystery switches> maplefile.mw   such that the interface doesnt load but the file is executed completely in terminal without the need for X.

Thanks

Hello, 

I am new to modelica modeling in Maplesim, how do I add ports to the custom component created by Modelica Custom Component in MapleSim?

thanks. 

First 238 239 240 241 242 243 244 Last Page 240 of 2425