tomleslie

13876 Reputation

20 Badges

15 years, 165 days

MaplePrimes Activity


These are replies submitted by tomleslie

@Carl Love 

The point about 1% is that it in some sense it quantifies "noeuds" - Now I have no idea what a "noeud" might be - my French just isn't adequate and google/translate doesn't help that much - eg "nodes" or "knots"

So I have no idea why "1% noeuds" might be an issue - I freely admit I am guessing

@Carl Love 

I rather thought that I had belaboured the point that the two functions were not inverses, even although it might be desirable that they should be

The OP's original question contains the statement

At what x value does the graph intersect with 1.5 on the y axis" or "at what y value does the graph intersect with 3000 on the x axis".

So (s)he does not seem to have a preferential direction for the fit. Without a preferential direction, I consider my original response reasonable. When I consider your comment, in particular the statement

getx:= y-> fsolve(gety(x)=y);

I fell obliged to ask - why did you decide not to use

gety:= x-> fsolve(getx(y)=x);

Do you have a preferential fit direction for some reason?

 

@krismalo 

getx(%) means run the getx() function using the result of the previous calculation.

So in my example

gety(3000)

means (based on the interpolation), get the y-value when x=3000. This returns 1.44616393471254.

The getx(%) command is then equivalent to getx(1.44616393471254) which if the two intepollations were equivalent and 100% accurate (which they will never be !), should return 3000, when in fact 2982.37053089974 is returned. I'd call this close enough!

Another way to look at this is to consider the construct

getx(gety(3000))

which (in a perfect world) ought to return 3000 exactly - because it computes the y-value for x=3000, and then computes the x-value for that y-value. However we are dealing with two independent numerical fits (which are therefore not exact inverses) - so one should expect to get "close" to the original argument, but not exactly

No-one here is going to retype all the equations in the pdf you supplied just to find where the bug might be

Suggest you upload your Maple worksheet using the big green up-arrow, so we can see where the problem might be

To Carl

My French is pretty bad, but the error message seems to be our old friend that "the length of the output exceeds the limit" - in other words output expression too long.

 

To the OP

Read the above - Maple has limit on the length of output expressions which it will produce - this is just to avoid the possibility that a user might produce an output which runs on for many, many pages. Almost impossible to fix this or suggest workarounds withut seeing the original worksheet as Carl suggested previously

@necron 

If I add the following code to the bottom of your worksheet

u2_pre := Int(c2, r= 0..0.2, numeric):
u21_pre := Int(u2_pre, y=0..100, numeric):
u21:= unapply(u21_pre,x):
seq( value(u21(j)), j=0..10);

then I get the answers



-0.3327478882e-9, 0.3498665080e-11, -0.7421174325e-14, 0.4419026106e-17, 0.6356197095e-22, 0.3680817282e-29, 0.2144563919e-35, 0.1895187295e-43, 0.6723280981e-52, 0.3835607198e-62, -0.3578285894e-71

Now whilst they are not identically zero - you have to admit they are close - so for exactly which values of u21(x) with x=0..10 do you expect non-zero answers?

 

A lot depends on how you "declared Et to be a vector" - you haven't specified so I can't comment. However if change the line in your original code

Et := ScalarMultiply(10*tau, E);

to

Et := ScalarMultiply(10*tau, E)[..,1];

then Et will be created as a vector and then

solve(Et[1],Q[1]);

will work as you desire

Please post example using the big green up-arrow at the right-hand end of the toolbar

Als might help to specify which version of Maple you are using

If I use the code

restart:
curva:= proc( m, t)
                     return 2*cos(2*Pi*t),
                     2*sin(2*Pi*t)*cos(2*Pi*m*t),
                     2*sin(2*Pi*t)*sin(2*Pi*m*t);
            end proc:
fun:= (a,b,c) -> evalf( int
                                 ( ( Pi*a*cos(Pi*x) +
                                      2*b*Pi*cos(2*Pi*x) +
                                      3*c*Pi*cos(3*Pi*x)
                                    )^2,
                                    x=0..1
                                 )
                               ):
fun(curva(2,t));
fun(curva(2,x));

Then fun(curva(2,t)) produces the answer which you posted.
The second of these (ie fun(curva(2,x)) ) produces the answer 75.02998738 as reported by Carl Love previously. Either of these is a logically, syntactically valid calculation, and I have no way of knowing which one you want

@rit You will also need three boundary conditions

@kippendorf

I just swapped  y1 and y2 and still got the message that g() is undefined - I think you may be deluding yourself if you think you have obtained a valid answer - but no way I can tell unless you post the code you are running

@kippendorf 

solnb := unapply(eval(soln, g(tau) = 3*cos(omega*tau)), omega);

returns

So g() is an unknown in this expression - it is not solved for!

@kippendorf 

Error message states

Warning, expecting only range variable t in expression 15.00000000*sin(1.1*t)+.7894736842*sin(2.9*t)-15.78947368*sin(t)-g(0)*sin(t) to be plotted but found name g

In the code you provide g() is never defined!!!

@Carl Love 

Even after serious browser refreshes etc I still see the OP's question as

30 minutes ago kippendorf 5

and your response as

52 minutes ago Carl Love 9087

Please tell me that you are not actually answering questions before they are asked??!!

More syntax errors than I have seen in a short code sequence: "fixing" (ie guessing what is meant) in all of  these leads me to the same conclsion as Carl examine the following carefully

   restart;
   v1 := int(cos(tau)*g(tau), tau = t0 .. t);
   int(cos(tau)*g(tau), tau = t0 .. t);
   v2 := int(-sin(tau)*g(tau), tau = t0 .. t);
   int(-sin(tau)*g(tau), tau = t0 .. t);
   soln := C1*y1+C2*y2+v1*y1+v2*y2;
#
# Next line computed but never used so ignore
# ie comment out
#
# C1*y1 + C2*y2 + (int(cos(tau)*g(tau), tau = t0 .. t))*y1+(int(-sin(tau)*g(tau), tau = t0 .. t))*y2;

   soln := combine(soln);
#
# Next line is computed but never used - so ignore
# ie comment out
#
# (int(-y2*sin(tau)*g(tau) + y1*cos(tau)*g(tau), tau = t0 .. t))+ C1*y1 + C2*y2;

# Next line is computed but never used - so ignore
# ie comment out
#
#  eval(soln, t = t0) = 0, eval(diff(soln, t), t = t0);

    C1*y1 + C2*y2 = 0, -y2*sin(t0)*g(t0) + y1*cos(t0)*g(t0)=0;
#
# The above represents two equations - but these are not two
# equations in the two unknowns, because C1, C2 occur in only
# one of the equations, so solving for C1, C2 is obviously
# impossible!
#
# Think I must have screwed up somewhere fixing all the other
# syntax errors
#
    solve({%}, {C1, C2});
#
# No point doing the following unless the previous command
# works - which it doesn't - but commenting it out removes
# the error nessage!!!
#  soln := eval(soln, %);

First 181 182 183 184 185 186 187 Last Page 183 of 207