Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

soslve('(cosh(C + cosh(C))/cosh(C) = 2') gives me a "Waning, solutions may have ben lost" message and no answer.

Write a procedure which inverts a given 2x2 matrix ie
Given a list of 4 numbers (a,b,c,d) return numbers (x,yz,w) such that
Matrix(a,b,c,d)(Matrix(x,y,z,w)) =Identity matrix

Trying to write a procedure to just reduce the vales of x.. 

restart: 

proc_r:= proc(x :: numeric) 

local x0:

x := x0: 

 

#reducing the value to between -Pi and Pi

 

do 

 if ( x0 <= evalf(Pi) ) then 

  break: 

 end if: 

 

 x0 := x0 - 2*evalf(Pi)

end do: 

 

do 

 if (x0 >= evalf(-Pi) ) then

  break: 

 end if:

 

 x0 := x0 + 2*evalf(Pi)

end do: 

 

#using the symmetry of sin to reduce to between -Pi/2 and Pi/2 

 

 if (x0 <= evalf(Pi/2) ) then  

 break:

end if: 

x0 := evalf(Pi) - x0:

 

if (x0 >= evalf(-Pi/2) ) then 

 break:

end if: 

x0 := evalf(-Pi) - x0:

 

return x0:

 

end proc:

 

proc_r(7);  

 

Error, (in proc_r) illegal use of a formal parameter

 

Why do i get this error message... 
How do i fix it? 

Hi there!

I wrote a piece of code which spits out the numerical datapoints (x,y(x)) corresponding to a function y(x). So that the result is accurate, I need quite a lot of data points - currently I am working with 5k.

In order to work with this function later, I interpolated it with a Spline. For instance, I would like to sample the function values on a fifferent grid, etc.. However the evaluation of this function really takes up hell of a lot of time, and the reason seems to be, that it, being a spline on 5k nodes, is simply a huge expression.

Is there a better way to do this? Are other fitting functions than a spline maybe better suited?

Thanks for help!

 

I have defined the following procedure, S(x,a,b,s), in Maple with the goal of creating an exportable two column, multi-row array, containing the least positive real root of a high order polynomial f(x,y)=0 in the 2nd column, and a parameter y in the first column.

The procedure takes four numerical arguments (x,a,b,s) and varies parameter y from the initial non-negative value of a, by stepsize s, until the value min(b,1) is reached.

Unfortunately, the output 4x2 array only has the last calculated [y,solution] entries in the first row. Successive rows are filled with zeros.

Is there anyone kind enough to point out the error in the way I have defined this procedure? Many thanks in advance. Procedure is:

S := proc (x, a, b, s
   global Ry;
   for y from a by s to b while y < 1
     do R := Array(1 .. ceil((min(b, 1)-a)/s), 1 .. 2, [[y, FindMinimalElement(select(type, [fsolve(f(x) = 0)], positive))]])
     end do;
     end proc;

I have a nested list a := [[1,2,3],[4,5,6],[7,8,9]]: and would like to apply a function f to the 1st elements in nested list, e.g. [[f(1),2,3],[f(4),5,6],[f(7),8,9]]. How can I achieve this?

Thanks in advance.

Congratulations to Andriy Andrusyk, from the Institute for Condensed Matter Physics of the National Academy of Sciences of Ukraine, who won last quarter’s Möbius Challenge with his application Heat Equation.  Dr. Andrusyk won a DSLR Camera Prize Pack.

Remember that you have until Mar. 31 to enter your Möbius Apps for a chance to win the next prize, an Xbox One!   Visit Möbius App Challenge for full contest details.

 

eithne

what is the difference between endomorphism and identity map?

http://mathfaculty.fullerton.edu/mathews//n2003/hornermod.html

i find a program above, 

if no general method, how about specific to convert it

if have general method, how is it?

I have defined a function by doing

 

f:= (x1,x2,x3) -> sum( [complicated expression], [summation ranges]),

 

which Maple converts to an explicit polynomial in x1,x2,x3.

 

However, it seems Maple does not quite think of f as this polynomial, but always remembers the original definition of f. How should I do in order for Maple to really define f to be this explicit polynomial?

 

 

I'm trying to animate transparency, here's are the plots:

A :=tranz-> plot3d(-2/sqrt(x^2+y^2)+5/sqrt((x-1.6)^2+y^2), x = -5 .. 5, y = -5 .. 5, view = [-5 .. 5, -5 .. 5, -5 .. 5], transparency = tranz) end proc;
B := sphere([0, 0, 0], 2*(1/10), color = magenta, style = patchnogrid):
C := sphere([1.6, 0, 0], 5*(1/10), color = green, style = patchnogrid);
E := plot3d(0, x = -5 .. 5, y = -5 .. 5, view = [-5 .. 5, -5 .. 5, -5 .. 5], style = wireframe, shading = zgrayscale):

here I am displaying them without a problem:

display(A(.5), B, C, E, scaling = constrained, view = [-5 .. 5, -5 .. 5, -5 .. 5], axes = normal)

here I am trying to animate the transparency in plot A to no avail :( :

animate(display, [A(tranz), B, C, E, scaling = constrained, view = [-5 .. 5, -5 .. 5, -5 .. 5], axes = normal], tranz = 0.1 .. 0.9)
Error, (in plot3d) expecting option transparency to be of type {"default", realcons} but received tranz

if you guys could help me find where I'm going wrong I'd be super grateful :D

thanks everyone.

Best,

-Mike

I have an equation with the following structure:

sin(a)-sin(b)=0;

Maple can solve this:

solve(%,[b]);

[[b=a]]

so it misses the 2nd solution (b=π-a). I can use the allsolutions qualifier:

solve(%,[b],allsolutions);

and now Maple returns an expression that, while correct, is really not conducive to further work without fairly massive substition work (_Z10 has to be 0 and the solutions wanted have _B10 0 and 1). In a classroom settng this is not helpful. Try as I might using the options to solve I have not found a way to make this into a list of the two solution I want without extensively mucking around with the expression. Is there any way to coerce solve to return something simpler?

I really want something like

[b=a,b=π-a]

TIA,

Mac Dude.

 

Data.xlsx

XY.mw

XYZ.mw

 

Hello,

I'm using the Global Optimization Toolbox to solve some examples and fit equations to a given data, finding "unknown" parameters. I generated the data on Excel, and I already know the values of these parameters.

The XY case is (there is no problem here, I just put as a example I follow):

> with(GlobalOptimization);
> with(plots);

> X := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "I5:I25");
> Y := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "J5:J25");

