wpd

56 Reputation

2 Badges

17 years, 86 days

MaplePrimes Activity


These are answers submitted by wpd

Thanks for the tips.  I think this will do the trick:

> f := theta -> (a*b)/sqrt(a^2*(sin(theta-Pi/4))^2+b^2*(cos(theta-Pi/4))^2)+c*cos(4*theta);

(1) ...

> subs(a^2*(cos(theta+Pi/4))^2+b^2*(sin(theta+Pi/4))^2=tmp,f(theta));

(2) ...

(I still can't figure out how to get Maple output into this forum... sigh)

Thanks again.

--wpd

 

Oh wow! a Maple FAQ!!! Where can I find it?

Also, thanks for the insight into what the "subs" function does.  I know that, from the fact that the result returned by "solve" is surrounded by braces, that result is a set... a "set" of equasions, apparently.  I can plug that set of equasions (or perhaps a better phrase would be "set of constraints" into the equasion "a", I get the value of "a" as a result.

Cool... not necessarily intuitive (yet), but I see how it hangs together.

Thanks again.

--wpd

 

Beautiful!

I especially like the part where I can use subs(s, eval(f))... that saved me from my next question, which was, "How can I extract the values of 'a' and 'b' from the result returned by "solve" and use them when I plot my curve?". I have to say that the Maple community is very knowledgable and helpful.  Thanks again for the tips and tricks.

But, now that I mention it...

If I wanted to extract just the value of "a" from "s", how would I do that?
If I try s[1], I get "a = 20.300000000", rather than just 20.30000000.

At this point, having anticipated my next real question so accurately, I don't really need to know the answer, but I am in the realm of, "ok, now I'm curious about this".

Thank you again.

--wpd

 

OK, now I'll take a step further up the chain.  I am still having problems figuring out the plotting thing, substituting values into an expression.

restart;

interface(showassumed = 0);

f := x -> (a*b)/sqrt((a*cos(x))^2 + (b*sin(x))^2)

assume (a > 0, b > 0)

eq1 := 14.88 = f(0)              (1)

eq2 := 20.3 = f(pi/2)            (2)

plot(subs([a=14, b=20], eval(f)), 0..2*pi, coords = polar)

 

When I do this, I get

warning, unable to evaluate the function to numeric values in the region...

I have figured out enough to learn that the source of this message is somehow related to the "assume" command I issued previously.

But, I issued the "assume" command so that eq1 and eq2 would look nicer in my document.  As it stands now, with the "assume" command, I get:

14.88 = a    (1)

20.3 = b     (2)

without the "assume", I get

14.88 = a*b/sqrt(b^2)    (1)

20.3 = a*b/sqrt(a^2)

but I get the nice, very slightly elliptical plot I was hoping to get.

(FWIW, there are other terms in my original equasion which I am not showing here.  I'm pretty sure I could solve these particular equasions myself without the assistance of Maple :-))

I'm not sure how to get the best of both worlds -- less confusing results for (1) and (2), and a plot at the end.

I greatly appreciate any help and tips anybody can provide to a total novice.

Thank you.

 

--wpd


 

Ugghh!! I wonder how that happened?  Let's try again...

 

I apologize if this seems quite basic, but that's the point where I am in learning about Maple. I would like to define a function, take its derivative, plot it, divide it by its derivative, plot that result, etc...


For example: f(x) = a*x^2 + b*x + c
 

From what I've learned so far, I think I do this to define the function:


f := x -> a*x^2+b*x+c


I also seem to have learned that:


diff(f, x)


doesn't do what I want, but


diff(f(x),x)


does.  Now I'm at the point where I would like to plot my function, using some sort of nominal values for a, b, and c.  I think I can do something like:


a:=123
b:=456
c:=789
plot(f(x),x=0..1000)


but now a, b, and c are defined in my workspace so that


diff(f(x),x)


gives me


246x + 456


instead of the


2ax + b


that I got previously. Is there some way to "fix" the constants of an equasion when plotting them without having them be set for the rest of my document?


I'm sorry if this sounds confusing, it's only because I'm confused.:-)


Thanks.


--wpd
 

Page 1 of 1