Skip to main content
10-Marble
November 9, 2022
Solved

Vector input: integrating and solve blocks (MathCad Prime 8)

  • November 9, 2022
  • 2 replies
  • 2074 views

Hi, I noticed in the attached sheet that I couldn't integrate a function containing vector input. The same issue came up in my solve blocks trying to find a solution for an equation with vector input. I made a work around by splitting up the vector input in individual elements. Does anyone know a solution that doesn't involve splitting up the vector input? I have highlighted my questions in the attached sheet. Thank you!

Best answer by Werner_E

It may be a good idea to set up the whole sheet in a quite different way.

First define the necessary calculations via function with all variable values as input arguments. Don't define any vector values yet.

Later you can call those function with the vectors as arguments and of course you should vectorize the function call.

I did it with the functions necessary for the integral, starting with

Werner_E_0-1668030265082.png

and continuing with

Werner_E_1-1668030312624.png

Voilà!

 

According the solve  block all that is needed is to provide a vector as a guess and vectorize both sides of your equation:

Werner_E_2-1668030390505.png

 

 

 

2 replies

23-Emerald IV
November 9, 2022

You cannot use elements of an array as arguments to the Find function in a solve block.

You can use multiple expressions in a solve block though:

LucMeekes_0-1668029168540.png

with as result:

LucMeekes_1-1668029187346.png

Success!
Luc

ttokoro
21-Topaz I
21-Topaz I
November 10, 2022

image.pngimage.pngimage.png

t.t.
10-Marble
November 10, 2022

Very elegant solution, thanks! 

Werner_E25-Diamond IAnswer
25-Diamond I
November 9, 2022

It may be a good idea to set up the whole sheet in a quite different way.

First define the necessary calculations via function with all variable values as input arguments. Don't define any vector values yet.

Later you can call those function with the vectors as arguments and of course you should vectorize the function call.

I did it with the functions necessary for the integral, starting with

Werner_E_0-1668030265082.png

and continuing with

Werner_E_1-1668030312624.png

Voilà!

 

According the solve  block all that is needed is to provide a vector as a guess and vectorize both sides of your equation:

Werner_E_2-1668030390505.png

 

 

 

10-Marble
November 10, 2022

Oo yes that would be a good setup here. I'll make this one the solution since it answers both questions. 

 

Thanks again for the detailed answer! Much to learn still haha