User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » Easy (?) maple question Page [1]  
LimpyNuts
All American
16859 Posts
user info
edit post

So I have an expression (expr) to which I find the roots. I want to plot the roots as a function of the parameters in the expression. Here's what I do:


l:=solve(expr,x);
f[1]:=(d,e,f)->subs([a=d,b=e,c=f],l[1]);
f[2]:=(d,e,f)->subs([a=d,b=e,c=f],l[2]);
with(plots):
plot3d(f[1](1,x,y),x=0..2,y=0..2);


This is total crap as it takes like 2 minutes and about 200 MB of RAM to generate the plot. How can I create a function from the output of solve() without using subs()? I need to perform this for a variety of 'expr' expressions, whose roots are very complicated. I do not want to retype the output from solve() into the function definitions each time I change 'expr'.

P.S. No, "f[1]:=(a,b,c)->l[1];" does not work. It appears the type of l[1] does not agree with what the function assignment expects as input, or it's using a reference to the l[1] object instead of its value.

9/13/2007 5:32:37 PM

virga
All American
2019 Posts
user info
edit post

I suspect it would be easier to do this in matlab with some hearty loops?

9/17/2007 11:13:15 PM

FykalJpn
All American
17209 Posts
user info
edit post

you can't do it discretely?

9/17/2007 11:20:59 PM

LimpyNuts
All American
16859 Posts
user info
edit post

^^ matlab can not provide the algebraic solution acquired in the first line

^if you're talking about n iterative numerical solution, that defeats the purpose of using a math package to solve the problem.

9/18/2007 12:55:09 PM

virga
All American
2019 Posts
user info
edit post

surprising...numerical solvers are typically more robust than the symbolic ones in maple. you're trying to solve f(x)=0, where f is implicitly dependent on some parameter?

9/18/2007 10:02:17 PM

 Message Boards » Study Hall » Easy (?) maple question Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.