Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi,

I am fairly new to Maple and trying to figure out how to output text to a file, but nothing seems to be working. I would like to generate code files for Julia using Maple expressions.

I am in worksheet mode, using a 'code edit' region. If I do:

jlfile := fopen("./juliafunc.jl",WRITE,TEXT);

then the file is created, as intended. However, neither of the following commands seem to write any text to the file:

writeline(jlfile,"This is a test.");
fprintf(jlfile,"This is a test.\n");

(these are similar to the examples in the dcumentation)

Is there something I am doing wrong? I am using Maple 2020 on Linux.

Maple help stopped working, when I call the help from the menu or the corresponding button in the toolbar, the help is not displayed. What I can do?

Hi everyone, I have a question regarding the time in a plot.

The idea behind is, that i dont have to adjust the time after every change of parameters.

I have a function that only is valid until a certain time. I evaluete the time until cut off for example like this:

tempLrest := Optimization:-Minimize(tempLrest(t), t = 0 .. 2);
              tempLrest := [2.47883089786094 10^-8  , [t = 0.414486068771508]]

cutoff := tempLrest[2];

Now i want to call "cutoff" in an odeplot like this: 

odeplot(sol1, [t, z(t)], 0 ..cutoff , size = [300, 300])

unfortunately this doesnt work. 

Does everyone know how to solve this problem?

Thank you in advance!

Hello everybody. My lovely Dutch math book is progressing. Last week ive been scanning a copy of Advanced Engineering Mathematics from the library, a grueling task which took me 24 full hours to complete. But ive got a book that should be able to teach it with the right mindset and social contract (this Dutch book is too distracting, i cant even think). I will finish it though.. The sturdy that stands i guess. 

Any way the problem here is that the side from which a line interfaces with a shape in the 3D plane only has an x component and is lacking a y and z component. So the calculations are impossilbe, because you cant devide through 0. I suspect its something simple, but like said the repertoire is so terrible it feels like im scrambled eggs if i even remotely think about solving the problem. The facade makes the man right? Feels more like one of these spagetti westerns with only a frontage without anything behind it. 

The Question is as follows (translated from Dutch): "Given is the half ball with the equation z=sqrt(4-x^2-y^2). Check that the given point lays on the half ball and determin the eqation of the interface with the half ball in the given point."

So basically have a vector from that given point that will hit the surface of the half ball.   
 

#Opdracht 2

#a.

restart

z := sqrt(-x^2-y^2+4)

(-x^2-y^2+4)^(1/2)

(1)

"f(x,y):=sqrt(4-x^2-y^2)"

proc (x, y) options operator, arrow, function_assign; sqrt(-x^2-y^2+4) end proc

(2)

a := f(1, 1, sqrt(2))

2^(1/2)

(3)

partafgx := D[1](f)

proc (x, y) options operator, arrow, function_assign; -x/(-x^2-y^2+4)^(1/2) end proc

(4)

b := partafgx(1, 1, sqrt(2))

-(1/2)*2^(1/2)

(5)

c := (D[2](f))(1, 1, sqrt(2))

-(1/2)*2^(1/2)

(6)

raakvlak := z-a = b*(x-1)+c*(y-1)

z-2^(1/2) = -(1/2)*2^(1/2)*(x-1)-(1/2)*2^(1/2)*(y-1)

(7)

evalc(%)

z-2^(1/2) = -(1/2)*2^(1/2)*x+2^(1/2)-(1/2)*2^(1/2)*y

(8)

z = solve(raakvlak, z)

z = -(1/2)*2^(1/2)*x+2*2^(1/2)-(1/2)*2^(1/2)*y

(9)

#b.

restart

"f(x,y):=sqrt(4-x^2-y^2)"

proc (x, y) options operator, arrow, function_assign; sqrt(4-x^2-y^2) end proc

(10)

a := f(2, 0, 0)

0

(11)

partafgx := D[1](f)

