Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

How to sum two graphs in comsol?

Please login with a confirmed email address before reporting spam

I have builden in global definition branch two interpolation function.
I need to sum this two function and generate one graph.
In other words there is f(x) and g(x) which don't expression in elementary functions.
I want to plot graph like:
F(x) = f(x) + g(x);
How to do it?


5 Replies Last Post 2017年7月21日 GMT-4 13:05
Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2017年7月21日 GMT-4 12:20
Andrey,

Use expression int1(x)+int2(x) to plot the sum of interpolation functions int1(x) and int2(x), as shown in the attached mph file.

Regards,
Sergei
Andrey, Use expression int1(x)+int2(x) to plot the sum of interpolation functions int1(x) and int2(x), as shown in the attached mph file. Regards, Sergei


Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2017年7月21日 GMT-4 12:33
Sergei, can you to overwrite this file with version 5.2 or previous? I haven't late issue.
Sergei, can you to overwrite this file with version 5.2 or previous? I haven't late issue.

Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2017年7月21日 GMT-4 12:46
Andrey,

Attached is v5.2 file.

Regards,
Sergei
Andrey, Attached is v5.2 file. Regards, Sergei


Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2017年7月21日 GMT-4 13:00
Sergei!
Thanks a lot, and I love you.
Can you explain me one thing:
Why are you using in X-axis parameter "arc lenghth"?
To my mind need to take "expression" with value "t".
Sergei! Thanks a lot, and I love you. Can you explain me one thing: Why are you using in X-axis parameter "arc lenghth"? To my mind need to take "expression" with value "t".

Sergei Yushanov Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2017年7月21日 GMT-4 13:05
Andrey,

I use "x" as argument of the function because demo example is stationary type of problem.
As I understand, your problem is Time-dependent and you should use expression int1(t)+int2(t) in that case.

Regards,
Sergei
Andrey, I use "x" as argument of the function because demo example is stationary type of problem. As I understand, your problem is Time-dependent and you should use expression int1(t)+int2(t) in that case. Regards, Sergei

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.