from sympy import Symbol, Derivative, cos
import math 
pi= math.pi

t= Symbol('t')

function_t = 2*cos(2*math.pi*t)*2.718**(-(math.pi*t)/2)
f1 = (function_t.doit().subs({t:1.5}))
print("When t=1.5,", f1)

I can't find a way to calculate cos in degrees in this function.

Recommended Answers

All 3 Replies

The conversion between radians and degrees is: degrees = radians * 180 / pi .

You should be able to do this when the need arises.

commented: Where do i put this exactly in my function? When i calculate the derivative of this func, it does not work. +0

Maybe after line 8?

I get it that folk struggle to write code and some math but here most of us want you to write the code so you can fix it and maintain it later.

That is, if f1 is in radians, now you know how to convert to degrees so add a line if you must.

if memory serve me well, there should be a python module which can do the calculation you need.....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.