Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 361 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@BlueSourBalls Your plot is totally correct, and your code is very good for a beginner. One tip: Don't use square brackets in place of parentheses. You have a stray square bracket in the line beginning f(x):=.

Since you indicate that you have a graph, please show the commands that you used to obtain it. Or show the graph.

@taro I don't see how it could possibly be even close to as good as MaplePrimes. There's already a huge unused question-answering capacity here.

@taro The plane is tangent to the sphere. The intersection is the single point (1,1,1); the intersection is not a circle.

What makes you think that your ability to divide the region into subintervals produces results any better (faster, more accuate, etc.) than Maple's own ability to determine how to do the integration over the whole domain?

You use epsilon = 1e-3, so the error in each subinterval can be as much as 1 part in 1000. Then you add together 5000+ such results. So, the end result has 0 significant digits (5000 x 1/1000 > 1).

@dharr Your technique works except for when $ is used as the end-of-parameters marker. In that case, ` $` will appear in op(1, eval(f)). Note that that's ` $`, not `$` (there's a space at the beginning).

Also, there's a distinction between parameters  and arguments, which I elaborate upon in my Answer below.

@ Yes, I explicitly wrote it to retain any trailing zeros that were included when the number was entered. I can remove them if you want. Trailing zeros convey information about precision; leading zeros (to the left of the decimal point) do not.

@savalan The problem that I see with these data-fitting methods is that they ignore that g(x) is a known function. This is not a data-fitting problem; it is a norm-minimization problem. The norm that I suggested using is N(f,g) = int(abs(f(x)-g(x)), x= A..B) for some suitable interval A..B; however, any norm will (theorethically) do the job of making f as close as possible to g. Squaring the abs inside the integral may make the computation easier, and it's just as valid.

Also, it's theorethically possible to use A = -infinity and/or B = infinity; it'll still be a valid norm. However, that may not be computationally feasible: The numeric integrations may take too long.

@Ronan 

sort(rts, key= abs);

@savalan We need a real interval A..B that contains the x-values. Then the function

H:= (a,b,c)-> evalf(Int(abs(f(x,a,b,c) - g(x)), x= A..B))

is a real-valued function of real variables. It should be possible to numerically approximate its minimum.

 

 

Is g(x) a known function? That is, can it be evaluated for any x (within a given range)? Or is its value only known for a specific sample of x-values?

@Kitonum The Question is to return the entry of minimal modulus; your code returns the minimal modulus of the entries. Those two things happen to be the same in this case, but that is just a coincidence.

@John Fredsted Thanks for spotting that.

@Rouben Rostamian  Suppose that f(t) is one of the functions (dependent variables) solved for by the command

dsolve(sys union {f(a) = fa}, numeric, ...);

and you want to compute F(T) = int(f(t), t= a..T). Then do

Sol:= dsolve(sys union {f(a) = fa, diff(F(t), t) = f(t), F(a) = 0}, numeric, ...);
eval(F(t), Sol(T));

where T is of type numeric.

Please let me know if you have any trouble implementing this.

@vv The command Logic:-Satisfy can be used to find an assignment of variables that makes a formula true.

First 351 352 353 354 355 356 357 Last Page 353 of 709