MaplePrimes Questions

Search Questions:

Dear Maple users

I wanted to export two long lists X and Y of data into two columns in Excel by using the Export command from the ExcelTools package. Data was however exported into rows! I converted the lists into vectors and I succeeded in doing it the way I wanted:

with(ExcelTools);
X1 := convert(X, Vector);
Y1 := convert(Y, Vector);
Export(X1, "data1.xlsx", 1, "A1");
Export(Y1, "data1.xlsx", 1, "B1");

But is it really necessary to convert to vectors in order to accomplish this task? 

Regards,

Erik


 

 

This is a problem that intrigues me.

I have been thinking about the distribution of n points, p[1], p[2], ..., p[n] in a scatterplot and I am interested in finding the location of a focal point, A, such that the distance from A to each neighboring point is a minimum. I have worked on a routine and this is given in the attached worksheet. In this example, n=20 and the position of A is determined to be [-3.25, 0.99].

Now - here's my question. Suppose I am interested in n-large and, instead of locating one focal point, A, I wish to obtain several,i.e. A, B, C, etc. such that the distances from each of these to their respective neighboring points is also a minimum.

Does any interested party know if this is possible to do and if so, can anyone suggest an approach or routine? If so, I'd be delighted to understand how to solve for this.

Thank you for reading!

Mapleprimes_Aug_17.mw

 

 

The commands

with(LinearAlgebra):interface(rtablesize=50);Matrix([[1,1],[4,5]]);

give the output


50
Matrix(2, 2, {(1, 1) = 1, (1, 2) = 1, (2, 1) = 4, (2, 2) = 5}, datatype = anything, storage = rectangular, order = Fortran_order, shape = [])

 

Why won't it display properly?

 

To help decide the type of ODE, I need a function which moves all derivatives to lhs and everything else to the rhs of the ODE. This way I can more easily analyze the ODE.