proc (x, y) options operator, arrow, function_assign; -x/(4-x^2-y^2)^(1/2) end proc

(12)

b := partafgx(2, 0, 0)

Error, (in partafgx) numeric exception: division by zero

 

c := (D[2](f))(2, 0, 0)

Error, (in unknown) numeric exception: division by zero

 

raakvlak := z-a = b*(x-2)+c*y

z = b*(x-2)+c*y

(13)

z = solve(raakvlak, z)

z = b*x+c*y-2*b

(14)

#ik krijg er niets uit wat ergens op lijkt

#c.

restart

"f(x,y):=sqrt(4-x^2-y^2)"

proc (x, y) options operator, arrow, function_assign; sqrt(4-x^2-y^2) end proc

(15)

a := f(sqrt(2), sqrt(2), 0)

0

(16)

partafgx := D[1](f)

proc (x, y) options operator, arrow, function_assign; -x/(4-x^2-y^2)^(1/2) end proc

(17)

b := partafgx(sqrt(2), sqrt(2), 0)

Error, (in partafgx) numeric exception: division by zero

 

c := (D[2](f))(sqrt(2), sqrt(2), 0)

Error, (in unknown) numeric exception: division by zero

 

raakvlak := z-a = b*(x-sqrt(2))+c*sqrt(2)

z = b*(x-2^(1/2))+c*2^(1/2)

(18)

z = solve(raakvlak, z)

z = -b*2^(1/2)+c*2^(1/2)+b*x

(19)

``

Thank you very much. The first answer "a" was right, but for the other ones, this method they gave does not work. 

Greetings,

The Function 

Download Mapleprimes_Question_Book_2_Paragraph_5.5_Question_2b_2c.mw

After this code:

g1 := PermutationGroup({[[1, 2]], [[1, 2, 3], [4, 5]]})

g1:=<(1, 2), (1, 2, 3)(4, 5)>

I can get a string "<(1, 2), (1, 2, 3)(4, 5)>". Could I use the string to restore the PermutationGroup with an elegant method?

Here is a worksheet with a system of differential equations

Maple_DE_Example.mw

The system is

y'(x)=z(x)*g(x)

z'(x)=y(x)*g(x)

where g(x) is a random number generator seeded by x. That is, for the same x, g gives the same result. 

Using the classical method as an option to dsolve, a solution is plotted. Using rkf45, however, there is pretty much always an error that says

Warning, cannot evaluate the solution further right of ...

Why does it work with classical but not rkf45?

Is there a command that will count the number of digits in a binary number or any number for that matter? For example: 10110  has 5  digits in binary representation.

restart

I choose to define a number in base 10.

number := 22

22

(1)

Then I choose to convert that number into base 2.

number_binary := convert(number, binary)

10110

(2)

On visual inspection it is determined that number_binary has 5 digits in binary representation.

Is there a common command that can count the number of digits in a binary number? Such as, 10110 has 5 digits.

Download Count_digits_in_a_binary_number.mw

Count_digits_in_a_binary_number.mw

I am trying to reproduce this visualization of RGB:

Does any one have anything like this for Maple?

As you can see in the figure below, 

it shows a very strange "font",

you can obviously see very weird spacing even inside one word...

Who knows what's wrong???

Thanks a lot.

B/R

Jankel

Dear all 

I approximate the root of a given polynomial using Newton method. 

Whem I change the output option the number of iteration change as displayed, 

Why changind only output from animation to plot, the number of iterations displayed with each figure is not the same.

NewtonQuestion.mw

thank you

How can we determine the highest (or peak) value for every hump and at what value of (x, t) in the plot?

peak.mw

Good day,

I am looking for some guidance with the Syrup toolbox

I have a netlist that was generated with the Altium designer Spice simulator (XSpice based), I was able to import it into LTSpice and verrify the results.

I want to move it into maple to make use of the modellica code generation.

I then began modifying the netlist in order to meet the netlist syntax of Syrup. One of the most prominant change I needed to make was the arbitrary input nodes for my Voltage dependant Voltage sources. 

