Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I have a function:

T(t) := (t+459.47) * 5/9  ,  convert degrees F to Kelvins.

I want to produce a table of values over a range of 100F to 250F with two colums,

Degrees F and Kelvins.

I have no problem doing this in Mathcad Prime, but I'm lost as to how

to accomplish this in Maple.

I am evaluating the Maple trial as a potential replacement for Mathcad Prime,

but at this point it may not work for me.

Hi,

I am trying to verify the general solution to the nonlinear ode

diff(y(x), x, x) = 1/y(x) - x*diff(y(x), x)/y(x)^2  (1)

Maple says this expression is invalid when I try to enter it using the button.  I can copy and paste this expression into maple, however, and it works fine.

 

I take the second derivative of the general solution, then use the solve(solution, diff(y(x),x,x) command to try to put the second derivative in the form of (1).  The result from this command does not match the original ode, but the odetest( ) funtion returns a value of zero. 

 

How do I "manually" verify this solution with maple?  I am investigating a certain type of equation, and my solution technique so far involves rewriting the equation into a different form (nonlinear PDE) and then solving the PDE.  I am building up maple skills to eventually do that.

 

For your reference, this equation is from a maple help page:

 

https://www.maplesoft.com/support/help/maple/view.aspx?path=odeadvisor/exact_nonlinear

 

I would really appreciate some help with this,

Steve :)

Hello everyone !

 

I would like to know if there's a way to get simplified expressions for multivariables expressions...

 

for a simple example :

 

expand((a+b)^2) returns a²+b²+2ab

how could I get (a+b)^2 from a²+b²+2ab ?

 

for a more complicated example :

factor([2*x^3 - 6*x*y*z + 2*y^3 + 2*z^3])

returns :


        [2 (x + y + z) (x²  - x y - x z + y²  - y z + z²)]

but since :

2*(x²  - x y - x z + y²  - y z + z²) = (x - y)^2 + (y - z)^2 + (z - x)^2

 

is there a way to get that kind of simplification ?

 

thank you for your time

 

Hello everybody,

In my code, i would like to create a square matrix M of dimension 'a' (which is a ColumnDimension of an imput matrix A):
Otherwise, i have an expression ('EXPR') on alpha[i](x) and beta[i](x), i=1..b, (where b is a ColumnDimension of an imput matrix B).
The matrix M that i want to get must be M:=(EXPR(alpha[i],beta[j])),i,j=1..a, evaluated for particular alpha[i](x) and beta[j](x) wich are stored in A and B respectively.

Below, is the code that i write: 

Test := proc(A, B,EXPR)
local a, b, M, i, j, k;
a := LinearAlgebra['ColumnDimension'](A);
b := LinearAlgebra['ColumnDimension'](B);
M := Matrix(a);
for i to a do for j to a do
if evalb(i = j) then
M[i, j] := M[i, j] + eval(EXPR, {seq(alpha[k] = (t -> eval(A[k, i], x = t)), k = 1 .. b), seq(beta[k] = (t -> eval(B[j, k], x = t)), k = 1 .. b)}); else
if evalb(i < j) then
M[i, j] := M[i, j] + eval(EXPR, {seq(alpha[k] = (t -> eval(A[k, j], x = t)), k = 1 .. b), seq(beta[k] = (t -> eval(B[i,K], x = t)), k = 1 .. b)}); else
M[i, j] := M[i, j] + eval(EXPR, {seq(alpha[k] = (t -> eval(A[k, j], x = t)), k = 1 .. b), seq(beta[k] = (t -> eval(B[i, k], x = t)), k = 1 .. b)}); end if;
end if;
end do;
end do;
return M;
end proc:

I tested the program for A, B and EXPR given by: 
A := Matrix(2, 3, [[4, x, 1/4*x^2], [2, 3, x]]);
B := Matrix(3, 2, [[3, 5], [x, 2], [1/2*x^2, -x]]);
EXPR := alpha[1](1/2)*beta[1](1/2) + int(alpha[1](x + 1/2)*beta[2](1/2*x), x = -1/2 .. 1/2) + alpha[2](1/2)*beta[2](1/2);

Maple returns the following:  Error, (in anonymous procedure called from Test) bad index into Matrix.
I understood that the problem comes from the k that I wrote in bold in the code.
I would like to evaluate the EXPR for alpha[k]:=A[k, i] and beta[k]:=B[j,k] , but I don't really know how to interpret this for maple.

Could you help me please ?
Do you have an idea ?

Best regards,

I am an electrical engineer and have been using Matlab for years.  I am switching over to Maple and am converting my extensive library of Matlab scripts to Maple.  

Among other things, I plan on using Maple, as I have Matlab, to determine component values based on design criteria (e.g. input voltage range, output voltage range, etc.) and to analyze the resulting circuit uncertainties.

I have generally released the uncertainty results to my clients and like to use the appropriate mathematical symbols to convey the information.  

I would eventually like to generate a report for my client that shows the calculated component values and the resulting uncertainties (e.g. "R1 = 2.56kΩ ± 0.01%", "Total uncalibrated uncertainty (maximum) = ±(0.23452% of reading + 0.198°C)")

I see that outside of a code edit region, I can freely use the symbols from the "common symbols" palette to generate text as shown above.

Should I avoid trying to automate this (i.e. using printf() statements)?

 

I found small problem in Latex(). When putting solution of ODE inside a Vector, Latex() fails to convert and returns empty vector.