The ode will be only first order. Any term which contains  (y')^n, is to be moved to the lhs. Rest to rhs. Couple of examples will help illustrate the problem. This is done in code only, without looking at the screen. The dependent variable is always y and the independent variable is x.  So I need to turn the ODE to the form 

                    G(y',y'^2,y'^3,.....,y'^n)  = F(x,y)

I can find all derivatives in the ODE using

indets['flat'](ode,{`^`('identical'(diff(y(x),x)),'algebraic'),'identical'(diff(y(x),x))})

But not sure how this will help me do what I want. isolate does not help, since it only takes one term at a time. Collect also did not help for same reason.  If the ODE contains only ONE derivative, then it is easy to do. But the question is about how to do it for ODE which contains more than y' term of different powers as the examples below show.

What methods to do this in Maple? I looked at DEtools but so far did not see anything.

Example 1

 

restart;
ode:=3*diff(y(x),x)^2+diff(y(x),x)^3+sin(x)+y(x)=x*y(x)+x*diff(y(x),x);

3*(diff(y(x), x))^2+(diff(y(x), x))^3+sin(x)+y(x) = x*y(x)+x*(diff(y(x), x))

indets['flat'](ode,{`^`('identical'(diff(y(x),x)),'algebraic'),'identical'(diff(y(x),x))})

{(diff(y(x), x))^2, (diff(y(x), x))^3, diff(y(x), x)}

ode_wanted:= 3*diff(y(x),x)^2+diff(y(x),x)^3-x*diff(y(x),x)=-sin(x)-y(x)+x*y(x)

3*(diff(y(x), x))^2+(diff(y(x), x))^3-x*(diff(y(x), x)) = -sin(x)-y(x)+x*y(x)

Example 2

 

restart;
ode:=3*diff(y(x),x)^2+diff(y(x),x)=x*diff(y(x),x)+5;

3*(diff(y(x), x))^2+diff(y(x), x) = x*(diff(y(x), x))+5

indets['flat'](ode,{`^`('identical'(diff(y(x),x)),'algebraic'),'identical'(diff(y(x),x))})

{(diff(y(x), x))^2, diff(y(x), x)}

ode_wanted:= 3*diff(y(x),x)^2+diff(y(x),x)-x*diff(y(x),x)=5

3*(diff(y(x), x))^2+diff(y(x), x)-x*(diff(y(x), x)) = 5

 

 

Download lhs_rhs.mw

 

i want to solve the systems of diff equation what's the problem   0.mw

Dear Maple users

Some students have come to us to report, that something doesn't seem to work properly in Maple 2019.1 in Document Mode. And they seem to be right: writing an passive math formula by using Shift+F5 (the formula is gray, not blue), then using F5 to get out of that Math field and back into Text Mode. Using the Enter key to go to the next line: It doesn't work! The cursor stays in the same line. This behavior is new in Maple 2019. It worked properly in Maple 2018 and earlier. I assume it is not the intention? 

I know it can easily be dealt with by making a new Paragraph by using the shortcut Ctrl+Shift+J. I call the assumed bug 'severe' though, because it will severely delay the workflow for many students. They are used to deliver a document mixed with formulas (active or passive) and text. 

NB! I have tested it on several computers (Mac and Windows), and it doesn't work on any of them.

Regards,

Erik V.

Hi I have the following ln function that I want to differentiate wrt variable c:

 

I2 := -sqrt(-c^2+1)*ln(abs((.9*sqrt(-c^2+1)-c*sqrt(1-.9^2))/(-.9*sqrt(-c^2+1)-c*sqrt(1-.9^2))))

 

When I differentiate I obtain an expression that involves 

...abs(1, (.9*sqrt(-c^2+1)-.4358898944*c)/(-.9*sqrt(-c^2+1)-.4358898944*c))...

Why does it give a comma at the abs expression? how to get rid of that.

i have a question about sets. how can i keep set members in order of addition not the defualt maple ordering.
in maple help, i saw the command setsort=0..8 but i do not know how to use it.
consider exmaple below:


 

restart

L:={}:

for j in [3,5,6,1] do
birth:=j:
L:=`union`(L ,{j});
od;

3

 

{3}

 

5

 

{3, 5}

 

6

 

{3, 5, 6}

 

1

 

{1, 3, 5, 6}

(1)

 


how can i keep L as order of addition? L={3,5,6,1}. thanks in advance

Download setoder.mw

Hi I am using Maple 18 and am trying to make my looping work backward.

 

with(Student[Calculus1]);
with(linalg);
with(orthopoly);
Digits := 20;
n, K := 5, 4;
for k from 0 to n do a[k] := (int((T(2, t)-T(0, t))*T(k, t)/sqrt(-t^2+1), t = -1 .. 1))/Pi end do

First I use the above command to generate a0, a1, a2, a3, a4 and a5. Now i want to do a back substitute using the following recurrence relation to determine the values of b5, b4, b3, b2, b1 and b0.

b[n] := 0; (to find b5)

b[n-1] := a[n]; (to find b4)

(to find b3, b2, b1, b0)

Can someone assist me with the backward looping please. I does not seem to work.

 

 

I calculate volume of tetrahedron SABC by this way. Now, I want to find one option  of coordinates of all vertices of this tetrahedron. How can I get the coordinates of the points S, A, B, C so that coordinates  center of circumcircle of the triangle ABC is (0,0,0)?

 

restart:
SA := 3: 
SB := 5: 
SC := 7:
AB := 3:
BC := 4: 
AC := 5:
V := (1/12)*sqrt(SA^2*BC^2*(AB^2+AC^2-BC^2-SA^2+SB^2+SC^2)+SB^2*AC^2*(AB^2-AC^2+BC^2+SA^2-SB^2+SC^2)+SC^2*AB^2*(-AB^2+AC^2+BC^2+SA^2+SB^2-SC^2)-SA^2*AB^2*SB^2-SB^2*BC^2*SC^2-SA^2*AC^2*SC^2-AB^2*BC^2*AC^2);

From here https://www.mapleprimes.com/questions/227573-How-To-Get-Coordinates-Of-Triangle-ABC
I find coordinates of the point A, B, C. Now I tried
 

with(geom3d):
point(A, -3/2, -2, 0):
point(B, 3/2, -2, 0):
point(C, -3/2, 2, 0):
point(S, x, y, z):
solve([distance(S, A) = 3, distance(S, B) = 5, distance(S, C) = 7], [x, y, z], explicit);
with(geom3d):
point(A, -3/2, -2, 0):
point(B, 3/2, -2, 0):
point(C, -3/2, 2, 0):
point(S, x, y, z):
solve([distance(S, A) = 5, distance(S, B) = 3, distance(S, C) = 7], [x, y, z], explicit);

Use the above code, I obtain the result.

Lang_2_output_as_tswitch_varies.mw

^ in this worksheet I have made a graph of a variable in a simple ODE against time (shown below), at t=150 a switch condition, in the worksheet called tswitch, changes the rates of change of the ODE.

I am thinking about afunction that maps tswitch->solution of the ODE and would like to visualise it as a 3d surface, but couldn't work it out in Maple

 

Hello everyone,

I have a function of 5 variables, A, P, N, k. I want to solve and express as a power series of 'k'

w=F*k+G+H/k+...

and gather the coefficients of each power.

However, the result I obtain in my code differs from the analytical value I found. What am I doing wrong?

Thanks!

collect_mp.mw

Does Maple allow importing HDF5 data files? I checked the docs & cannot find any hint that it does. But before I launch an SCR I thought I'd ask here.

TIA,

M.D.

I've recently changed to maple 2019, from the 2016 version as my license for that product had expired. 
However I find it really frustrating that often upon evaluating an expression I can't convert the units. 

For instance I had a calculation that evaluated to: 

2.114163508*10^7 [kg/s^2]
 

When I try to directly replace the units within maple to instead be [J/m^2] I recieve the following error message: 


"Error, (in  Units:-TestDimensions) 'op(3, i) does not  evaluate to module" 

There is no explanation for this error when I try to look it up. However if I once again manually write the answer: 
2.114163508*10^7 [kg/s^2] and use the replace units function. 
No problem. 
I find this quite annoying and frustrating and I hope you can help.
 

Best regards 

Anders Alexander Wagenblast 

Hello all

I am going to find the diffusion constant in the following equation :

PDE:=diff(C(x,t),t)=d*diff(C(x,t),x,x);

In a way that ,

evalf(Int(C(x,t=specific),x=0..L))/L - m_number(t=specific)=0
 

In other words, It would be an iterative procedure to guess "d" and then find the solution C (something like shooting method). The objective is to find "d" in a way that the average of C (solution of PDE) would be equal to m_number at that specific time.

Also, Since I have 5 specific time and m_number, I will have 5 different d. So, I need to use least square method or other optimization technique find one finalized d value.

I have uploaded my code.

inverse_numerical_diffusion.mw

I am not good at using Proc command and  I think the error of my code is because of that.

Would you help me to find out my problem in the code and any new idea for solviong this equaltion would be greatly appreciated.

Thank you for your kind attentions in advance

Amir

 

 

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