20 Reputation

1 years, 343 days

Plot from the origin...

Maple

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.

Piecewise function with substitutions...

Maple

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);

Immediate evaluation and dealyed evaluat...

Maple

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!

Use output for function definition...

Maple

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
﻿