72 Reputation

2 Badges

18 years, 313 days

MaplePrimes Activity

These are answers submitted by Nina

The only way I can think of creating a plot of y=m*x+b without actually telling Maple what m & b are, would be to create an animation defining m & b as interactive parameters within a specified range. with(plots); interactiveparams(plot, [m*x+b, x = 0 .. 10, y = 0 .. 10], m = -5 .. 5, b = -5 .. 5); This way, you can view the plot given different values of m & b. But, ultimately, you have to specify some value for these constants before a plot is displayed. I don't see how else Maple could deal with it. Anyone else have any ideas? I'm pretty curious myself!
Salut Arnaud, Bienvenue a MaplePrimes! Pourriez-vous me donner un peu plus d'information sur le modele que vous essayer de developper? Sans l'information specifique avec laquelle vous voulez decrire votre systeme, je ne pourrais pas t'aider beaucoup, mais je pourrais vous donner de l'aide a developper un modele d'une facon generale. Premierement, vous devrais determiner les equations qui decrivent le phenomene meteorologique que vous voulez modeler. Par exemple, si je voulais modeler (en utilisant une animation) le force d'un ressort, j'entrerais le commande suivante en Maple: Ws := (-1/2)k*x^2; Alors, pour voir comment le force du ressort change avec un changement de la constante ‘k’, la ou ‘x’ represente la displacement du ressort, j’entrerais: plots[animate](plot, [Ws, x=0.5..2, color = blue], k=50..500); ------- Cette exemple est beaucoup plus facile de laquelle vous voulez modeler, mais les principes sont la meme. Donc, pour modeler n'importe quelle systeme: 1. Determiner les equations qui decrivent le systeme que vous voulez modeler 2. Definissez les parametres qui composent les equations 3. S’il est necessaire de faire des calculations aux equations differentielles ordinaires, ou les equations aux derivees partielles, utiliser les commandes ‘dsolve’ ou ‘pdsolve’. Il y a une facon d’evaluer les equations differentielles ordinaries interactivement aussi, en utilisent le ‘ODE Analyzer’. 4. Visualize le systeme en utilisent les graphiques et animations. J’espere que ceci aidera un peu :o) Bonne Chance, et contactez-moi si vous avez besoin de plus de l'aide. Nina Maplesoft
Could you tell me how you are entering the symbol? I have never encountered this problem, but if you could provide a snipet of code in which it is being used, or let me know if you are typing in 'pi' and using command completion, or using the palettes would really help.
Another option could be to simply create a procedure that linearly interpolates data from matrices. This is a simpler method that may not be as accurate as a curve-fitting solution, but it is commonly used, and usually sufficient for most applications. Here's a sample of some code we've been kicking around. There is no error trapping, and there is probably room for improvement, but it should still provide you with enough information to run with it if you choose to. __________________________ linterp(x1,y1,x2,y2,xval); where (x1,y1) and (x2,y2) are points on a straight line and xval is the independent value, x, for which you wish to find y. -Code- linterp:=proc(x1,y1,x2,y2,xval) (y2-y1)/(x2-x1)*(xval-x1)+y1; end: __________________________________________ linterp2D(Table, colval, rowval); where Table is the lookup table of a specific format (see below) and colval and rowval are values for which the table needs to be interpolated. The function returns the interpolated value. Table structure is generally: Tablevalue, ColumnValue1, ColumnValue2, ….. RowValue1, IndValue(1,1), IndValue(1,2), … RowValue2, IndValue(2,1), IndValue(2,2), … …., …., …., -Code- linterp2D:=proc(Table, colparam, rowparam) local nrows,ncols,irow,icol,i,x1,y1,x2,y2,val_upper,val_lower; nrows,ncols:=LinearAlgebra:-Dimension(Table); for i from 2 to ncols do icol:=i; if Table[1,i]>colparam then i:=ncols; end if: end do: for i from 2 to nrows do irow:=i; if Table[i,1]>rowparam then i:=nrows; end if: end do: x1:=Table[1,icol-1]: y1:=Table[irow-1,icol-1]: x2:=Table[1,icol]: y2:=Table[irow-1,icol]: val_upper:=linterp(x1,y1,x2,y2,colparam): x1:=Table[1,icol-1]: y1:=Table[irow,icol-1]: x2:=Table[1,icol]: y2:=Table[irow,icol]: val_lower:=linterp(x1,y1,x2,y2,colparam): x1:=Table[irow-1,1]: y1:=val_upper: x2:=Table[irow,1]: y2:=val_lower: linterp(x1,y1,x2,y2,rowparam); end:
Page 1 of 1