Items tagged with example example Tagged Items Feed

Hi all,

Assume that we have a vector, namely v:=[1,-2,3,-4] and we want to construct special matrix namely Z, from Vector v as follow:

first row is 1, secnond row is -2,..., the end row is -4 namely
Matrix([[1,1,1,1],[-2,-2,-2,-2],[3,3,3,3],[-4,-4,-4,-4]]);

in the other word every row of matrix is 4 times corresponding componet in vector.(for example v is (1*4))

how can we do this?

best wishes

Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

Hi all.  I have researched into this problem.  But I could not find a solution to this.

Here is an example.

I have a set of independent variables, say there are 5 of them.  They are 1. Gender 2. Age group 3. Full or part time 4. First language.

I have a set of dependent variables.  Let us consider for an example 6 of them.  They are (i) Develops breast cancer (ii) Develops skin cancer (iii) Develops lung cancer (iv) develops prostate cancer (v) Lives till 50 (vi) Lives till 60 ...

How do I perform the following prediction:

(A) If a person is male and above 50, what are the chances that he is likely to develop prostate cancer?

(B) If a person is female and works part time, what are the chances that she is likely to develop breast cancer and lives till 60?

I need to develop a code and formula to do this?  Can someone please advise?

Many thanks.

Kind regards,

Kris

I am trying to find a way to take the rows of a matrix and put them in a sequence.  For example if i have the matrix 

M:=Matrix(3,[[1,1,1],[2,2,2],[3,3,3]]);

I want to rewrite it as S:= {111222333}.  

Sorry if this is not clear.  I know how to create a sequence, but I want to be able to use the Matrix and output a sequence without manually inputing the numbers.  

Thank you in advance for your help.  

Following @acer 's challenge to create some more examples for the Rosetta Code project, I've put together some code that constructs Stem-And-Leaf plots here.

I've also attached a new mathapp ( StemAndLeafDisplay.mw ) that contains the code as well as an interactive example for Stem-Plots. This MathApp is also viewable online at the following mobius project page.

This older post may also be of interest for anyone looking to make a stem and leaf plot with decimals.

Here's an example compound inequality I'm working on.

Working it out manually.... 

Compound Inequality
4477.25 <= 4477.25+.25*(t-32450) <= 16042.25;

Distribute the coefficient
4477.25 <= 4477.25+.25*t - 8112.50 <= 16042.25;

Combine like terms
4477.25 <= -3635.25+.25*t <= 16042.25;

Add 3635.25 to all sides
8112.50 <= .25*t <= 19677.50;

Divide all sides by .25
32450 <= t <= 78710;

 

How can I ask Maple to simplify this compound inequality? Obviously this is not the correct syntax, It seems Maple doesn't understand what I want it to do.

4477.25 <= 4477.25 + .25 * (t-32450) <= 16042.25;

                       0.00 <= 0.25 t - 8112.50 and 0.25 t <= 19677.50                (112)

 

Also is there a way to ask Maple to only perform one step? In the above example, is it possible to ask Maple to "Distribute the .25", then show the result, next ask it to combine like terms, etc?

how gr operators work?

I tried to run example given there but it is not working,

where can I get more examples to understand working of Gr operators work?

specially for raychaudhuri equations.

Given the lagrangian from the pendulum physics example on the help page,

or text format.

L := -sin(omega*t-phi(t))*(diff(phi(t), t))*a*l*m*omega+(1/2)*(diff(phi(t), t))^2*l^2*m+cos(phi(t))*g*l*m

 

 

 

In Maple 18, the Database package has been updated to include support for SQlite databases as well as a new option for plots to change the background images on plots.  To showcase both of these features, our engineering team put together an example that optimizes the flight path of a pan-US delivery drone.

This application extracts the latitude and longitude of those zip codes from an SQLlite database (the application includes the database, which cross-references US zip codes against their latitude, longitude, city and state). The application then performs a traveling salesman optimization and plots the shortest path on a map of the US.

To download the application click here: PanUSDeliveryDro.zip

I have two equations that are valid under the substitution sin <-> cos, so a simple way to generate the second equation is to replace all occurrences of sin with cos. But Maple gets the wrong answer when I do this, because of its built-in simplification. Here is an example. Z1 and Y1 shows the problem; Z2 and Y2 shows that my attempt to overcome the problem doesn't work.  Z3 doesn't work either, proving that the problem is internally generated by Maple because Maple insists on ordering variables in its own way, no matter how I write them.

________simplified example from Maple 15

restart;
Z1:=sin(-a*x+b);
Z2:='sin(-a*x+b)';
Z3:=sin(b-a*x);



                         -sin(a x - b)
                         sin(-a x + b)
                         -sin(a x - b)
Y1:=subs(sin=cos,Z1);
Y2:=subs(sin=cos,Z2);


                         -cos(a x - b)
                         -cos(a x - b)
 correct answer should be cos(-a*x+b) but the calculated results are off by a minus sign.

Ans1:=evalf(subs(a=1,b=2,x=3,[Y1,Y2,cos(-a*x+b)]));
          [-0.5403023059, -0.5403023059, 0.5403023059]

Question: How do I override Maple's desire to stick the "-" sign outside the sin function?

по_альтернативной_ок.mw

Hi!

i have problems with surfdata command. I want to see beautifull surface, but see only few black lines.

and i dont know why, because i do all like in example.

 

Thank you vwry much for answers)

Dear Mapleprimes members,

I am trying to understand some known classical theorems of geometry (thales intersection thm, ceva, menelaus ) from the perspective of affine geometry and projective geometry.(my paper/pencil work is ok.. But I would like to use  Maple to visualize -if possible - geometrically some theorems and properties in a graph)

How could I do it in maple? Where may I get some examples?

thank you,

 

JeanJ

Find a loop do define these matrices, even for large values of n. Record the Matrix Mn 

 

all i,j=1,2,13,..,n for example 

N := `<|>`(`<,>`(1, 2), `<,>`(2, 2))

P := `<|>`(`<,>`(1, 2, 3), `<,>`(2, 2, 3), `<,>`(3, 3, 3))

Q := `<|>`(`<,>`(1, 2, 3, 4), `<,>`(2, 2, 3, 4), `<,>`(3, 3, 3, 4), `<,>`(4, 4, 4, 4))

 

Please help!!!

I have been trying to figure out how to use the flexible beam properly. I'm looking for a clear example on how to actually use this component. I have had no luck so far. I must be be missing something. 

 

The current example, http://www.mapleprimes.com/questions/94996-Flexible-Robot-Arm, does not really show much. 

 

Does someone have a simple example? Perhaps using the Flexible Beam as a cantilever, with one end fixed...

 

An intersection in my neighbourhood, currently controlled by a 2-way stop, is under consideration to become a 4-way stop.  This means the traffic that currently has the right-of-way will be required to come to a complete stop, wheras previously they could have coasted down the hill, and accelerated up the other side.   Politics aside, I was curious to explore the following question:

Hi, 

When I try the example of a histogram plot from the help system (under Statistics, Histogram), I get an error.

The example (entered in document mode) and error follow below.  Can someone please shed light on this?

with Statistics; with(plots):
N := RandomVariable(Normal(0, 1)):
A := Sample(N, 1000):
P := DensityPlot(Normal(0, 1), color = "Niagara Red"):
Q := Histogram(A, averageshifted = 4, style = polygon, color = "LightSlateGrey"):
1 2 3 4 5 6 7 Last Page 1 of 87