Therefore, for any line that implies arbitrary sources such as:

E_U8_E1 U8_N208620 LO
+ VALUE { IF(V(U8_N208706, 0) > 0.5, 5, -5) }

was changed to:

V1    16   17 1vdc

E_U8_E1 U8_N208620 LO 16 17
+ VALUE { IF(V(U8_N208706, 0) > 0.5, 5, -5) }

This, of course, is a non ideal workaround which brings me to question 1,

Is there a way to define a arbitrary source with the Spice parser in Syrup?

Once these changes were made, it seems the Solve function in Syrup can parse the netlist without issue, however when it gets to the Solve portion it throws the following error:

Solve("file://C:/Users/msavoy/Documents/Spice_cct/inverter_newfet_nonot.cir", 'tran');
Solve: Analyzing SPICE deck "The Apple" (ignoring this line)
Error, (in Syrup:-Solve) invalid input: rcopy uses a 1st argument, A (of type anything), which is missing

Attached is a copy of the netlist, inverter_newfet_nonot.txtI am honestly at a lost as to what could be throwing the rcopy error

Furthermore, I wanted to test out the Modellica code generation in Syurp, it appears that it does not like having subcircuits, as running the test:

V 1 0 1
L1 1 2 L
C1 2 0 C
L2 2 3 L
C2 3 0 C
L3 3 4 L
C3 4 0 C
Vshort 4 5 0
Rt 5 0 1
.SUBCKT TEST A B C Y
V1 14 15 1
EINT YINT 0 14 15
+ VALUE {IF(V(A) > 0.5 && V(B) > 0.5 && V(C) > 0.5, 1, 0)}
RINT YINT Y 1
CINT Y 0 1n
.ENDS TEST
.end

provides the error of:

test_c := ToModelica("file://C:/Users/msavoy/Documents/Spice_cct/test_cct_RCL.txt", 'probes' = ["Rt.v"], 'parameters' = {C = 2, L = 1});
Error, (in Syrup:-ToModelica) invalid input: nodeToModelica expects its 1st argument, node, to be of type nonnegint, but received Y

Is it possible to define a sub circuit in a netlist that is to be converted to Modellica, or do all subcircuits need to be defined in their own file?

Thank you

Consider the function f:=x->sin(x)/x.

If we plot it we obtain

If we try to solve the equation f(x)=0 we get no result back from Maple.

Now consider the function g(x):=x->|sin(x)/x|

If we plot g we obtain

The weird thing here is that the graph isn't touching the x-axis. Why not?

Dear all

I would like to create a table that contains my ouput : iteration, eigenvalues, eigenvectors, 
My code work well, but unfortunatelly I can't display a table with the wanted output. 

cccc.mw

Thank you 

Dear All,

How to draw 3D plot from given data as follows

x:=[0.1, 0.2, 0.3, 0.4, 0.5, 0.1, 0.2, 0.3, 0.4, 0.5,0.1, 0.2, 0.3, 0.4, 0.5,0.1, 0.2, 0.3, 0.4, 0.5,0.1, 0.2, 0.3, 0.4, 0.5]
y:=[0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.3, 0.3, 0.3, 0.3, 0.3, 0.4, 0.4, 0.4, 0.4, 0.4,0.5,0.5,0.5,0.5,0.5]
z:=[1.971284960, 1.642401616, 1.372353338,1.153620572,0.9762759982,
    1.675502483, 1.411976881, 1.190627373,1.007730234,0.8570007139, 
    1.397140245, 1.184230644, 1.003688984,0.852696223,0.7268039317,
    1.144791107, 0.9725020383,0.8257592921,0.7020549659,0.5979974836,                                                                                 0.9208492326, 0.7816302394, 0.6627749172,0.5620029444,0.4766238930]
 

Like:

Product Name: Maple 17

 

5 6 7 8 9 10 11 Last Page 7 of 1962