Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi,

 

I'm using Maple versions 9.5 and 14.

 

I have a quite complicated functtion defined by means of a piecewise statement. Translation of that function into C code is required, so I tried to use CodeGeneration[C] and codegen[prep2trans]. The help of Maple version 9.5 tells me that the prep2trans command isneccessary to get the job done. It's about converting the MAPLE piecewise instruction into a  if ... then ... else if ......

Hi, I am new to using maple. For one of my classes we have been asked to find the root of a function using the bisection method. The function I am trying to find the root for is x-2^(-x) for 0<=x<=1. This is the sequence of commands that I am using

 f:= x-> x-2^(-x);

a:=0; b:=1;

 while b-a> 0.00001 do

      m:= (a+b)/2:

      if f(a...

How can I call a procedure value from inside a string?

Hi,

 

I would like to build a piecewise function automatically.

I would like something like this but with 33 pieces:

> piecewise(0<=t and t<1, f[1](t)[i][j], 1<=t and t<2, f[2](t-1)[i][j], 2<=t and t<3, f[3](t-2)[i][j], ...,0);

I tried to use the seq command, and it worked with the condition argument of piecewise.:

> seq(1-q<=t and t<q,q=1..3);
          -t <=...

I get the following error message when trying to use LinearSolve(with inplace option) to solve a linear system of size 2000x2000 with 416 digits.

 

maple: fatal error, lost connection to kernel

 

Any suggestion to the cause of this error or how to avoid it?

Dear All,

I would like to make assumptuions about the input parameters of a procedure. The input parameter of the procedure should be the (1,1) element of a 2-dimensional Matrix. I make the same assumptions for the elements of the Matrix as expected by the procedure. When I  call he procedure with the (1,1) element of the matrix, it gives the following error. How should I use the assumptions or how to pass correctly the parameter to the procedure in this particular case?

Hi,

I want to plot a function with a restricted domain, specifically f(x) = |x| if -Pi <= x < Pi.

I want to first define the function, then use it in the plot command.

I know to define the function f(x) = |x|, I do

f := x -> |x|

...but how do I tell Maple to include the domain, -Pi <= x < Pi?

Thank you.

Hi,

 

I would like to differentiate a sinlge-variable function containing abs(), min(), and max() calls. For smaller functions it seems to work, however for my procedure, it does not seem to work. What can be the problem? I would appreciate any comment. 

 

It seems to work for the followings:

> diff(min(5*x,3),x);
                     /        ...

Hi

The example below is the same as my code:

restart:with(Optimization):f:=(a+2*b+c*d)*sin(wr*p*t);

fmoy := p*wr*(int(f, t = 0 .. Pi/p/wr))/Pi;

fmax:=NLPSolve(f,t = 0 .. 2,a=1..5,b=0.1..0.5,c=0.4..0.8,d=10..20,wr=200..300,p=5..20,maximize);

fmin:=NLPSolve(f,t = 0 .. 2,a=1..5,b=0.1..0.5,c=0.4..0.8,d=10..20,wr=200..300,p=5..20);

Taux:=NLPSolve((fmax-fmin)/fmoy,t = 0 .. 2,a=1..5,b=0.1..0.5,c=0.4..0.8,d=10..20,wr=200..300,p=5..20);

In MapleSim, I need a half-sin signal source element.

Of couse, I yielded a half-sin puls by using the combination of 2 sine souce elements and add element.

But i think it is not the best way. I want to use custom element in Maple to create it,

but I don't know how to write the equation code in Maple.

Please help me.

thinks

In examining ODE models containing parameters I don't like to assign values to these, but use the form

param:={a=2, b=7};
and then
eval(expression, param);

This works well. There are situations, however, where this method can be cumbersome.
This would be the case in a situation like this:

plot(a*sin(x),x=0..b);

You could do

plot(op(eval([a*sin(x),x=0..b],param)));

But maybe an operator having a syntax similar to 'assuming' could be useful.

The first line below is my code for computing the angle between vectors U and v.

It works and gives correct answers.  But it appears on the screen with this  "Typesetting: delay"  for each of the dot products.

What does it mean?  Is there a package I should have loaded?

This is for a lab where I want students to use the formula as it appears in the textbook rather than using some built in function that makes it "too easy."

As shown in the image bellow. The first statement of fsolve function yields nothing but evaluating the expression. I copied the expression into the second command line and got the result. How can I make the first one works, since it belongs to a proc in my program. 

This is another elementary question (I tried searching MaplePrimes but couldn't find anything):

Suppose I'd like to use "solve" to solve a system of equations specified as vectors:

z := <yb,x1b,x2b>:
v1 := <v1y,v1x1,v1x2>:
v2 := <v2y,v2x1,v2x2>:
e1 := z = v1 + v2;
e2 := v1 <= UU*delta1;
e3 := v2 <= UU*delta2;

Invoking "solve([e1,e2,e3],[z,v1,v2])" does not work. 

How do I convert each element...

Hi

I have some difficulties in manipulating matrices in Maple

For example, I have a matrice with 40 rows and 9 columns ans I want to extract the odd rows taking columns inchanged. The new matrice which has 20 rows and 9 columns must replace the old matrice

In Matlab, I do this with only one command: WTable=WTable(1:2:40,:);

Thanks in advance for help

First 1776 1777 1778 1779 1780 1781 1782 Last Page 1778 of 2224