restart;
sol:=[dsolve(diff(diff(y(x),x),x)*y(x) = 1,y(x))];
sol:=convert(sol,Vector);

And now

Latex(sol)


               \left[\begin{array}{c} \\ \end{array}\right]

Empty array. But if not in a Vector, it works

restart;
sol:=[dsolve(diff(diff(y(x),x),x)*y(x) = 1,y(x))];
Latex(sol)

# no problem here ====>

\left[
{\textcolor{gray}{\int}}_{}^{y \! \left(x \right)}\frac{1}{\sqrt{2 \ln \! \left(\mathit{\_a} \right)-2 \mathit{\_C1}}}\textcolor{gray}{d}\mathit{\_a} -x -\mathit{\_C2}
 = 0, 
{\textcolor{gray}{\int}}_{}^{y \! \left(x \right)}-\frac{1}{\sqrt{2 \ln \! \left(\mathit{\_a} \right)-2 \mathit{\_C1}}}\textcolor{gray}{d}\mathit{\_a} -x -\mathit{\_C2}
 = 0\right]

 

This seems to happen on some solutions (may be those with Int because in this other example, it works with Vector):

restart;
sol:=[dsolve(diff(diff(y(x),x),x)*y(x)^2 = 0)];
sol:=convert(sol,Vector);

And now

Latex(sol)

#now it works ===>

\left[\begin{array}{c}y \! \left(x \right)=0 \\y \! \left(x \right)=\mathit{\_C1} x +\mathit{\_C2}  \end{array}\right]

I am using Maple 2020.2 with Physics 897

Edit 1/2/2021

I found another strange problem with Latex conversion related to Vector. If the first entry is y(x)=0 in the vector, then it keeps this, but throws away the rest of the entries in the Vector.

This might be related to the same bug. Not sure. Here is an example

restart;
ode:=(2*cot(x)*diff(y(x),x)*y(x)+diff(y(x),x)^2-y(x)^2 = 0,singsol=all);
sol:=convert([dsolve(ode)],Vector)

Now watch what happens when converting sol to Latex

Latex(sol)

    \left[\begin{array}{c}y \! \left(x \right)=0 \\ \\ \end{array}\right]

Only reason I use Vector() is to display in Latex many solutions on top of each others, so easier to see instead of as a list() where they are all on one line, which might not fit the page.

I need to find an alternative to using Vector to do this. 

Can I clear variables by a command instead of assigning them their quoted name?  For example, I know that I can clear M and B by:

M,B:='M','B'.

Is there a command like forget(M,B)?

I don't want all of ther variables cleared so I don't want to use restart.

 

Hi,

I would like to use greek letters and other special symbols in printf() statements in a code edit region.

Is there a way that I can do that? 

 

I have to create a function which records the angle and angular frequency of an aspherical moon orbiting a planet at each periapsis to create a Poincare section plot of theta agaisnt omega. I cannot get eval to work out the solutions to the ODEs to plot the points. Additionally I then have to create another function to plot the FFT of the angular frequency from an array. 

This is what I have tried so far:



Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/Project.mw .
 

Download Project.mw

For some reason every := on my work sheet has turned to "d" how to if fix this.

 

Hi,

I have a vector that I would like to display with added text annotations.  For example with the vector <1,2>, I would like output to the display:

first: 1

second: 2

Is there a simple way to do this?

Hi, Very new to Maple. This is a math assignment, and well I am not exactly sure what is happening. I have had a buddy to help me, but things are not necessarily working.

 

a := 0;
                             a := 0

b := 1;
                             b := 1

p := plot({Fresnelf(x), Fresnelg(x)}, x = a .. b);
plots[display](p);

 

A := [a, g(a)];
B := [a, f(a)];
                         A := [0, g(0)]

                         B := [0, f(0)]

C := [b, g(b)];
D_ := [b, f(b)];
                         C := [1, g(1)]

                        D_ := [1, f(1)]

left_line := plot([A, B]);
right_line := plot([D_, C]);
plots[display](p, left_line, right_line, view = [0 .. b + 0.5, 0 .. 0.2]);
Warning, data could not be converted to float Matrix
Warning, data could not be converted to float Matrix
 

What is the letter O doing inside this pde solution by Maple 2020.2 and what does it mean? There is no O in the PDE itself and it is not a name of a mathematical special function 

restart;
interface(version);
pde :=  diff(w(x,y),x)+ (a*x^2*y+b*y^3)*diff(w(x,y),y) = 0;
sol:=pdsolve(pde,w(x,y));

 

lprint(sol)

w(x,y) = _F1(1/9*(2*2^(2/3)*3^(5/6)*b*x*O*y^2-3*2^(2/3)*3^(1/3)*b*x*GAMMA(1/3,-\
2/3*x^3*a)*GAMMA(2/3)*y^2+9*O*GAMMA(2/3)*exp(2/3*x^3*a))/O/GAMMA(2/3)/y^2)

 

Hi,

I have aproc that takes a supplied electrical resistance and calculates the closest standard resistor value to it.

I would like the proc to work whether the supplies resistance has Units(ohm) or if it is free of units.  I am new to programming in Maple.  I have come up with the following but if there is a better way to do this, it would help me to get up to speed with Maple more quickly.

 























Thanks,

David

Hi,

Just to inform me about the possibility of easily way to build a probability tree with Maple? like this example ( for example)

Thanks

First 335 336 337 338 339 340 341 Last Page 337 of 2097