Problem Plotting Functions

Problem Plotting Functions - Cannot plot function - Сообщения

#1 Опубликовано: 08.07.2023 02:43:26
RegRetired

RegRetired

8 сообщений из 130 понравились пользователям.

Группа: User

My Mathcad brain causes me to misunderstand some SMATH syntax. The is especially true in XY-Plots. I have created two function: F(s) and F1(s), which is discontinuous. If I redefine the functions as vectors and use augment to define the x-axis, the plots look okay. However, when I try to plot just the function, it does not work. These plots do not create a trace list as with the vector versions. F(s) just doesn’t plot. F1(s) also doesn’t plot, plus it gives an error.

In short, how do I plot simple functions?

Any help is appreciate, as always.


Plot Functions Question.sm (12 КиБ) скачан 33 раз(а).
Reg Curry Loveland, CO
#2 Опубликовано: 08.07.2023 03:33:26
Alvaro Diaz Falconi

Alvaro Diaz Falconi

992 сообщений из 1674 понравились пользователям.

Группа: User

Hi JReg. If I'm not wrong, just try to plot both with an undefined variable like F(so) and F1(so). The problem is that 's' is a vector.

Best regards.
#3 Опубликовано: 08.07.2023 07:28:35
RegRetired

RegRetired

8 сообщений из 130 понравились пользователям.

Группа: User

Razonar,
Thanks much. That works.

Hope you don't mind if I have a second question.

In this attached sm file, I calculate the solution to an ODE with those two driving functions. Note the last integral in the solution. If I use F(s) it works; however, F1(s) is the function I want in the integral. For some reason it does not work. You will have to change F to F1 in that last integral to see that it fails.

Have I missed something obvious?

Thanks again.EMISSION REDUCTION Test.sm (28 КиБ) скачан 31 раз(а).
Reg Curry Loveland, CO
#4 Опубликовано: 08.07.2023 10:39:50
StvMath

StvMath

35 сообщений из 56 понравились пользователям.

Группа: User

It works if you define F1 as: F1(z):=(M*(z-tstart)+Fexp(tstart))*(z≤tfinish)+Fexp(tfix)*(z>tfinish)

i.e. using Boolean values: (z≤tfinish) = 1 if true, 0 if false, etc.

Don't know why SMath has a problem integrating if.. else.. structures.
#5 Опубликовано: 08.07.2023 13:45:07
RegRetired

RegRetired

8 сообщений из 130 понравились пользователям.

Группа: User

Thanks. I’ll give that a try.
Reg Curry Loveland, CO
#6 Опубликовано: 08.07.2023 15:56:23
RegRetired

RegRetired

8 сообщений из 130 понравились пользователям.

Группа: User

Wrote

It works if you define F1 as: F1(z):=(M*(z-tstart)+Fexp(tstart))*(z≤tfinish)+Fexp(tfix)*(z>tfinish)

i.e. using Boolean values: (z≤tfinish) = 1 if true, 0 if false, etc.

Don't know why SMath has a problem integrating if.. else.. structures.



Thanks again. That really helped.

Reg Curry Loveland, CO
#7 Опубликовано: 09.07.2023 07:45:20
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Don't know why SMath has a problem integrating if.. else.. structures.


Smath integrates if/otherwise discontinuous functions.
Bolean must be specified completely, if NOT navigates.

Integrate Discontinuous.sm (36 КиБ) скачан 29 раз(а).
#8 Опубликовано: 10.07.2023 04:22:25
Вячеслав Мезенцев

Вячеслав Мезенцев

1402 сообщений из 1708 понравились пользователям.

Группа: Moderator

Due to the implementation features, you can't use the function argument the same way you do it in Mathcad. The component allows you to use a vector variable if you add a tilde before the name.

xyplot-tilda.png

Plot Functions Question (uni).sm (14 КиБ) скачан 37 раз(а).
Russia ☭ forever, Viacheslav N. Mezentsev
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений