## How do I create a function with conditionals in it...

Simplest example I can think of. I want to define f(x) to be the absolute value function (yes, of course, without using the built-in Maple absolute value function) f:=x->x; is great for defining a function. I've used that many times to define n-vector-valued functions of m variables. But how do I do f:=x->x if x>0 f:=x->-x if x

## Determining an Equation's Accuracy...

Hi, I have a modeling equation and a set of data points, and I want to compute the accuracy of my equation relative to the data points. Is there anyway to compute the R squared value of my equation relative to these data points? All of the commands I can find in Statistics are used to fit an equation to the data points, which I don't want to do, I just want to have a qualitative measurement of how accurate my equation is.

## What is wrong with my program?...

How is it possible that the following program works correctly: printlevel:=2: for n from 1 to 10 do if (0=0 mod 5) then 0; end if; end do; It correctly outputs ten 0's. But, when I change 0 to n inside the if conditional printlevel:=2: for n from 1 to 10 do if (n=0 mod 5) then 0; end if; end do; I get nothing for output. I should get two 0's. n is 0 mod 5 exactly twice as n runs from 1 through 10. I have experimented with adding spaces and deleting spaces between keywords and parentheses and numerical values to test if that was the problem. Nothing works.

## Float (Undefined)"...

Dear Sir/Madam, I have written a small program to calculation a kind of integration. This integral depends on the values of another function which is given numerically. I want to calculate numerical results of this integral. But the I just have sucu result as "Float (Undefined)" . Please help me to find where is wrong. Thank you very much! Download 7745_Float undefined.mws
View file details

## RootOf problem in 5x5 Matrix of one parameter...

In this Maple 10 classic worksheet I'm trying to get the eigenvalues of the matrix H, which are dependent of the parameter F>=0. Please help me to get rid of those RootOf's. The result may be numeric because I only need it for plotting. Download 5085_20_H.mws
View file details

## Setting value of a matrix...

Hi Guys i have 2 matrices, A and B, a[i,j] and b[i,j] are the elements of the matrices respectively. How can i set the entries of A to equal the entrices of B, so then when i use the command, evalm(A), the previous a[i,j] values will become b[i,j]? Thanks.

## How do I get rid of "unable to match delimiters" e...

for n from 1 to 2 do if(isprime(L[n]) then 7 else 9; end if; end do; No matter combination of semicolons or colons I put at the end of each line or omit, I cannot get this little test routine not to spit back "unable to match delimiters" error message. L := [4, 5]; P1 := [-8, 9]; if (5 > 6) then P1[1] else L[2]; end if; Ironically, this routine worked. I do not see the difference.

## Euler's Method...

The equation y'= ((2-t)(2-y))/y , y(0)=1 How do I use Euler's method to calculate an approximation to y(1) using step size i. h=0.2 ii. h=0.1 iii. 0.05

## How Do I simplify the following equations...

I am new to Maple (I have Maple 11 student version) I tried to simplify atan(tan(x)) and nothing happens Also atan(sin(x)/cos(x)) does not simplify. What is the trick to simplification?

## creating DLL with cygwin...

Dear all: Inside maple, I want to call C program which is compiled using cygwin & gcc. I did a very easy one for testing. int _stdcall add( int num1, int num2 ) { return num1+num2; } and then gcc -o add.c && gcc -shared -o add.dll add.o However, this doesn't work. Maple continue to load the DLL forever...... Does anyone know the reason? I did it with Visual C++ with VC specific options and it works just fine. Thanks, Peter

## differential equation...

the equation y'=1-y(t)^2 how do you construct the de plot and find the equilibrium solutions

## A Solve Command in a Loop...

I want to have a solve command in a loop like this: for j from 0 to 10 do s[j]:=solve( {f[j]=0 , g[j]=0},[ a[j] , b[j] ]); od; where f[j] and g[j] are complex exponential functions of j and a[j]& b[j] e.g in a very simple case: f[j]:=a[j]*exp(I*2*j)+b[j] after such a loop Maple just solve s[0] and for other j's a warning message appears saying: "solutions may have been lost". And amazingly this warning seems very correct for when I put the solve command outside the loop,like solve({f[2]=0,g[2]=0},[a[2],b[2]]); it simply solves it! I don't know how I can overcome this problem?!