ale786

20 Reputation

One Badge

6 years, 108 days

MaplePrimes Activity


These are questions asked by ale786

Good morning, I'm trying to solve this very simple problem : plot a graph starting from the origin. The problem is that the x_axis is located at the lower value of my function, but i want it to go through the point (0,0). Let's see this example:

plot(piecewise( x<5, 100, x>5,200), x=0..10); As you can se the X-axis passes through y=100.

Now with this option I obtain:

plot(piecewise( x<5, 100, x>5,200), x=0..10, y=0..200); 

The problem is taht I need to specify the upper bound of the range for each function (200). Is there an automatic way? Any help is appreciated.


 

Is this a correct way to define a piecewise function in which substitution occurs, or are there better ones?

Data := [L=1000, F=1000, E=206000, d0=10];

Diameters := X -> eval(subs(Data, piecewise(x<L/2, d0 ,x<2/3*L, 2*d0 ,x>2/3*L, 1.5*d0)), x=X); 
 

I need to evaluate a variable inside the function definition in the moment it is defined and not every time it is called. Is there a way around?

a:=3;
f := x-> a*x;
f(t);

a:=4;
f(t);

I want the function "f" to be 3*x even if "a" is modified after the declaration. In Mathematica I am used to the so called immediate assignmet(=) and delayed assignment(:=) for which I cannot find an equivalent command in Maple. 

Any help is appreciated!

I want the output from a line to be used for the definition of a function, but it doesn't work. What am I missing?

x^2;
f := X -> eval(%, x=X);
f(t);

Thank you, Ale

Page 1 of 1