## 94 Reputation

15 years, 77 days

## Compose two functions and plot...

Maple

Forgive me for not using the "Maple Math" and "Maple Plot" commands.  I tried, but it says everything that I enter is an invalid expression so I'm just entering it as text...

I define two functions, they plot as expected:

f(x) := sin(x);

g(x) := 2*x;

plot( f(x) );

plot( g(x) );

Now I want to plot the composition:

plot( f(g(x)) );

Doesn't work!

## Cannot call SVD...

Maple

I'm getting an error trying to get the singular vector of this matrix:

e2 := Normalize(<100,200,1>, Euclidean):
e3 := Normalize(<-500,-600,1>, Euclidean):
a := e2(1):
b := e2(2):
c := e2(3):
d := e3(1):
e := e3(2):
f := e3(3):
A := Matrix( [[a,b,c], [d,e,f], [a,e,f]] );

SingularValues(A, output='Vt');
Error, (in LinearAlgebra:-LA_Main:-SingularValues) Matrix of type complex(extended_numeric) required for output object(s) [Vt]

## Breaking up large equation...

Maple

I frequently end up with large equations with many repeated sub-expressions.  These equations could be made infinitely more readable if this one expression were broken up into several expressions to calculate the sub-expressinos and store them in auxiliary variables.  This is not just good for readability...it is also useful when it comes time to move the results into a programming implementation (Maple is just a playground).

## Breaking up a large expression...

Maple

Say I have an expression like this:

E = 1/(x^2 + y^2) + (x^2+y^2)

And let's say I want to make a substitution for t = (x^2 + y^2);

E = 1/t + t

Now I want to be able to differentiate this.  eg,

diff(E, x)

I should get:

- dt/dx / t^2 + dt/dx

How can I make Maple provide output in this form?  ie, I do not want to see an output of - 2*x/(x^2+y^2)^2 + 2*x

## Spline in 3D?...

Maple

I see that there is a command for a 2D spline:

Spline(xydata, v, dgr, endpts)
Spline(xdata, ydata, v, dgr, endpts)

But my data is (x,y,z).  Surely there is some way to fit a spline curve to this?  I'm not asking for a surface -- it's just a list of points.

 1 2 Page 1 of 2
﻿