> XY := zip( (X, Y) -> [X, Y] , X, Y);
> fig1 := plot(XY, style = point, view = [.9 .. 3.1, 6 .. 40]);


> Model := A+B*x+C*x^2+D*cos(x)+E*exp(x):
> VarInterv := [A = 0 .. 10, B = 0 .. 10, C = -10 .. 10, D = 0 .. 10, E = 0 .. 10];

> ModelSubs := proc (x, val)

    subs({x = val}, Model)

    end proc;


> SqEr := expand(add((ModelSubs(x, X(i))-Y(i))^2, i = 1 .. 21));
> CoefList := GlobalSolve(SqEr, op(VarInterv), timelimit = 5000);

> Model := subs(CoefList[2], Model):

 

I could find the right values of A, B, C, D and E. 

 

My problem is in the XYZ case, where I don't know how to "write" the right instruction. My last attempt was:

> with(GlobalOptimization);
> with(plots);

> X := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "Q5:Q25"); X2 := convert(X, list);
> Y := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "R5:R25"); Y2 := convert(Y, list);
> Z := ExcelTools:-Import("F:\\Data.xlsx", "Plan1", "S5:S25"); Z2 := convert(Z, list);
> NElem := numelems(X);

> pointplot3d(X2, Y2, Z2, axes = normal, labels = ["X", "Y", "Z"], symbol = box, color = red);

 

> Model := A*x+B*y+C*sin(x*y)+D*exp(x/y);

> VarInterv := [A = 0 .. 10, B = 0 .. 10, C = 0 .. 10, D = 0 .. 10];

> ModelSubs:=proc({x,y},val)

subs({(x,y)=val},Model)

end proc:
Error, missing default value for option(s)

> SqEr := expand(add((ModelSubs(x, y, X(i), Y(i))-Z(i))^2, i = 1 .. NElem));
> CoefList := GlobalSolve(SqEr, op(Range), timelimit = 5000);
Error, (in GlobalOptimization:-GlobalSolve) finite bounds must be provided for all variables

 

My actual problem involves six equations, six parameters and four or five independent variables on each equation, but I alread developed a way to solve two or more equations simultaneously.

Thanks

Hi guys! Maple noob here.

I want to get an array of the sums of each and every row of a matrix which I imported from Excel. I can't manage to work my way around with LinearAlgebra-Add, Sum and eval. Maple always shows me the table and not the scalar I am looking for.

I'd also like to know how to tell Maple how to do something on a certain interval of cells of the matrix.

I hope I have been clear and you can help me out :D

Cheers from Italy!


This post is an index page for reading the Parallel Programming blog posts.

First 1374 1375 1376 1377 1378 1379 1380 Last Page 1376 of 2224